Skip to content

Commit c004324

Browse files
committed
test: add e2e tests for adding mts and cts to default moduleFileExtensions config
1 parent 7c3e570 commit c004324

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

e2e/__tests__/testMatchTs.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import {extractSummary} from '../Utils';
9+
import runJest from '../runJest';
10+
11+
it('testMatch should able to match file with cts and mts extension', () => {
12+
const result = runJest('test-match-ts');
13+
expect(result.exitCode).toBe(0);
14+
const {summary} = extractSummary(result.stderr);
15+
expect(summary).toMatchSnapshot();
16+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
test('mts extension', () => {
9+
expect(1).toBe(1);
10+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
test('cts extension', () => {
9+
expect(1).toBe(1);
10+
});

e2e/test-match-ts/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"jest": {
3+
"testMatch": [
4+
"**/__tests__/*.?ts"
5+
]
6+
}
7+
}

0 commit comments

Comments
 (0)