Skip to content

Commit

Permalink
test: use jest with puppeteer preset
Browse files Browse the repository at this point in the history
  • Loading branch information
spotify-kai committed Sep 11, 2019
1 parent 0eee1c0 commit 945c1cd
Show file tree
Hide file tree
Showing 3 changed files with 341 additions and 17 deletions.
10 changes: 9 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
module.exports = require('@spotify/web-scripts/config/jest.config.js');
module.exports = {
roots: ['<rootDir>/src/__tests__'],
transform: {
'^.+\\.ts$': 'ts-jest',
},
testRegex: '^.+\\.ts$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
preset: 'jest-puppeteer',
};
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,24 @@
"build": "yarn build:library && yarn build:browser",
"build:library": "web-scripts build",
"build:browser": "parcel build --target browser --experimental-scope-hoisting --global isMobile --out-file isMobile.min.js src/index.browser.ts",
"test": "web-scripts test",
"test": "jest",
"lint": "web-scripts lint",
"commit": "web-scripts commit",
"release": "web-scripts release"
},
"husky": {
"hooks": {
"pre-commit": "web-scripts precommit",
"pre-commit": "web-scripts precommit --jest-config ./jest.config.js",
"commit-msg": "web-scripts commitmsg"
}
},
"devDependencies": {
"@spotify/web-scripts": "^1.2.0",
"@types/puppeteer": "^1.19.1",
"husky": "^3.0.3",
"parcel-bundler": "^1.12.3"
"jest-puppeteer": "^4.3.0",
"parcel-bundler": "^1.12.3",
"puppeteer": "^1.19.0",
"ts-jest": "^24.0.2"
}
}
Loading

0 comments on commit 945c1cd

Please sign in to comment.