Skip to content

Commit

Permalink
test(AWS Websocket): Prepare tests refactor plan
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Dec 10, 2021
1 parent e7c58f3 commit 654c507
Showing 1 changed file with 73 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const sinon = require('sinon');
const AwsProvider = require('../../../../../../../../../lib/plugins/aws/provider');
const AwsCompileWebsocketsEvents = require('../../../../../../../../../lib/plugins/aws/package/compile/events/websockets/index');
const Serverless = require('../../../../../../../../../lib/Serverless');
const runServerless = require('../../../../../../../../utils/run-serverless');

describe('AwsCompileWebsocketsEvents', () => {
let awsCompileWebsocketsEvents;
Expand Down Expand Up @@ -111,3 +112,75 @@ describe('AwsCompileWebsocketsEvents', () => {
});
});
});

describe('test/unit/lib/plugins/aws/package/compile/events/websockets/index.test.js', () => {
describe.skip('TODO: regular configuration', () => {
before(async () => {
await runServerless({
fixture: 'function',
command: 'package',

configExt: {
functions: {
basic: {
events: [
{
websocket: '$connect',
},
],
},
},
},
});
});

it('should create a websocket api resource', () => {
// Replaces
// https://github.com/serverless/serverless/blob/f64f7c68abb1d6837ecaa6173f4b605cf3975acf/test/unit/lib/plugins/aws/package/compile/events/websockets/lib/api.test.js#L37-L52
});

it('should configure expected IAM', () => {
// Replaces
// https://github.com/serverless/serverless/blob/f64f7c68abb1d6837ecaa6173f4b605cf3975acf/test/unit/lib/plugins/aws/package/compile/events/websockets/lib/api.test.js#L66-L91
});
});

describe.skip('TODO: external websocket API', () => {
before(async () => {
await runServerless({
fixture: 'function',
command: 'package',

configExt: {
provider: {
apiGateway: {
websocketApiId: '5ezys3sght',
},
iam: {
role: 'arn:aws:iam::123456789012:role/fromProvider',
},
},
functions: {
basic: {
events: [
{
websocket: '$connect',
},
],
},
},
},
});
});

it('should not create a websocket api resource', () => {
// Replaces
// https://github.com/serverless/serverless/blob/f64f7c68abb1d6837ecaa6173f4b605cf3975acf/test/unit/lib/plugins/aws/package/compile/events/websockets/lib/api.test.js#L54-L64
});

it('should not configure IAM policies with custom roles', () => {
// Replaces
// https://github.com/serverless/serverless/blob/f64f7c68abb1d6837ecaa6173f4b605cf3975acf/test/unit/lib/plugins/aws/package/compile/events/websockets/lib/api.test.js#L93-L103
});
});
});

0 comments on commit 654c507

Please sign in to comment.