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