Skip to content

Commit

Permalink
Add tests for utils module
Browse files Browse the repository at this point in the history
  • Loading branch information
andstor committed Apr 27, 2020
1 parent 8d95e59 commit 4931179
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/utils/options.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Volume, ArrayExporter, onlyOneTrue } from '../../src/index.js';
import ndarray from 'ndarray';


test('throws on more than one true option', () => {
let options = {
fill: true,
color: true
}

expect(() => {
onlyOneTrue(options);
}).toThrow();
});

test('returns true on only one true option', () => {
let options = {
fill: true,
color: false
}

expect(onlyOneTrue(options)).toEqual(true);
});

0 comments on commit 4931179

Please sign in to comment.