diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..5bbbeb3 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,13 @@ +module.exports = { + presets: [ + '@babel/preset-typescript', + [ + '@babel/preset-env', + { + targets: { + node: 'current', + }, + }, + ], + ], +}; diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..9c6414d --- /dev/null +++ b/jest.config.js @@ -0,0 +1,5 @@ +module.exports = { + clearMocks: true, + coverageDirectory: "coverage", + testEnvironment: "node", +}; diff --git a/package.json b/package.json index 0673946..4da5931 100644 --- a/package.json +++ b/package.json @@ -9,15 +9,22 @@ "@actions/core": "^1.2.3", "@actions/exec": "^1.0.3", "@actions/github": "^2.1.1", + "@types/jest": "^26.0.0", "got": "^11.3.0", "lodash.get": "^4.4.2" }, "devDependencies": { + "@babel/core": "^7.10.2", + "@babel/preset-env": "^7.10.2", + "@babel/preset-typescript": "^7.10.1", "@zeit/ncc": "^0.22.0", + "babel-jest": "^26.0.1", + "jest": "^26.0.1", "prettier": "^2.0.2" }, "scripts": { - "build": "ncc build main.ts --out dist/main", - "watch": "ncc build main.ts --out dist/main --watch" + "build": "ncc build src/main.ts --out dist/main", + "watch": "ncc build src/main.ts --out dist/main --watch", + "test": "jest" } }