Skip to content

Commit 40500cb

Browse files
chore: sync package scripts and fix lint errors in tests (#164)
* chore: update package.json scripts for consistency * chore(tests): update linting error
1 parent 3398d3c commit 40500cb

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

__tests__/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe('Azure DevOps Commit Validator', () => {
159159
await run();
160160

161161
expect(mockSetFailed).toHaveBeenCalledWith(
162-
"At least one of 'check-commits' or 'check-pull-request' must be set to true. Both are currently set to false."
162+
`At least one of 'check-commits' or 'check-pull-request' must be set to true. Both are currently set to false.`
163163
);
164164
});
165165

@@ -775,7 +775,7 @@ describe('Azure DevOps Commit Validator', () => {
775775
await run();
776776

777777
expect(mockWarning).toHaveBeenCalledWith(
778-
expect.stringContaining("Invalid value 'invalid-value' for 'pull-request-check-scope'")
778+
expect.stringContaining(`Invalid value 'invalid-value' for 'pull-request-check-scope'`)
779779
);
780780
// Should still pass because it falls back to title-or-body and title has AB#
781781
expect(mockSetFailed).not.toHaveBeenCalled();

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@
99
},
1010
"main": "dist/index.js",
1111
"scripts": {
12-
"format": "npx prettier --write .",
12+
"bundle": "npm run format:write && npm run package",
13+
"ci-test": "npm run test:bash && NODE_OPTIONS='--experimental-vm-modules' npx jest --coverage",
14+
"coverage": "npx @joshjohanning/make-coverage-badge-better --label-color '#333' --output-path ./badges/coverage.svg",
15+
"format:write": "npx prettier --write .",
1316
"format:check": "npx prettier --check .",
14-
"lint": "npx eslint src/**/*.js",
15-
"test": "npm run test:bash && npm run test:js",
17+
"lint": "npx eslint .",
18+
"package": "npx @vercel/ncc build src/index.js -o dist --source-map --license licenses.txt",
19+
"package:watch": "npm run package -- --watch",
20+
"test": "npm run test:bash && NODE_OPTIONS='--experimental-vm-modules' npx jest",
1621
"test:bash": "./__tests__/action.test.sh",
17-
"test:js": "NODE_OPTIONS=--experimental-vm-modules npx jest",
18-
"test:watch": "NODE_OPTIONS=--experimental-vm-modules npx jest --watch",
19-
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules npx jest --coverage",
20-
"coverage": "npx @joshjohanning/make-coverage-badge-better --label-color '#333' --output-path ./badges/coverage.svg",
21-
"package": "npx @vercel/ncc build --source-map --license licenses.txt src/index.js -o dist",
22-
"all": "npm run format && npm run lint && npm run test:coverage && npm run coverage && npm run package"
22+
"test:watch": "NODE_OPTIONS='--experimental-vm-modules' npx jest --watch",
23+
"all": "npm run format:write && npm run lint && npm run ci-test && npm run coverage && npm run package"
2324
},
2425
"repository": {
2526
"type": "git",

0 commit comments

Comments
 (0)