Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: verify all packages have the same engine requirement #9871

Merged
merged 5 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ module.exports = {
'**/__mocks__/**',
'**/?(*.)(spec|test).js?(x)',
'scripts/**',
'eslintImportResolver.js',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was used for flow type alias imports

'babel.config.js',
'testSetupFile.js',
],
},
Expand Down
11 changes: 8 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
* LICENSE file in the root directory of this source tree.
*/

const semver = require('semver');
const pkg = require('./package.json');

const supportedNodeVersion = semver.minVersion(pkg.engines.node).version;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preset-env doesn't support semver operators, so this is used to get the actual minimum version as a string (resolves to 8.3.0)


module.exports = {
babelrcRoots: ['examples/*'],
// we don't wanna run the transforms in this file over react native
Expand All @@ -15,7 +20,7 @@ module.exports = {
'babel-plugin-typescript-strip-namespaces',
'babel-plugin-replace-ts-export-assignment',
require.resolve(
'./scripts/babel-plugin-jest-replace-ts-require-assignment.js'
'./scripts/babel-plugin-jest-replace-ts-require-assignment.js',
),
],
presets: ['@babel/preset-typescript'],
Expand All @@ -31,7 +36,7 @@ module.exports = {
{
exclude: ['@babel/plugin-proposal-dynamic-import'],
shippedProposals: true,
targets: {node: '8.3'},
targets: {node: supportedNodeVersion},
},
],
],
Expand All @@ -48,7 +53,7 @@ module.exports = {
'@babel/preset-env',
{
shippedProposals: true,
targets: {node: '8.3'},
targets: {node: supportedNodeVersion},
},
],
],
Expand Down
20 changes: 10 additions & 10 deletions e2e/__tests__/__snapshots__/each.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ FAIL __tests__/failure.test.js
28 | ({left, right}) => {
> 29 | expect(left).toBe(right);
| ^
30 | }
30 | },
31 | );
32 |

Expand All @@ -222,7 +222,7 @@ FAIL __tests__/failure.test.js
39 | ({left, right}) => {
> 40 | expect(left).toBe(right);
| ^
41 | }
41 | },
42 | );
43 |

Expand All @@ -239,7 +239,7 @@ FAIL __tests__/failure.test.js
39 | ({left, right}) => {
> 40 | expect(left).toBe(right);
| ^
41 | }
41 | },
42 | );
43 |

Expand All @@ -256,7 +256,7 @@ FAIL __tests__/failure.test.js
46 | word => {
> 47 | expect(/z/.test(word)).toBe(true);
| ^
48 | }
48 | },
49 | );
50 |

Expand All @@ -273,7 +273,7 @@ FAIL __tests__/failure.test.js
46 | word => {
> 47 | expect(/z/.test(word)).toBe(true);
| ^
48 | }
48 | },
49 | );
50 |

Expand All @@ -290,7 +290,7 @@ FAIL __tests__/failure.test.js
46 | word => {
> 47 | expect(/z/.test(word)).toBe(true);
| ^
48 | }
48 | },
49 | );
50 |

Expand All @@ -308,7 +308,7 @@ FAIL __tests__/failure.test.js
> 59 | expect(left).toBe(right);
| ^
60 | });
61 | }
61 | },
62 | );

at Object.toBe (__tests__/failure.test.js:59:20)
Expand All @@ -325,7 +325,7 @@ FAIL __tests__/failure.test.js
> 59 | expect(left).toBe(right);
| ^
60 | });
61 | }
61 | },
62 | );

at Object.toBe (__tests__/failure.test.js:59:20)
Expand All @@ -342,7 +342,7 @@ FAIL __tests__/failure.test.js
> 71 | expect(left).toBe(right);
| ^
72 | });
73 | }
73 | },
74 | );

at Object.toBe (__tests__/failure.test.js:71:20)
Expand All @@ -359,7 +359,7 @@ FAIL __tests__/failure.test.js
> 71 | expect(left).toBe(right);
| ^
72 | });
73 | }
73 | },
74 | );

at Object.toBe (__tests__/failure.test.js:71:20)
Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/errorOnDeprecated.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ FAIL __tests__/jasmine.objectContaining.test.js

9 | test('jasmine.objectContaining', () => {
10 | expect({input: 'trash', output: 'trash'}).toEqual(
> 11 | jasmine.objectContaining({output: 'trash'})
> 11 | jasmine.objectContaining({output: 'trash'}),
| ^
12 | );
13 | });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ FAIL __tests__/failure.test.js
21 | it('fail with expected promise values and not', () =>
> 22 | expect(Promise.resolve([1, 2])).resolves.not.toHaveLengthAsync(
| ^
23 | Promise.resolve(2)
23 | Promise.resolve(2),
24 | ));
25 |

Expand Down
14 changes: 7 additions & 7 deletions e2e/__tests__/__snapshots__/toMatchInlineSnapshot.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test('handles property matchers', () => {
Object {
"createdAt": Any<Date>,
}
\`
\`,
);
});

Expand All @@ -85,7 +85,7 @@ expect({createdAt: "string"}).toMatchInlineSnapshot(
Object {
"createdAt": Any<Date>,
}
\`
\`,
);
});
`;
Expand All @@ -98,7 +98,7 @@ test('handles property matchers', () => {
Object {
"createdAt": Any<Date>,
}
\`
\`,
);
});

Expand All @@ -112,7 +112,7 @@ test('handles property matchers', () => {
Object {
"createdAt": Any<String>,
}
\`
\`,
);
});

Expand Down Expand Up @@ -192,7 +192,7 @@ test('removes obsolete external snapshots', () => {
exports[`supports async matchers 1`] = `
test('inline snapshots', async () => {
expect(Promise.resolve('success')).resolves.toMatchInlineSnapshot(
\`"success"\`
\`"success"\`,
);
expect(Promise.reject('fail')).rejects.toMatchInlineSnapshot(\`"fail"\`);
});
Expand Down Expand Up @@ -221,7 +221,7 @@ expect.extend({
createdAt: expect.any(Date),
id: expect.any(Number),
},
...args
...args,
);
},
});
Expand All @@ -242,7 +242,7 @@ test('inline snapshots', () => {
"id": Any<Number>,
"name": "LeBron James",
}
\`
\`,
);
expect(user).toMatchUserInlineSnapshot(\`
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`should support rejecting promises 1`] = `
test('should support rejecting promises', async () => {
await expect(
Promise.reject(new Error('octopus'))
Promise.reject(new Error('octopus')),
).rejects.toThrowErrorMatchingInlineSnapshot(\`"octopus"\`);
});

Expand Down
2 changes: 1 addition & 1 deletion e2e/coverage-handlebars/__tests__/greet.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ const greet = require('../greet.hbs');

test('am', () => {
expect(greet({am: true, name: 'Joe'})).toEqual(
'<p>Good\n morning\nJoe!</p>\n'
'<p>Good\n morning\nJoe!</p>\n',
);
});
2 changes: 1 addition & 1 deletion e2e/coverage-report/notRequiredInTestSuite.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

throw new Error(
`this error should not be a problem because` +
`this file is never required or executed`
`this file is never required or executed`,
);

// Flow annotations to make sure istanbul can instrument non ES6 source
Expand Down
2 changes: 1 addition & 1 deletion e2e/custom-test-sequencer/testSequencerAsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CustomSequencer extends Sequencer {
setTimeout(() => {
const copyTests = Array.from(tests);
resolve(
copyTests.sort((testA, testB) => (testA.path > testB.path ? 1 : -1))
copyTests.sort((testA, testB) => (testA.path > testB.path ? 1 : -1)),
);
}, 50);
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/each/__tests__/describeOnly.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ describe.each([[false, true]])(
it('fails', () => {
expect(left).toBe(right);
});
}
},
);
4 changes: 2 additions & 2 deletions e2e/each/__tests__/eachException.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ it.each`
'throws exception when one argument too few are supplied $left == $right',
({left, right}) => {
expect(left).toBe(right);
}
},
);

it.each`
Expand All @@ -23,5 +23,5 @@ it.each`
'throws exception when not enough arguments are supplied $left == $right',
({left, right}) => {
expect(left).toBe(right);
}
},
);
2 changes: 1 addition & 1 deletion e2e/each/__tests__/eachOnly.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ it.each`
'Should not be ran: fails all rows expected $left == $right',
({left, right}) => {
expect(left).toBe(right);
}
},
);
2 changes: 1 addition & 1 deletion e2e/each/__tests__/eachSkip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ it.skip.each`
'Should not be ran: fails all rows expected $left == $right',
({left, right}) => {
expect(left).toBe(right);
}
},
);

describe.skip.each([
Expand Down
10 changes: 5 additions & 5 deletions e2e/each/__tests__/failure.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ it.each`
'template table fails on one row expected: $left == $right',
({left, right}) => {
expect(left).toBe(right);
}
},
);

it.each`
Expand All @@ -38,14 +38,14 @@ it.each`
'template table fails on all rows expected: $left == $right',
({left, right}) => {
expect(left).toBe(right);
}
},
);

test.each(['red', 'green', 'bean'])(
"The word %s contains the letter 'z'",
word => {
expect(/z/.test(word)).toBe(true);
}
},
);

describe.each`
Expand All @@ -58,7 +58,7 @@ describe.each`
it('fails ', () => {
expect(left).toBe(right);
});
}
},
);

describe.each([
Expand All @@ -70,5 +70,5 @@ describe.each([
it('fails', () => {
expect(left).toBe(right);
});
}
},
);
2 changes: 1 addition & 1 deletion e2e/each/__tests__/success.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.each(['red', 'green', 'bean'])(
"The word %s contains the letter 'e'",
word => {
expect(/e/.test(word)).toBe(true);
}
},
);

it.each([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

test('jasmine.objectContaining', () => {
expect({input: 'trash', output: 'trash'}).toEqual(
jasmine.objectContaining({output: 'trash'})
jasmine.objectContaining({output: 'trash'}),
);
});
2 changes: 1 addition & 1 deletion e2e/expect-async-matcher/__tests__/failure.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ it('fail with expected promise values', () =>

it('fail with expected promise values and not', () =>
expect(Promise.resolve([1, 2])).resolves.not.toHaveLengthAsync(
Promise.resolve(2)
Promise.resolve(2),
));
2 changes: 1 addition & 1 deletion e2e/expect-async-matcher/__tests__/success.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ it('works with expected promise values', () =>

it('works with expected promise values and not', () =>
expect(Promise.resolve([1, 2])).resolves.not.toHaveLengthAsync(
Promise.resolve(1)
Promise.resolve(1),
));
2 changes: 1 addition & 1 deletion e2e/expect-async-matcher/matchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

export async function toHaveLengthAsync(
received: any,
lengthPromise: Promise<number>
lengthPromise: Promise<number>,
) {
const length = await lengthPromise;

Expand Down
4 changes: 2 additions & 2 deletions e2e/expect-in-vm/__tests__/expect-in-vm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ it('correctly expects RegExp inside a new VM context', () => {
`(function(require, module, exports, __dirname, __filename, expect) {
expect('ab12cd').toMatch(/ab12cd/);
})`,
global
global,
);

const module = {
Expand All @@ -28,6 +28,6 @@ it('correctly expects RegExp inside a new VM context', () => {
module.exports,
__dirname,
__filename,
expect
expect,
);
});
Loading