Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ceelsoin committed Feb 26, 2024
1 parent 9924132 commit e768c47
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions test/fakes/FakeStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ class FakeStorage extends Storage {
return {
hash: 'my-hash-123',
code: 'function main() {}',
env: {
MY_VAR: 'MY_VALUE',
CLIENT_SECRET: 'FOOBAR',
},
};
}

Expand Down
3 changes: 3 additions & 0 deletions test/unit/domain/Pipeline.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ describe('Pipeline', () => {
beforeEach(() => {
req = {
body: {},
headers: {
'x-request-id': 'foobar',
},
};
sandbox = new Sandbox({});
step200 = {
Expand Down
6 changes: 3 additions & 3 deletions test/unit/http/routers/FunctionsRouter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,15 @@ describe('PUT /functions/:namespace/:id/env/:env', () => {
});
});

describe('when get called, not return secret variable', () => {
it('should create an enviroment variable', (done) => {
describe('when get called', () => {
it('should not return a secret variable', (done) => {
request(routes)
.get('/functions/backstage/correct')
.set('content-type', 'application/json')
.send()
.expect((res) => {
expect(res.body.env).to.be.eql({
MY_VAR: 'MY VALUE',
MY_VAR: 'MY_VALUE',
});
})
.expect(200, done);
Expand Down

0 comments on commit e768c47

Please sign in to comment.