-
Notifications
You must be signed in to change notification settings - Fork 9
/
test.js
39 lines (32 loc) · 943 Bytes
/
test.js
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
33
34
35
36
37
38
39
/*jslint indent: 2, node: true, nomen: true, browser: true*/
/*global it, after, describe */
'use strict';
var assert = require('assert');
var fs = require('fs');
var rimraf = require('rimraf');
var expectedOutput = fs.readFileSync('test/expected/test.js', 'utf8');
after(function () {
rimraf.sync('test/temp/');
rimraf.sync('tmp');
});
describe('File creation', function(){
it('should compile .jsx files', function () {
assert.equal(
expectedOutput,
fs.readFileSync('test/temp/jsx/test.js', 'utf8')
);
});
it('should compile .js files', function () {
assert.equal(
expectedOutput,
fs.readFileSync('test/temp/js/test-options.js', 'utf8')
);
});
it('should pass transform options', function () {
var harmonyTest = fs.readFileSync('test/expected/harmony.js', 'utf8');
assert.equal(
harmonyTest,
fs.readFileSync('test/temp/jsx/harmony.js', 'utf8')
);
});
});