Skip to content

Commit 1b17eef

Browse files
committed
update markdown
1 parent 903aff4 commit 1b17eef

File tree

4 files changed

+58
-53
lines changed

4 files changed

+58
-53
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![NPM](https://nodei.co/npm/serverless-step-functions-offline.png)](https://nodei.co/npm/serverless-step-functions-offline/)
77

88
# serverless-step-functions-offline
9-
9+
:warning: Version 2.0 with breaking changes see [usage](#usage) :warning:
1010
## Documentation
1111

1212
- [Install](#install)
@@ -66,11 +66,18 @@ plugins:
6666

6767
custom:
6868
stepFunctionsOffline:
69-
FirstLambda: firstLambda/index.handler
69+
StepOne: firstLambda
7070
# ...
7171
# ...
72-
SecondLambda: myDir/index.main
73-
72+
stepTwo: secondLambda
73+
74+
functions:
75+
firstLambda:
76+
handler: firstLambda/index.handler
77+
name: TheFirstLambda
78+
secondLambda:
79+
handler: secondLambda/index.handler
80+
name: TheSecondLambda
7481
stepFunctions:
7582
stateMachines:
7683
foo:
@@ -89,8 +96,8 @@ stepFunctions:
8996
```
9097
9198
Where:
92-
- `FirstLambda` is the name of step in state machine
93-
- `firstLambda/index.handler` is the path to Lambda
99+
- `StepOne` is the name of step in state machine
100+
- `firstLambda` is the name of function in section **functions**
94101

95102
# Run Plugin
96103
```bash
@@ -121,9 +128,8 @@ By default `process.env.STEP_IS_OFFLINE = true`.
121128
- [x] Support context object
122129
- [x] Improve performance
123130
- [x] Fixing bugs
124-
- [x] Add unit tests - to make plugin stable (next step)
125131
- [x] Support Pass, Fail, Succeed
126-
- [ ] Support fields *Retry*, *Catch*
132+
- [ ] Add unit tests - to make plugin stable (next step) - [ ] Support fields *Retry*, *Catch*
127133
- [ ] Support other languages except node.js
128134

129135

index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ class StepFunctionsOfflinePlugin {
122122

123123
findState() {
124124
this.cliLog(`Trying to find state "${this.stateMachine}" in serverless.yml`);
125-
126125
return this.yamlParse()
127126
.then(() => {
128127
this.stateDefinition = this.getStateMachine(this.stateMachine).definition;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"url": "git@github.com:vkkis93/serverless-step-functions-offline.git"
1414
},
1515
"scripts": {
16-
"test": "nyc ./node_modules/mocha/bin/mocha ./tests/index.test.js ./tests/enum.test.js ./tests/build.test.js",
16+
"test": "nyc ./node_modules/mocha/bin/mocha ./tests/index.test.js './tests/!(index).test.js'",
1717
"lint": "eslint ./** --ext .js"
1818
},
1919
"dependencies": {

tests/build.test.js

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
'use strict';
2-
const expect = require('chai').expect;
3-
const should = require('chai').should;
4-
const sinon = require('sinon');
5-
const Serverless = require('serverless/lib/Serverless');
6-
const CLI = require('serverless/lib/classes/CLI');
7-
8-
9-
describe('build.js', () => {
10-
describe('#findFunctionsPathAndHandler()', () => {
11-
12-
13-
it('should throw err - can not read property', (done) => {
14-
stepFunctionsOfflinePlugin.variables = {FirstLambda: 'firstLamda'};
15-
stepFunctionsOfflinePlugin.hooks[hooks.buildStepWorkFlow]()
16-
.then((res) => {
17-
expect(res).to.be.an('undefined')
18-
})
19-
.catch((err) => {
20-
expect(err).to.throw(/Cannot read property/);
21-
}).finally(done);
22-
});
23-
24-
it('should throw err - goody', (done) => {
25-
stepFunctionsOfflinePlugin.variables = {FirstLambda: 'firstLambda'};
26-
stepFunctionsOfflinePlugin.hooks[hooks.buildStepWorkFlow]()
27-
.then((res) => {
28-
console.log(111)
29-
})
30-
.catch((err) => {
31-
console.log(222)
32-
33-
}).finally(done);
34-
});
35-
36-
});
37-
38-
// describe('#buildStepWorkFlow()', () => {
39-
//
40-
//
41-
//
42-
// });
43-
});
1+
// 'use strict';
2+
// const expect = require('chai').expect;
3+
// const should = require('chai').should;
4+
// const sinon = require('sinon');
5+
// const Serverless = require('serverless/lib/Serverless');
6+
// const CLI = require('serverless/lib/classes/CLI');
7+
//
8+
//
9+
// describe('build.js', () => {
10+
// describe('#findFunctionsPathAndHandler()', () => {
11+
//
12+
//
13+
// it('should throw err - can not read property', (done) => {
14+
// stepFunctionsOfflinePlugin.variables = {FirstLambda: 'firstLamda'};
15+
// stepFunctionsOfflinePlugin.hooks[hooks.buildStepWorkFlow]()
16+
// .then((res) => {
17+
// expect(res).to.be.an('undefined')
18+
// })
19+
// .catch((err) => {
20+
// expect(err).to.throw(/Cannot read property/);
21+
// }).finally(done);
22+
// });
23+
//
24+
// it('should throw err - goody', (done) => {
25+
// stepFunctionsOfflinePlugin.variables = {FirstLambda: 'firstLambda'};
26+
// stepFunctionsOfflinePlugin.hooks[hooks.buildStepWorkFlow]()
27+
// .then((res) => {
28+
// console.log(111)
29+
// })
30+
// .catch((err) => {
31+
// console.log(222)
32+
//
33+
// }).finally(done);
34+
// });
35+
//
36+
// });
37+
//
38+
// // describe('#buildStepWorkFlow()', () => {
39+
// //
40+
// //
41+
// //
42+
// // });
43+
// });

0 commit comments

Comments
 (0)