Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(config): adds test related to allowJs
- Loading branch information
Showing
7 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as foo from './foo' | ||
import bar = require('./bar') | ||
|
||
test('foo', () => { | ||
expect(foo).toBe('FOO!') | ||
}) | ||
|
||
test('bar', () => { | ||
expect(bar).toBe('BAR!') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export = 'BAR!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = 'FOO!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const foo = require('./foo') | ||
const bar = require('./bar') | ||
|
||
test('foo', () => { | ||
expect(foo).toBe('FOO!') | ||
}) | ||
|
||
test('bar', () => { | ||
expect(bar).toBe('BAR!') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"allowJs": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Allow JS test should pass using template "default" 1`] = ` | ||
√ jest | ||
↳ exit code: 0 | ||
===[ STDOUT ]=================================================================== | ||
===[ STDERR ]=================================================================== | ||
PASS ./bar.spec.ts | ||
PASS ./foo.spec.js | ||
Test Suites: 2 passed, 2 total | ||
Tests: 4 passed, 4 total | ||
Snapshots: 0 total | ||
Time: XXs | ||
Ran all test suites. | ||
================================================================================ | ||
`; | ||
|
||
exports[`Allow JS test should pass using template "with-babel-6" 1`] = ` | ||
√ jest | ||
↳ exit code: 0 | ||
===[ STDOUT ]=================================================================== | ||
===[ STDERR ]=================================================================== | ||
PASS ./bar.spec.ts | ||
PASS ./foo.spec.js | ||
Test Suites: 2 passed, 2 total | ||
Tests: 4 passed, 4 total | ||
Snapshots: 0 total | ||
Time: XXs | ||
Ran all test suites. | ||
================================================================================ | ||
`; | ||
|
||
exports[`Allow JS test should pass using template "with-babel-7" 1`] = ` | ||
√ jest | ||
↳ exit code: 0 | ||
===[ STDOUT ]=================================================================== | ||
===[ STDERR ]=================================================================== | ||
PASS ./bar.spec.ts | ||
PASS ./foo.spec.js | ||
Test Suites: 2 passed, 2 total | ||
Tests: 4 passed, 4 total | ||
Snapshots: 0 total | ||
Time: XXs | ||
Ran all test suites. | ||
================================================================================ | ||
`; | ||
|
||
exports[`Allow JS test should pass using template "with-jest-22" 1`] = ` | ||
√ jest | ||
↳ exit code: 0 | ||
===[ STDOUT ]=================================================================== | ||
===[ STDERR ]=================================================================== | ||
PASS ./bar.spec.ts | ||
PASS ./foo.spec.js | ||
Test Suites: 2 passed, 2 total | ||
Tests: 4 passed, 4 total | ||
Snapshots: 0 total | ||
Time: XXs | ||
Ran all test suites. | ||
================================================================================ | ||
`; | ||
|
||
exports[`Allow JS test should pass using template "with-typescript-2-7" 1`] = ` | ||
√ jest | ||
↳ exit code: 0 | ||
===[ STDOUT ]=================================================================== | ||
===[ STDERR ]=================================================================== | ||
PASS ./bar.spec.ts | ||
PASS ./foo.spec.js | ||
Test Suites: 2 passed, 2 total | ||
Tests: 4 passed, 4 total | ||
Snapshots: 0 total | ||
Time: XXs | ||
Ran all test suites. | ||
================================================================================ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { allValidPackageSets } from '../__helpers__/templates' | ||
import { configureTestCase } from '../__helpers__/test-case' | ||
|
||
describe('Allow JS test', () => { | ||
const testCase = configureTestCase('allow-js') | ||
|
||
testCase.runWithTemplates(allValidPackageSets, 0, (runTest, { testLabel }) => { | ||
it(testLabel, () => { | ||
const result = runTest() | ||
expect(result.status).toBe(0) | ||
expect(result).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |