Skip to content

Commit

Permalink
Export an object from the CSS-in-JS syntax (#4824)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-allanson committed Jun 9, 2020
1 parent 5b6b996 commit 7cf0c36
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions lib/__tests__/syntaxes.test.js
@@ -0,0 +1,17 @@
'use strict';

const syntaxes = require('../syntaxes/index');

const inputs = Object.keys(syntaxes).map((name) => [
name,
require(`../syntaxes/syntax-${name}.js`), // directly require modules to bypass importLazy() in syntaxes/index.js
]);

describe('syntaxes', () => {
it.each(inputs)('syntax is an object with parse and stringify keys: %s', (name, module) => {
expect(module).toMatchObject({
parse: expect.any(Function),
stringify: expect.any(Function),
});
});
});
2 changes: 1 addition & 1 deletion lib/syntaxes/syntax-css-in-js.js
@@ -1,3 +1,3 @@
'use strict';

module.exports = require('@stylelint/postcss-css-in-js');
module.exports = require('@stylelint/postcss-css-in-js')();

0 comments on commit 7cf0c36

Please sign in to comment.