-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-config.js
executable file
·37 lines (29 loc) · 1019 Bytes
/
test-config.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
var express = require('express');
global.app = express();
global.router = express.Router();
global.request = require('supertest');
global.nunjucks = require('express-nunjucks');
global.routes = require(__dirname + '/app/routes.js');
global.app.set('view engine', 'html');
global.app.set('views', ['/..app/views', __dirname + '/lib/']);
global.app.use("/", routes);
global.nunjucks.setup({
autoescape: true,
watch: true,
noCache: true
}, global.app);
// Include the sinon mocking library and the ability to stub promises.
var sinon = require('sinon');
var sinonStubPromise = require('sinon-stub-promise');
global.sinon = sinon;
sinonStubPromise(sinon);
// Include the chai assertion library.
var chai = require('chai');
// Include the stacktrace on failing assertions
chai.config.includeStack = true;
// Set chai global assertions.
global.expect = chai.expect;
global.AssertionError = chai.AssertionError;
global.Assertion = chai.Assertion;
global.assert = chai.assert;
global.should = chai.should();