diff --git a/lib/plugins/plugin-validator.spec.js b/lib/plugins/plugin-validator.spec.js index 3fcc820249..a0a776f825 100644 --- a/lib/plugins/plugin-validator.spec.js +++ b/lib/plugins/plugin-validator.spec.js @@ -47,12 +47,10 @@ describe('plugin-validator', () => { testScope.fileSystem.writeFile(['govuk-prototype-kit.config.json'], JSON.stringify({ myExample: ['abc'] })) - await validatePlugin(testScope.mockFileSystemRoot).finally( - () => { - expect(testScope.errLogs).toEqual([ansiColors.red('Error: The following invalid keys exist in your config: myExample')]) - expect(testScope.stdLogs).toEqual(phaseOneSuccessMessages) - } - ) + await validatePlugin(testScope.mockFileSystemRoot) + expect(testScope.errLogs).toEqual([ansiColors.red('Error: The following invalid keys exist in your config: myExample')]) + expect(testScope.stdLogs).toEqual(phaseOneSuccessMessages) + process.exitCode = 0 }) it('should allow a single unknown key when specified', async () => { testScope.fileSystem.writeFile(['govuk-prototype-kit.config.json'], JSON.stringify({ @@ -62,11 +60,9 @@ describe('plugin-validator', () => { options: { keysToIgnoreIfUnknown: 'myExample' } - }).finally( - () => { - expect(testScope.errLogs).toEqual([]) - expect(testScope.stdLogs).toEqual(validSuccessMessages) - }) + }) + expect(testScope.errLogs).toEqual([]) + expect(testScope.stdLogs).toEqual(validSuccessMessages) }) it('should allow multiple unknown keys when specified', async () => { testScope.fileSystem.writeFile(['govuk-prototype-kit.config.json'], JSON.stringify({ @@ -78,11 +74,9 @@ describe('plugin-validator', () => { options: { keysToIgnoreIfUnknown: 'myExample,anotherExample,third' } - }).finally( - () => { - expect(testScope.errLogs).toEqual([]) - expect(testScope.stdLogs).toEqual(validSuccessMessages) - }) + }) + expect(testScope.errLogs).toEqual([]) + expect(testScope.stdLogs).toEqual(validSuccessMessages) }) })