Skip to content

Commit

Permalink
better tests for themes, incl checking and negative
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneCypher committed Jan 11, 2020
1 parent c2c345f commit e6653bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,3 +1,4 @@
* [[`c2c345f2a2`](https://github.com/StoneCypher/jssm/commit/c2c345f2a2)] - theme support achieved in machine (John Haugeland)
* [[`7dce5fe051`](https://github.com/StoneCypher/jssm/commit/7dce5fe051)] - working grammar passthrough (John Haugeland)
* [[`e18d4913e0`](https://github.com/StoneCypher/jssm/commit/e18d4913e0)] - first steps in theme support - grammar and tests (John Haugeland)
* [[`aa350a8305`](https://github.com/StoneCypher/jssm/commit/aa350a8305)] - rule cleanup (John Haugeland)
Expand Down
7 changes: 7 additions & 0 deletions src/js/tests/theme.js
Expand Up @@ -16,4 +16,11 @@ describe('Named themes', async it => {
it(`Theme "${thisTheme}" parses as a theme`, t =>
t.notThrows( () => { const _foo = sm`theme: ${thisTheme}; a-> b;`; }) ) );

NamedThemes.map(thisTheme =>
it(`Theme "${thisTheme}" shows correct theme`, t =>
t.is( thisTheme, sm`theme: ${thisTheme}; a-> b;`.theme() ) ) );

it('Fake theme throws', t =>
t.throws( () => { const _foo = sm`theme: zeghezgqqqqthirteen; a-> b;`; }) );

});

0 comments on commit e6653bd

Please sign in to comment.