Skip to content

Commit 75747d8

Browse files
committed
test throws on null, undefined, NaN value of vars export
1 parent 3eb0684 commit 75747d8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

__tests__/index.spec.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,18 @@ describe('js-to-styles-vars-loader', () => {
5656
describe('guardExportType', () => {
5757
it ("throws on anything except an object, does not throw otherwise", () => {
5858
const areOk = [{}, {a: "foo"}];
59-
const areNotOk = [[], ["a"], "", "123", 123, false, true];
59+
const areNotOk = [[], ["a"], "", "123", 123, false, true, null, undefined, NaN];
6060
expect(() => {
6161
for (const okThing of areOk) {
6262
operator.guardExportType(okThing, "");
6363
}
6464
}).not.toThrow();
65-
for (const okThing of areNotOk) {
65+
for (const notOkThing of areNotOk) {
66+
6667
expect(() => {
67-
operator.guardExportType(okThing, "");
68-
}).toThrow();
68+
operator.guardExportType(notOkThing, "");
69+
},).toThrow();
70+
6971
}
7072

7173
})

0 commit comments

Comments
 (0)