diff --git a/__tests__/index.test.js b/__tests__/index.test.js index 6a9e2f5..58fa8b7 100644 --- a/__tests__/index.test.js +++ b/__tests__/index.test.js @@ -159,7 +159,7 @@ describe('Azure DevOps Commit Validator', () => { await run(); expect(mockSetFailed).toHaveBeenCalledWith( - "At least one of 'check-commits' or 'check-pull-request' must be set to true. Both are currently set to false." + `At least one of 'check-commits' or 'check-pull-request' must be set to true. Both are currently set to false.` ); }); @@ -775,7 +775,7 @@ describe('Azure DevOps Commit Validator', () => { await run(); expect(mockWarning).toHaveBeenCalledWith( - expect.stringContaining("Invalid value 'invalid-value' for 'pull-request-check-scope'") + expect.stringContaining(`Invalid value 'invalid-value' for 'pull-request-check-scope'`) ); // Should still pass because it falls back to title-or-body and title has AB# expect(mockSetFailed).not.toHaveBeenCalled(); diff --git a/package.json b/package.json index c4f4ca5..7adcc72 100644 --- a/package.json +++ b/package.json @@ -9,17 +9,18 @@ }, "main": "dist/index.js", "scripts": { - "format": "npx prettier --write .", + "bundle": "npm run format:write && npm run package", + "ci-test": "npm run test:bash && NODE_OPTIONS='--experimental-vm-modules' npx jest --coverage", + "coverage": "npx @joshjohanning/make-coverage-badge-better --label-color '#333' --output-path ./badges/coverage.svg", + "format:write": "npx prettier --write .", "format:check": "npx prettier --check .", - "lint": "npx eslint src/**/*.js", - "test": "npm run test:bash && npm run test:js", + "lint": "npx eslint .", + "package": "npx @vercel/ncc build src/index.js -o dist --source-map --license licenses.txt", + "package:watch": "npm run package -- --watch", + "test": "npm run test:bash && NODE_OPTIONS='--experimental-vm-modules' npx jest", "test:bash": "./__tests__/action.test.sh", - "test:js": "NODE_OPTIONS=--experimental-vm-modules npx jest", - "test:watch": "NODE_OPTIONS=--experimental-vm-modules npx jest --watch", - "test:coverage": "NODE_OPTIONS=--experimental-vm-modules npx jest --coverage", - "coverage": "npx @joshjohanning/make-coverage-badge-better --label-color '#333' --output-path ./badges/coverage.svg", - "package": "npx @vercel/ncc build --source-map --license licenses.txt src/index.js -o dist", - "all": "npm run format && npm run lint && npm run test:coverage && npm run coverage && npm run package" + "test:watch": "NODE_OPTIONS='--experimental-vm-modules' npx jest --watch", + "all": "npm run format:write && npm run lint && npm run ci-test && npm run coverage && npm run package" }, "repository": { "type": "git",