Skip to content

Commit

Permalink
chore(e2e): add enum test, adjust imported babel config test (#1334)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl authored Dec 31, 2019
1 parent 78a53c2 commit dd816ab
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
4 changes: 4 additions & 0 deletions e2e/__cases__/enum/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum MyEnum {
one = 'ONE',
two = 'TWO',
}
6 changes: 6 additions & 0 deletions e2e/__cases__/enum/enum.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { MyEnum } from './constants'

it('should pass', () => {
expect(MyEnum.one).toBe('ONE')
expect(MyEnum.two).toBe('TWO')
})
13 changes: 13 additions & 0 deletions e2e/__tests__/enum.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { allValidPackageSets } from '../__helpers__/templates'
import { configureTestCase } from '../__helpers__/test-case'

describe('Enum', () => {
const testCase = configureTestCase('enum')

testCase.runWithTemplates(allValidPackageSets, 0, (runTest, { testLabel }) => {
it(testLabel, () => {
const result = runTest()
expect(result.status).toBe(0)
})
})
})
6 changes: 2 additions & 4 deletions src/config/config-set.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,14 @@ describe('tsJest', () => {
})

it('should be correct for imported javascript file', () => {
const FILE = '__mocks__/babel-foo.config.js'
const cs = createConfigSet({
jestConfig: { rootDir: 'src', cwd: 'src' } as any,
tsJestConfig: {
babelConfig: FILE,
babelConfig: require('../__mocks__/babel-foo.config'),
},
resolve: null,
})
expect(cs.tsJest.babelConfig!.kind).toEqual('file')
expect(cs.tsJest.babelConfig!.value).toContain('babel-foo.config.js')
expect(cs.tsJest.babelConfig!.kind).toEqual('inline')
expect(cs.babel?.plugins).toEqual([])
expect(cs.babel?.presets).toEqual([])
})
Expand Down

0 comments on commit dd816ab

Please sign in to comment.