Skip to content

Commit

Permalink
test: Refactor to async functions (#11834)
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepwithcoffee committed Mar 20, 2023
1 parent f57705e commit 3bf6ff3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/unit/lib/config-schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('test/unit/lib/configSchema.test.js', () => {

for (const someCase of cases) {
const passOrFail = someCase.isValid ? 'pass' : 'fail';
it(`should ${passOrFail} validation for ${someCase.description}`, () =>
it(`should ${passOrFail} validation for ${someCase.description}`, async () =>
runServerless({
fixture: 'config-schema-extensions',
configExt: someCase.mutation,
Expand Down
8 changes: 4 additions & 4 deletions test/unit/lib/serverless.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,17 @@ describe('Serverless', () => {
});

describe('#init()', () => {
it('should set an instanceId', () =>
it('should set an instanceId', async () =>
serverless.init().then(() => {
expect(serverless.instanceId).to.match(/\d/);
}));

it('should create a new CLI instance', () =>
it('should create a new CLI instance', async () =>
serverless.init().then(() => {
expect(serverless.cli).to.be.instanceof(CLI);
}));

it('should allow a custom CLI instance', () => {
it('should allow a custom CLI instance', async () => {
class CustomCLI extends CLI {}
serverless.classes.CLI = CustomCLI;

Expand All @@ -119,7 +119,7 @@ describe('Serverless', () => {

// note: we just test that the processedInput variable is set (not the content of it)
// the test for the correct input is done in the CLI class test file
it('should receive the processed input form the CLI instance', () =>
it('should receive the processed input form the CLI instance', async () =>
serverless.init().then(() => {
expect(serverless.processedInput).to.not.deep.equal({});
}));
Expand Down

0 comments on commit 3bf6ff3

Please sign in to comment.