Skip to content

Commit

Permalink
feat(deps): Update tooling, includes Jest v24 (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and michaeltaranto committed Feb 24, 2019
1 parent 2a196ca commit bef923b
Show file tree
Hide file tree
Showing 7 changed files with 618 additions and 446 deletions.
8 changes: 2 additions & 6 deletions config/jest/jestConfig.js
Expand Up @@ -4,11 +4,7 @@ const slash = '[/\\\\]'; // Cross-platform path delimiter regex
const compilePackagesRegex = paths.compilePackages.map(escapeRegex).join('|');

module.exports = {
...(paths.setupTests
? {
setupTestFrameworkScriptFile: paths.setupTests
}
: {}),
setupFilesAfterEnv: paths.setupTests,
prettierPath: require.resolve('prettier'),
testMatch: [
// Default values, but with 'ts' + 'tsx' support
Expand All @@ -19,7 +15,7 @@ module.exports = {
testPathIgnorePatterns: [
`<rootDir>${slash}(${paths.target}|node_modules)${slash}`
],
moduleFileExtensions: ['js', 'ts', 'tsx'],
moduleFileExtensions: ['js', 'json', 'ts', 'tsx'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|svg)$': require.resolve(
'./fileMock'
Expand Down
15 changes: 11 additions & 4 deletions context/configSchema.js
Expand Up @@ -83,10 +83,17 @@ module.exports = validator.compile({
target: {
type: 'string'
},
setupTests: {
type: 'string',
optional: true
},
setupTests: [
{
type: 'string',
optional: true
},
{
type: 'array',
items: 'string',
optional: true
}
],
initialPath: {
type: 'string',
optional: true
Expand Down
14 changes: 13 additions & 1 deletion context/index.js
Expand Up @@ -38,6 +38,18 @@ const transformOutputPath = isStartScript
? startTransformPath
: skuConfig.transformOutputPath;

const getSetupTests = setupTests => {
if (!setupTests) {
return [];
}

if (Array.isArray(setupTests)) {
return setupTests.map(setupTest => getPathFromCwd(setupTest));
}

return [getPathFromCwd(setupTests)];
};

// normalize sites to object syntax
const sites = skuConfig.sites.map(site =>
typeof site === 'string' ? { name: site } : site
Expand Down Expand Up @@ -68,7 +80,7 @@ const paths = {
target: getPathFromCwd(skuConfig.target),
relativeTarget: skuConfig.target,
publicPath: isStartScript ? '/' : publicPath,
setupTests: skuConfig.setupTests ? getPathFromCwd(skuConfig.setupTests) : null
setupTests: getSetupTests(skuConfig.setupTests)
};

module.exports = {
Expand Down
5 changes: 1 addition & 4 deletions jest.config.js
@@ -1,10 +1,7 @@
const path = require('path');

module.exports = {
setupTestFrameworkScriptFile: path.resolve(
__dirname,
'test/utils/jestSetup.js'
),
setupFilesAfterEnv: [path.resolve(__dirname, 'test/utils/jestSetup.js')],
testURL: 'http://localhost',
testMatch: ['**/*.test.js'],
testPathIgnorePatterns: ['test/.*/src'],
Expand Down
11 changes: 5 additions & 6 deletions package.json
Expand Up @@ -85,14 +85,13 @@
"@loadable/webpack-plugin": "^5.5.0",
"@storybook/addon-knobs": "^4.1.11",
"@storybook/react": "^4.1.11",
"@types/jest": "^23.3.13",
"@types/jest": "^24.0.0",
"@types/loadable__component": "^5.2.0",
"@types/storybook__addon-knobs": "^4.0.0",
"@types/storybook__react": "^4.0.0",
"@types/webpack": "^4.4.22",
"autoprefixer": "^9.4.5",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"babel-jest": "^24.0.0",
"babel-loader": "^8.0.4",
"babel-plugin-flow-react-proptypes": "^24.1.2",
"babel-plugin-macros": "^2.4.2",
Expand Down Expand Up @@ -130,7 +129,7 @@
"html-render-webpack-plugin": "^1.1.1",
"identity-obj-proxy": "^3.0.0",
"inquirer": "^6.0.0",
"jest": "^23.4.2",
"jest": "^24.0.0",
"jest-watch-typeahead": "^0.2.0",
"kopy": "^8.3.0",
"less": "^3.8.1",
Expand Down Expand Up @@ -178,7 +177,7 @@
"cz-conventional-changelog": "^2.1.0",
"git-diff": "^2.0.6",
"husky": "^1.1.3",
"jest-puppeteer": "^3.5.2",
"jest-puppeteer": "^4.0.0",
"jest-serializer-html": "^6.0.0",
"jsonc-parser": "^2.0.2",
"lint-staged": "^8.0.4",
Expand All @@ -202,4 +201,4 @@
"node": "10.15.1",
"yarn": "1.13.0"
}
}
}
8 changes: 4 additions & 4 deletions renovate.json
Expand Up @@ -7,25 +7,25 @@
},
"packageRules": [
{
"groupName": "Style guide maintenance",
"groupName": "style guide packages",
"packagePatterns": ["^(braid-design-system|(seek(-asia)?-style-guide))$"],
"enabled": true,
"schedule": ["before 8am on the first day of the month"]
},
{
"groupName": "Webpack maintenance",
"groupName": "webpack packages",
"packagePatterns": ["webpack|(-loader$)|autoprefixer|less|css|svg"],
"enabled": true,
"schedule": ["before 11am on Thursday"]
},
{
"groupName": "Babel maintenance",
"groupName": "babel packages",
"packagePatterns": ["^@?babel[/-]"],
"enabled": true,
"schedule": ["before 11am on Thursday"]
},
{
"groupName": "Tooling maintenance",
"groupName": "test and lint packages",
"packagePatterns": ["jest|puppeteer|tslint|eslint"],
"enabled": true,
"schedule": ["before 11am on Thursday"]
Expand Down

0 comments on commit bef923b

Please sign in to comment.