-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
compiler.test.js
50 lines (40 loc) · 1.07 KB
/
compiler.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
40
41
42
43
44
45
46
47
48
49
50
/**
* Module dependencies.
*/
var connect = require('connect')
, assert = require('assert')
, should = require('should')
, http = require('http')
, fs = require('fs');
var fixtures = __dirname + '/fixtures';
try {
fs.unlinkSync(fixtures + '/style.css');
} catch (err) {
// ignore
}
module.exports = {
test: function(){
var app = connect.createServer(
connect.compiler({
src: fixtures
, enable: ['sass', 'coffeescript']
}),
connect.static(fixtures)
);
assert.response(app,
{ url: '/doesnotexist.css' },
{ body: 'Cannot GET /doesnotexist.css', status: 404 });
assert.response(app,
{ url: '/style.css' },
{ body: 'body {\n font-size: 12px;\n color: #000;}\n' });
assert.response(app,
{ url: '/style.css' },
{ body: 'body {\n font-size: 12px;\n color: #000;}\n' });
assert.response(app,
{ url: '/foo.bar.baz.css' },
{ body: 'foo {\n color: #000;}\n' });
},
'test .compilers': function(){
connect.compiler.compilers.should.be.a('object');
}
};