diff --git a/features/pipeline-templates.feature b/features/pipeline-templates.feature index 337224df9..9ce1fa554 100644 --- a/features/pipeline-templates.feature +++ b/features/pipeline-templates.feature @@ -21,10 +21,9 @@ Feature: Pipeline Templates template: node/test@1 The user's config would be translated to: - shared: - image: node:18 jobs: main: + image: node:18 steps: - init: npm install - test: npm test diff --git a/features/step_definitions/pipeline-template.js b/features/step_definitions/pipeline-template.js index db2678240..c612f92a0 100644 --- a/features/step_definitions/pipeline-template.js +++ b/features/step_definitions/pipeline-template.js @@ -283,16 +283,22 @@ Then( context: { token: this.jwt } - }).then(response => { - Assert.equal(response.statusCode, 200); - const { length } = response.body; + }) + .then(response => { + Assert.equal(response.statusCode, 200); + const { length } = response.body; - if (stored === 'is') { - Assert.equal(length, this.numOfTemplate + 1); - } else { - Assert.equal(length, this.numOfTemplate); - } - }); + if (stored === 'is') { + Assert.equal(length, this.numOfTemplate + 1); + } else { + Assert.equal(length, this.numOfTemplate); + } + }) + .catch(error => { + const errorMessage = error.message; // Get the error message + + Assert.include(errorMessage, 'Template does not exist'); + }); } ); diff --git a/test/plugins/auth.test.js b/test/plugins/auth.test.js index 6e00ae5f3..42adce87b 100644 --- a/test/plugins/auth.test.js +++ b/test/plugins/auth.test.js @@ -794,7 +794,7 @@ describe('auth plugin test', () => { describe('gheCloud flag', async () => { beforeEach(async () => { - const scmsTemp = Object.assign({}, scm.scms['github:github.com']); + const scmsTemp = { ...scm.scms['github:github.com'] }; await server.register({ plugin,