Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit84bf63a

Browse files
committed
Merge branch 'main' into align-pretty-format-and-test-renderer-single-string-child
2 parents303cafb +2cfb274 commit84bf63a

File tree

120 files changed

+927
-858
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+927
-858
lines changed

‎.eslintrc.cjs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ module.exports = {
4242
{
4343
extends:[
4444
'plugin:@typescript-eslint/recommended',
45-
'plugin:@typescript-eslint/eslint-recommended',
4645
'plugin:import/typescript',
4746
],
4847
files:['*.ts','*.tsx'],
@@ -64,6 +63,10 @@ module.exports = {
6463
// TODO: enable at some point
6564
'@typescript-eslint/no-explicit-any':'off',
6665
'@typescript-eslint/no-non-null-assertion':'off',
66+
67+
// TODO: part of "stylistic" rules, remove explicit activation when that lands
68+
'@typescript-eslint/no-empty-function':'error',
69+
'@typescript-eslint/no-empty-interface':'error',
6770
},
6871
},
6972
{
@@ -592,6 +595,7 @@ module.exports = {
592595
yoda:'off',
593596

594597
'unicorn/explicit-length-check':'error',
598+
'unicorn/no-array-for-each':'error',
595599
'unicorn/no-negated-condition':'error',
596600
'unicorn/prefer-default-parameters':'error',
597601
'unicorn/prefer-includes':'error',

‎.github/workflows/nodejs.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,36 @@ jobs:
124124
test-ubuntu:
125125
uses:./.github/workflows/test.yml
126126
needs:prepare-yarn-cache-ubuntu
127+
strategy:
128+
fail-fast:false
129+
matrix:
130+
shard:['1/4', '2/4', '3/4', '4/4']
131+
name:Ubuntu with shard ${{ matrix.shard }}
127132
with:
128133
os:ubuntu-latest
134+
shard:${{ matrix.shard }}
129135
test-macos:
130136
uses:./.github/workflows/test.yml
131137
needs:prepare-yarn-cache-macos
138+
strategy:
139+
fail-fast:false
140+
matrix:
141+
shard:['1/3', '2/3', '3/3']
142+
name:macOS with shard ${{ matrix.shard }}
132143
with:
133144
os:macos-latest
145+
shard:${{ matrix.shard }}
134146
test-windows:
135147
uses:./.github/workflows/test.yml
136148
needs:prepare-yarn-cache-windows
149+
strategy:
150+
fail-fast:false
151+
matrix:
152+
shard:['1/4', '2/4', '3/4', '4/4']
153+
name:Windows with shard ${{ matrix.shard }}
137154
with:
138155
os:windows-latest
156+
shard:${{ matrix.shard }}
139157

140158
test-leak:
141159
name:Node LTS on Ubuntu with leak detection

‎.github/workflows/test.yml‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ on:
66
os:
77
required:true
88
type:string
9+
shard:
10+
required:true
11+
type:string
912

1013
jobs:
1114
test:
1215
strategy:
1316
fail-fast:false
1417
matrix:
1518
node-version:[16.x, 18.x, 20.x]
16-
shard:['1/4', '2/4', '3/4', '4/4']
17-
name:Node v${{ matrix.node-version }} on ${{ inputs.os }} (${{ matrix.shard }})
19+
name:Node v${{ matrix.node-version }}
1820
runs-on:${{ inputs.os }}
1921

2022
steps:
@@ -34,14 +36,10 @@ jobs:
3436
id:cpu-cores
3537
uses:SimenB/github-actions-cpu-cores@v2
3638
-name:run tests
37-
run:yarn test-ci-partial:parallel --max-workers ${{ steps.cpu-cores.outputs.count }} --shard=${{matrix.shard }}
39+
run:yarn test-ci-partial:parallel --max-workers ${{ steps.cpu-cores.outputs.count }} --shard=${{inputs.shard }}
3840

3941
test-jasmine:
40-
strategy:
41-
fail-fast:false
42-
matrix:
43-
shard:['1/4', '2/4', '3/4', '4/4']
44-
name:Node LTS on ${{ inputs.os }} using jest-jasmine2 (${{ matrix.shard }})
42+
name:Node LTS using jest-jasmine2
4543
runs-on:${{ inputs.os }}
4644

4745
steps:
@@ -61,4 +59,4 @@ jobs:
6159
id:cpu-cores
6260
uses:SimenB/github-actions-cpu-cores@v2
6361
-name:run tests using jest-jasmine
64-
run:yarn jest-jasmine-ci --max-workers ${{ steps.cpu-cores.outputs.count }} --shard=${{matrix.shard }}
62+
run:yarn jest-jasmine-ci --max-workers ${{ steps.cpu-cores.outputs.count }} --shard=${{inputs.shard }}

‎CHANGELOG.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
###Features
44

5-
-`[jest-test-sequencer, jest-core]` Exposes globalConfig & contexts to TestSequencer ([#14535](https://github.com/jestjs/jest/pull/14535))
5+
-`[jest-environment-jsdom]`[**BREAKING**] Upgrade JSDOM to v22 ([#13825](https://github.com/jestjs/jest/pull/13825))
6+
-`[@jest/test-sequencer, jest-core]`[**BREAKING**] Exposes`globalConfig` &`contexts` to`TestSequencer` ([#14535](https://github.com/jestjs/jest/pull/14535), &[#14543](https://github.com/jestjs/jest/pull/14543))
67
-`[pretty-format]`[**BREAKING**] Do not render empty string children (`''`) in React plugin ([#14470](https://github.com/facebook/jest/pull/14470))
78

89
###Fixes

‎e2e/MockStdinWatchPlugin.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MockStdinWatchPlugin {
2020
apply(jestHooks){
2121
jestHooks.onTestRunComplete(()=>{
2222
const{keys}=this._config.input.shift();
23-
keys.forEach(key=>this._stdin.emit('data',key));
23+
for(constkeyofkeys)this._stdin.emit('data',key);
2424
});
2525
}
2626
}

‎e2e/Utils.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const writeFiles = (
128128
files:{[filename:string]:string},
129129
)=>{
130130
fs.mkdirSync(directory,{recursive:true});
131-
Object.keys(files).forEach(fileOrPath=>{
131+
for(constfileOrPathofObject.keys(files)){
132132
constdirname=path.dirname(fileOrPath);
133133

134134
if(dirname!=='/'){
@@ -138,15 +138,15 @@ export const writeFiles = (
138138
path.resolve(directory, ...fileOrPath.split('/')),
139139
dedent(files[fileOrPath]),
140140
);
141-
});
141+
}
142142
};
143143

144144
exportconstwriteSymlinks=(
145145
directory:string,
146146
symlinks:{[existingFile:string]:string},
147147
)=>{
148148
fs.mkdirSync(directory,{recursive:true});
149-
Object.keys(symlinks).forEach(fileOrPath=>{
149+
for(constfileOrPathofObject.keys(symlinks)){
150150
constsymLinkPath=symlinks[fileOrPath];
151151
constdirname=path.dirname(symLinkPath);
152152

@@ -158,7 +158,7 @@ export const writeSymlinks = (
158158
path.resolve(directory, ...symLinkPath.split('/')),
159159
'junction',
160160
);
161-
});
161+
}
162162
};
163163

164164
constNUMBER_OF_TESTS_TO_FORCE_USING_WORKERS=25;

‎e2e/__tests__/coverageRemapping.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ it('maps code coverage against original source', () => {
2727
constcoverageMap=JSON.parse(readFileSync(coverageMapFile,'utf-8'));
2828

2929
// reduce absolute paths embedded in the coverage map to just filenames
30-
Object.keys(coverageMap).forEach(filename=>{
30+
for(constfilenameofObject.keys(coverageMap)){
3131
coverageMap[filename].path=path.basename(coverageMap[filename].path);
3232
deletecoverageMap[filename].hash;
3333
coverageMap[path.basename(filename)]=coverageMap[filename];
3434
deletecoverageMap[filename];
35-
});
35+
}
3636
expect(coverageMap).toMatchSnapshot();
3737
});

‎e2e/__tests__/coverageTransformInstrumented.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ it('code coverage for transform instrumented code', () => {
2727
constcoverageMap=JSON.parse(readFileSync(coverageMapFile,'utf-8'));
2828

2929
// reduce absolute paths embedded in the coverage map to just filenames
30-
Object.keys(coverageMap).forEach(filename=>{
30+
for(constfilenameofObject.keys(coverageMap)){
3131
coverageMap[filename].path=path.basename(coverageMap[filename].path);
3232
deletecoverageMap[filename].hash;
3333
coverageMap[path.basename(filename)]=coverageMap[filename];
3434
deletecoverageMap[filename];
35-
});
35+
}
3636
expect(coverageMap).toMatchSnapshot();
3737
});

‎e2e/__tests__/errorOnDeprecated.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const SHOULD_NOT_PASS_IN_JEST = new Set([
3131
'spyOnProperty.test.js',
3232
]);
3333

34-
testFiles.forEach(testFile=>{
34+
for(consttestFileoftestFiles){
3535
test(`${testFile} errors in errorOnDeprecated mode`,()=>{
3636
constresult=runJest('error-on-deprecated',[
3737
testFile,
@@ -42,9 +42,9 @@ testFiles.forEach(testFile => {
4242

4343
expect(rest).toMatchSnapshot();
4444
});
45-
});
45+
}
4646

47-
testFiles.forEach(testFile=>{
47+
for(consttestFileoftestFiles){
4848
constshouldPass=SHOULD_NOT_PASS_IN_JEST.has(testFile);
4949

5050
constexpectation=`${testFile}${shouldPass ?'errors' :'passes'}`;
@@ -54,4 +54,4 @@ testFiles.forEach(testFile => {
5454
constresult=runJest('error-on-deprecated',[testFile]);
5555
expect(result.exitCode).toBe(shouldPass ?1 :0);
5656
});
57-
});
57+
}

‎e2e/__tests__/snapshot.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,19 @@ const getSnapshotOfCopy = () => {
7070

7171
describe('Snapshot',()=>{
7272
constcleanup=()=>{
73-
[
73+
for(constfileof[
7474
snapshotFile,
7575
secondSnapshotFile,
7676
snapshotOfCopy,
7777
copyOfTestPath,
7878
snapshotEscapeFile,
7979
snapshotEscapeRegexFile,
8080
snapshotEscapeSubstitutionFile,
81-
].forEach(file=>{
81+
]){
8282
if(fileExists(file)){
8383
fs.unlinkSync(file);
8484
}
85-
});
85+
}
8686
if(fileExists(snapshotDir)){
8787
fs.rmdirSync(snapshotDir);
8888
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp