UNPKG

562 BJavaScriptView Raw
1"use strict";
2describe("CLS testing", function () {
3 var opinion = require('../');
4 it("CLS namespace should exist", function (done) {
5 var app = opinion();
6 app.onerror = function (err, ctx) {
7 ctx.res.headersSent = true;
8 throw err;
9 };
10
11 app.use(function* () {
12 yield function* () {
13 expect(global.opinionCLS.get('webContext')).equal(this);
14 };
15 });
16
17 expect(global).to.have.property('opinionCLS');
18
19 app.mock({url:'/gaga4'}, done);
20 });
21});