diff --git a/e2e/__cases__/enum/constants.ts b/e2e/__cases__/enum/constants.ts new file mode 100644 index 0000000000..952f84fe9c --- /dev/null +++ b/e2e/__cases__/enum/constants.ts @@ -0,0 +1,4 @@ +export enum MyEnum { + one = 'ONE', + two = 'TWO', +} diff --git a/e2e/__cases__/enum/enum.spec.ts b/e2e/__cases__/enum/enum.spec.ts new file mode 100644 index 0000000000..7dbc111b1d --- /dev/null +++ b/e2e/__cases__/enum/enum.spec.ts @@ -0,0 +1,6 @@ +import { MyEnum } from './constants' + +it('should pass', () => { + expect(MyEnum.one).toBe('ONE') + expect(MyEnum.two).toBe('TWO') +}) diff --git a/e2e/__tests__/enum.test.ts b/e2e/__tests__/enum.test.ts new file mode 100644 index 0000000000..70aae523dc --- /dev/null +++ b/e2e/__tests__/enum.test.ts @@ -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) + }) + }) +}) diff --git a/src/config/config-set.spec.ts b/src/config/config-set.spec.ts index 94ab092938..27b6b342b9 100644 --- a/src/config/config-set.spec.ts +++ b/src/config/config-set.spec.ts @@ -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([]) })