chore: add jest

This commit is contained in:
Adrian Smijulj 2020-06-11 12:53:03 +02:00
parent a51e58c36f
commit ea000a8484
3 changed files with 27 additions and 2 deletions

13
babel.config.js Normal file
View file

@ -0,0 +1,13 @@
module.exports = {
presets: [
'@babel/preset-typescript',
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
};

5
jest.config.js Normal file
View file

@ -0,0 +1,5 @@
module.exports = {
clearMocks: true,
coverageDirectory: "coverage",
testEnvironment: "node",
};

View file

@ -9,15 +9,22 @@
"@actions/core": "^1.2.3", "@actions/core": "^1.2.3",
"@actions/exec": "^1.0.3", "@actions/exec": "^1.0.3",
"@actions/github": "^2.1.1", "@actions/github": "^2.1.1",
"@types/jest": "^26.0.0",
"got": "^11.3.0", "got": "^11.3.0",
"lodash.get": "^4.4.2" "lodash.get": "^4.4.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.10.2",
"@babel/preset-env": "^7.10.2",
"@babel/preset-typescript": "^7.10.1",
"@zeit/ncc": "^0.22.0", "@zeit/ncc": "^0.22.0",
"babel-jest": "^26.0.1",
"jest": "^26.0.1",
"prettier": "^2.0.2" "prettier": "^2.0.2"
}, },
"scripts": { "scripts": {
"build": "ncc build main.ts --out dist/main", "build": "ncc build src/main.ts --out dist/main",
"watch": "ncc build main.ts --out dist/main --watch" "watch": "ncc build src/main.ts --out dist/main --watch",
"test": "jest"
} }
} }