Skip to content

Commit

Permalink
v9: update babel and jest
Browse files Browse the repository at this point in the history
  • Loading branch information
also committed May 1, 2024
1 parent 3cd9177 commit 3221f71
Show file tree
Hide file tree
Showing 10 changed files with 2,133 additions and 1,473 deletions.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.10.0
20.11.0
1 change: 0 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ module.exports = {
plugins: [
'@babel/transform-flow-strip-types',
'@babel/transform-modules-commonjs',
'@babel/syntax-object-rest-spread',
],
};
7 changes: 7 additions & 0 deletions jest.config.base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
coverageDirectory: './coverage/',
collectCoverage: true,
transform: {
'\\.[jt]sx?$': ['babel-jest', {rootMode: 'upward'}],
},
};
2 changes: 0 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module.exports = {
projects: ['<rootDir>/packages/*'],
coverageDirectory: './coverage/',
collectCoverage: true,
};
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"private": true,
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/plugin-syntax-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
"@babel/plugin-transform-modules-commonjs": "^7.1.0",
"babel-core": "^7.0.0-bridge.0",
"@babel/cli": "7.20.7",
"@babel/core": "7.20.12",
"@babel/plugin-transform-flow-strip-types": "7.19.0",
"@babel/plugin-transform-modules-commonjs": "7.20.11",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"babel-jest": "29.7.0",
"eslint": "4.17.0",
"flow-bin": "^0.83.0",
"flow-typed": "^2.5.1",
"jest": "^23.6.0",
"jest": "29.7.0",
"lerna": "^3.4.3",
"prettier": "^1.14.3"
},
Expand Down
164 changes: 82 additions & 82 deletions packages/sporks/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,102 +5,102 @@ import { parse } from '../src';
describe('parse', () => {
it('parses #=', () => {
expect(parse('#= hello world')).toMatchInlineSnapshot(`
Object {
"directives": Array [
Object {
"args": Array [
"world",
],
"directive": "hello",
"loc": Object {
"line": 1,
"start": 0,
},
"source": "#= hello world",
},
],
"headerSource": "#= hello world",
"source": "",
}
`);
{
"directives": [
{
"args": [
"world",
],
"directive": "hello",
"loc": {
"line": 1,
"start": 0,
},
"source": "#= hello world",
},
],
"headerSource": "#= hello world",
"source": "",
}
`);
});

it('parses //=', () => {
expect(parse('//= hello world')).toMatchInlineSnapshot(`
Object {
"directives": Array [
Object {
"args": Array [
"world",
],
"directive": "hello",
"loc": Object {
"line": 1,
"start": 0,
},
"source": "//= hello world",
},
],
"headerSource": "//= hello world",
"source": "",
}
`);
{
"directives": [
{
"args": [
"world",
],
"directive": "hello",
"loc": {
"line": 1,
"start": 0,
},
"source": "//= hello world",
},
],
"headerSource": "//= hello world",
"source": "",
}
`);
});

it('parses multiple lines', () => {
expect(parse('#= hello world\n#= hello mars\n#\n\n#= hello venus\n\n'))
.toMatchInlineSnapshot(`
Object {
"directives": Array [
Object {
"args": Array [
"world",
],
"directive": "hello",
"loc": Object {
"line": 1,
"start": 0,
},
"source": "#= hello world",
},
Object {
"args": Array [
"mars",
],
"directive": "hello",
"loc": Object {
"line": 2,
"start": 0,
},
"source": "#= hello mars",
},
Object {
"args": Array [
"venus",
],
"directive": "hello",
"loc": Object {
"line": 5,
"start": 0,
},
"source": "#= hello venus",
},
],
"headerSource": "#= hello world
#= hello mars
#
{
"directives": [
{
"args": [
"world",
],
"directive": "hello",
"loc": {
"line": 1,
"start": 0,
},
"source": "#= hello world",
},
{
"args": [
"mars",
],
"directive": "hello",
"loc": {
"line": 2,
"start": 0,
},
"source": "#= hello mars",
},
{
"args": [
"venus",
],
"directive": "hello",
"loc": {
"line": 5,
"start": 0,
},
"source": "#= hello venus",
},
],
"headerSource": "#= hello world
#= hello mars
#
#= hello venus
#= hello venus
",
"source": "
",
"source": "
#
#
",
}
`);
",
}
`);
});
});
3 changes: 3 additions & 0 deletions packages/sporks/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('../../jest.config.base'),
};
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`getRuleComposer recursively resolves mixed strings and functions 1`] = `
Array [
Object {
[
{
"test": /i-show-up-twice/,
},
Object {
{
"test": /i-show-up-twice/,
},
Object {
{
"test": /look-no-further/,
},
]
`;

exports[`getRuleComposer ruleComposer recursively resolves rule names to literal rules 1`] = `
Array [
Object {
[
{
"test": /recursive-look-result/,
},
Object {
{
"test": /recursive-harder-result/,
},
Object {
{
"test": /look-no-further/,
},
]
`;

exports[`getRuleComposer ruleComposer resolves string rule names to literal rules 1`] = `
Array [
Object {
[
{
"test": /simple-string-result/,
},
]
`;

exports[`getRuleComposer supports functions recursively 1`] = `
Array [
Object {
[
{
"test": /recursive-function-result/,
},
]
`;

exports[`getRuleComposer supports functions that return literal rules 1`] = `
Array [
Object {
[
{
"test": /simple-function-result/,
},
]
Expand Down
3 changes: 3 additions & 0 deletions packages/webpack-rule-composer/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('../../jest.config.base'),
};
Loading

0 comments on commit 3221f71

Please sign in to comment.