Skip to content

Commit

Permalink
feat(3068): remove shared from pipeline template functional test (#3107)
Browse files Browse the repository at this point in the history
  • Loading branch information
VonnyJap committed May 2, 2024
1 parent 15209be commit 1f6edec
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
3 changes: 1 addition & 2 deletions features/pipeline-templates.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 15 additions & 9 deletions features/step_definitions/pipeline-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
}
);

Expand Down
2 changes: 1 addition & 1 deletion test/plugins/auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1f6edec

Please sign in to comment.