Skip to content

Commit

Permalink
fix: test failures under jest@29 (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
shazron authored Apr 4, 2023
1 parent c391017 commit a02b776
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"eslint-plugin-n": "^15.2.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.0.0",
"jest": "^28",
"jest": "^29.5.0",
"jest-plugin-fs": "^2.9.0",
"nock": "^13.2.9",
"oclif": "^3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion test/commands/app/build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ beforeEach(() => {
mockFS.existsSync.mockReset()
helpers.writeConfig.mockReset()
helpers.runScript.mockReset()
jest.restoreAllMocks()
jest.clearAllMocks()

helpers.wrapError.mockImplementation(msg => msg)
})
Expand Down
2 changes: 1 addition & 1 deletion test/commands/app/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const BaseCommand = require('../../../src/BaseCommand')
const InitCommand = require('../../../src/commands/app/init')

beforeEach(() => {
jest.restoreAllMocks()
jest.clearAllMocks()
})

describe('Command Prototype', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/commands/app/deploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const mockLogForwarding = {
}

afterAll(() => {
jest.restoreAllMocks()
jest.clearAllMocks()
jest.resetAllMocks()
})

Expand All @@ -158,7 +158,7 @@ beforeEach(() => {
mockLogForwarding.getLocalConfigWithSecrets.mockReset()
mockLogForwarding.updateServerConfig.mockReset()

jest.restoreAllMocks()
jest.clearAllMocks()

helpers.wrapError.mockImplementation(msg => msg)
helpers.createWebExportFilter.mockImplementation(filterValue => helpersActual.createWebExportFilter(filterValue))
Expand Down
2 changes: 1 addition & 1 deletion test/commands/app/geturl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const createFullConfig = (aioConfig = {}, appFixtureName = 'legacy-app') => {
}

beforeEach(() => {
jest.restoreAllMocks()
jest.clearAllMocks()
})

test('exports', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/app/list/extension.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const createAppConfig = (aioConfig = {}, appFixtureName = 'legacy-app') => {
}

beforeEach(() => {
jest.restoreAllMocks()
jest.clearAllMocks()
})

test('exports', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/app/run.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const createAppConfig = (aioConfig = {}, appFixtureName = 'legacy-app') => {
}

beforeEach(() => {
jest.restoreAllMocks()
jest.clearAllMocks()
mockRunDev.mockReset()
helpers.runScript.mockReset()

Expand Down
2 changes: 1 addition & 1 deletion test/commands/app/test.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ beforeAll(() => {
})

afterAll(() => {
jest.restoreAllMocks()
jest.clearAllMocks()
})

/** @private */
Expand Down
2 changes: 1 addition & 1 deletion test/commands/app/undeploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ beforeEach(() => {
helpers.runScript.mockReset()
mockFS.existsSync.mockReset()
helpers.wrapError.mockImplementation(msg => msg)
jest.restoreAllMocks()
jest.clearAllMocks()
})

test('exports', async () => {
Expand Down

0 comments on commit a02b776

Please sign in to comment.