Skip to content

Commit

Permalink
test: add e2e tests for adding mts and cts to default `moduleFile…
Browse files Browse the repository at this point in the history
…Extensions` config
  • Loading branch information
yinm committed Jul 28, 2023
1 parent 7c3e570 commit c004324
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
16 changes: 16 additions & 0 deletions e2e/__tests__/testMatchTs.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import {extractSummary} from '../Utils';
import runJest from '../runJest';

it('testMatch should able to match file with cts and mts extension', () => {
const result = runJest('test-match-ts');
expect(result.exitCode).toBe(0);
const {summary} = extractSummary(result.stderr);
expect(summary).toMatchSnapshot();
});
10 changes: 10 additions & 0 deletions e2e/test-match-ts/__tests__/sample-suite.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

test('mts extension', () => {
expect(1).toBe(1);
});
10 changes: 10 additions & 0 deletions e2e/test-match-ts/__tests__/sample-suite2.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

test('cts extension', () => {
expect(1).toBe(1);
});
7 changes: 7 additions & 0 deletions e2e/test-match-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"jest": {
"testMatch": [
"**/__tests__/*.?ts"
]
}
}

0 comments on commit c004324

Please sign in to comment.