Skip to content

Commit

Permalink
Move to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyBitz committed Oct 15, 2024
1 parent 80a889b commit ffe212b
Show file tree
Hide file tree
Showing 5 changed files with 1,825 additions and 2,653 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
- run: yarn install --network-timeout 1000000 --frozen-lockfile
- run: yarn run build-views
- run: yarn test
- run: yarn run coverage

- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
directory: ./coverage
14 changes: 14 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
testEnvironment: 'node',
testMatch: ['**/__tests__/**/*.js', '**/?(*.)+(spec|test).js'],
collectCoverage: true,
coverageReporters: ['text', 'lcov'],
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: [
'/node_modules/',
'/test/',
'/coverage/',
'/src/directory.js',
'/src/error.js'
]
};
17 changes: 6 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test": "yarn run test-lint && yarn run test-integration",
"test-lint": "zeit-eslint --ext .jsx,.js .",
"test-integration": "nyc --reporter=html --reporter=text ava test/integration.js",
"test-integration": "jest test/integration.test.js",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov",
"lint-staged": "git diff --diff-filter=ACMRT --cached --name-only '*.js' '*.jsx' | xargs zeit-eslint",
"build-views": "dottojs -s ./src -d ./src",
Expand All @@ -29,29 +29,24 @@
"devDependencies": {
"@zeit/eslint-config-node": "0.2.13",
"@zeit/git-hooks": "0.1.4",
"ava": "2.2.0",
"commander": "2.15.1",
"dot": "1.1.3",
"eslint": "6.1.0",
"fs-extra": "6.0.1",
"jest": "29.7.0",
"micro": "9.3.2",
"node-fetch": "2.6.1",
"nyc": "14.1.1",
"request": "2.87.0",
"sleep-promise": "6.0.0",
"test-listen": "1.1.0"
},
"eslintConfig": {
"extends": [
"@zeit/eslint-config-node"
]
},
"nyc": {
"exclude": [
"src/directory.js",
"src/error.js",
"test/*"
]
],
"env": {
"jest": true
}
},
"eslintIgnore": [
"error.js",
Expand Down
Loading

0 comments on commit ffe212b

Please sign in to comment.