Skip to content

Commit

Permalink
Tests: add init method
Browse files Browse the repository at this point in the history
  • Loading branch information
austencollins committed Jan 22, 2016
1 parent 145a7a8 commit 7a78a2c
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 40 deletions.
14 changes: 7 additions & 7 deletions tests/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ describe('All Tests', function() {
});

after(function() {});
//require('./tests/classes/ServerlessEndpointTest');
//require('./tests/classes/ServerlessFunctionTest');
//require('./tests/classes/ServerlessModuleTest');
//require('./tests/classes/ServerlessComponentTest');
//require('./tests/classes/ServerlessProjectTest');
//require('./tests/classes/ServerlessStateTest');
require('./tests/classes/ServerlessEndpointTest');
require('./tests/classes/ServerlessFunctionTest');
require('./tests/classes/ServerlessModuleTest');
require('./tests/classes/ServerlessComponentTest');
require('./tests/classes/ServerlessProjectTest');
require('./tests/classes/ServerlessStateTest');
//require('./tests/actions/TestPluginCustom');
//require('./tests/actions/TestDefaultActionHook');
//require('./tests/actions/StageCreate');
Expand All @@ -26,7 +26,7 @@ describe('All Tests', function() {
//require('./tests/actions/EnvList');
//require('./tests/actions/EnvGet');
//require('./tests/actions/EnvSetUnset');
require('./tests/actions/ResourcesDeploy');
//require('./tests/actions/ResourcesDeploy');
//require('./tests/actions/FunctionRun');
//require('./tests/actions/FunctionDeploy');
//require('./tests/actions/EndpointDeploy');
Expand Down
14 changes: 9 additions & 5 deletions tests/tests/classes/ServerlessComponentTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ describe('Test Serverless Component Class', function() {
projectPath: projPath
});

// Instantiate Class
instance = new serverless.classes.Component(serverless, {
component: 'nodejscomponent'
});
return serverless.init()
.then(function() {

// Instantiate Class
instance = new serverless.classes.Component(serverless, {
component: 'nodejscomponent'
});

done();
done();
});
});
});

Expand Down
22 changes: 13 additions & 9 deletions tests/tests/classes/ServerlessEndpointTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,20 @@ describe('Test Serverless Endpoint Class', function() {
projectPath: projPath
});

// Instantiate Class
instance = new serverless.classes.Endpoint(serverless, {
component: 'nodejscomponent',
module: 'module1',
function: 'function1',
endpointPath: 'module1/function1',
endpointMethod: 'GET'
});
return serverless.init()
.then(function() {

// Instantiate Class
instance = new serverless.classes.Endpoint(serverless, {
component: 'nodejscomponent',
module: 'module1',
function: 'function1',
endpointPath: 'module1/function1',
endpointMethod: 'GET'
});

done();
done();
});
});
});

Expand Down
18 changes: 11 additions & 7 deletions tests/tests/classes/ServerlessFunctionTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ describe('Test Serverless Function Class', function() {
projectPath: projPath
});

// Instantiate Class
instance = new serverless.classes.Function(serverless, {
component: 'nodejscomponent',
module: 'module1',
function: 'function1'
});
return serverless.init()
.then(function() {

// Instantiate Class
instance = new serverless.classes.Function(serverless, {
component: 'nodejscomponent',
module: 'module1',
function: 'function1'
});

done();
done();
});
});
});

Expand Down
16 changes: 10 additions & 6 deletions tests/tests/classes/ServerlessModuleTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ describe('Test Serverless Module Class', function() {
projectPath: projPath
});

// Instantiate Class
instance = new serverless.classes.Module(serverless, {
component: 'nodejscomponent',
module: 'module1'
});
return serverless.init()
.then(function() {

// Instantiate Class
instance = new serverless.classes.Module(serverless, {
component: 'nodejscomponent',
module: 'module1'
});

done();
done();
});
});
});

Expand Down
10 changes: 7 additions & 3 deletions tests/tests/classes/ServerlessProjectTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ describe('Test Serverless Project Class', function() {
projectPath: projPath
});

// Instantiate Class
instance = new serverless.classes.Project(serverless);
return serverless.init()
.then(function() {

done();
// Instantiate Class
instance = new serverless.classes.Project(serverless);

done();
});
});
});

Expand Down
10 changes: 7 additions & 3 deletions tests/tests/classes/ServerlessStateTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ describe('Test Serverless State Class', function() {
projectPath: projPath
});

// Instantiate Class
instance = new serverless.classes.State(serverless);
return serverless.init()
.then(function() {

done();
// Instantiate Class
instance = new serverless.classes.State(serverless);

done();
});
});
});

Expand Down

0 comments on commit 7a78a2c

Please sign in to comment.