Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
forced transitions re-enabled. put dsl in readme.
- Loading branch information
1 parent
c8ac664
commit f8c96eb
Showing
11 changed files
with
285 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "jssm", | ||
"version": "4.1.18", | ||
"version": "4.2.0", | ||
"engines": { | ||
"node": ">=6.0.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
/* eslint-disable max-len */ | ||
|
||
import {describe} from 'ava-spec'; | ||
|
||
const jssm = require('../../../build/jssm.es5.js'), | ||
sm = jssm.sm; | ||
|
||
|
||
|
||
|
||
|
||
describe('reject and accept correctly', async it => { | ||
|
||
const machine = sm` a ~> b -> c; `; | ||
|
||
it('starts in a', t => t.is('a', machine.state() )); | ||
it('rejects transition to b', t => t.is(false, machine.transition('b') )); | ||
it('still in a', t => t.is('a', machine.state() )); | ||
it('rejects transition to c', t => t.is(false, machine.transition('c') )); | ||
it('still in a', t => t.is('a', machine.state() )); | ||
it('rejects forced transition to c', t => t.is(false, machine.force_transition('c') )); | ||
it('still in a', t => t.is('a', machine.state() )); | ||
it('accepts forced transition to b', t => t.is(true, machine.force_transition('b') )); | ||
it('now in b', t => t.is('b', machine.state() )); | ||
it('accepts transition to c', t => t.is(true, machine.transition('c') )); | ||
it('now in c', t => t.is('c', machine.state() )); | ||
|
||
}); |
Oops, something went wrong.