-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.spec.js
More file actions
33 lines (26 loc) · 993 Bytes
/
index.spec.js
File metadata and controls
33 lines (26 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var expect = require('chai').expect;
var mock = require('./');
// not sure the best way to test for a Proxy, since it's completely transparent...
describe('mock-css-modules', function() {
it('should handle CSS requires', function() {
var test = require('./test/test.css');
expect(test).to.be.an('object');
expect(test.monkey).to.equal('monkey');
});
it('should allow me to register a single file extension', function() {
mock.register('.sass');
var test = require('./test/test.sass');
expect(test).to.be.an('object');
expect(test.bagel).to.equal('bagel');
});
it('should allow me to register multiple file extensions', function() {
mock.register(['.scss', '.stylesheet']);
var test = require('./test/test.stylesheet');
expect(test).to.be.an('object');
expect(test.bob).to.equal('bob');
});
it('should not confuse babel', function() {
var test = require('./test/test.css');
expect(test.__esModule).to.be.false;
});
});