enable unit tests in CI (#15)
Signed-off-by: Brian DeHamer <bdehamer@github.com>
This commit is contained in:
@@ -41,17 +41,17 @@ jobs:
|
||||
- name: Lint
|
||||
id: npm-lint
|
||||
run: npm run lint
|
||||
# - name: Test
|
||||
# id: npm-ci-test
|
||||
# run: npm run ci-test
|
||||
|
||||
- name: Test
|
||||
id: npm-ci-test
|
||||
run: npm run ci-test
|
||||
|
||||
test-attest:
|
||||
name: Test attest action
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
id-token: write
|
||||
packages: write
|
||||
env:
|
||||
SUBJECT: /repos/${{ github.repository }}/tarball/${{ github.sha }}
|
||||
steps:
|
||||
|
||||
@@ -21,6 +21,9 @@ const getBooleanInputMock = jest.spyOn(core, 'getBooleanInput')
|
||||
const setOutputMock = jest.spyOn(core, 'setOutput')
|
||||
const setFailedMock = jest.spyOn(core, 'setFailed')
|
||||
|
||||
// Ensure that setFailed doesn't set an exit code during tests
|
||||
setFailedMock.mockImplementation(() => {})
|
||||
|
||||
const summaryWriteMock = jest.spyOn(core.summary, 'write')
|
||||
summaryWriteMock.mockImplementation(async () => Promise.resolve(core.summary))
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
process.stdout.write = jest.fn()
|
||||
@@ -39,6 +39,9 @@
|
||||
"license": "MIT",
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"setupFilesAfterEnv": [
|
||||
"./jest.setup.js"
|
||||
],
|
||||
"verbose": true,
|
||||
"clearMocks": true,
|
||||
"testEnvironment": "node",
|
||||
|
||||
Reference in New Issue
Block a user