Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor (state, value) {
assert.equal(typeof state, 'object', 'page: arg1 "state" must be type object')
assert.equal(typeof state.content, 'object', 'page: state.content must be type object')
// fallback route
state.href = state.href || '/'
// private data
this._state = state || { }
this._value = value || { }
}
it('should generate a map', function() {
var ast = parse('.a {\n color: red;\n}\n', {
filename: 'test.css',
positions: true
});
var result = generate(ast, { sourceMap: true });
assert.equal(result.css, '.a{color:red}');
assert.equal(result.map.toString(), '{"version":3,"sources":["test.css"],"names":[],"mappings":"AAAA,E,CACE,S"}');
});
it('sets valid config options', function () {
Honeybadger.configure({
apiKey: 'badgers',
environment: 'badger_env',
endpoint: 'https://www.example.com/',
projectRoot: 'badger_root',
hostname: 'badger_host',
logger: console
});
assert.equal('badgers', Honeybadger.apiKey);
assert.equal('badger_env', Honeybadger.environment);
assert.equal('https://www.example.com/', Honeybadger.endpoint);
assert.equal('badger_root', Honeybadger.projectRoot);
assert.equal('badger_host', Honeybadger.hostname);
assert.equal(console, Honeybadger.logger);
});
});
it('names its function and middleware', function () {
assert.equal(helmet.nocache.name, 'nocache');
assert.equal(helmet.nocache().name, 'nocache');
});
it('should return an ICS file as a string', () => {
assert.equal(calendar.toString(), exampleOutput)
})
})
it('script type', function () {
let $ = createHtmlDom(`
`)
assert.equal($.uglify(), '')
})
setTimeout(function() {
assert.equal(recv, 2);
done();
}, 100);
});
process.on('exit', function() {
common.debug('responses_recvd: ' + responses_recvd);
assert.equal(2, responses_recvd);
common.debug('responses_sent: ' + responses_sent);
assert.equal(2, responses_sent);
assert.equal('The path was /hello', body0);
assert.equal('The path was /world', body1);
});
(err, objs, cb) => {
assert.equal(err.message, 'Aouch!');
cb(null, []);
}
);