Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('matches /cat/:id with a custom url-pattern options and periods in param', function() {
var match = matchRoutes(routes, '/cat/hello.with.periods', null, {
segmentValueCharset: 'a-zA-Z0-9_\\- %\\.'
});
assert(match.route);
assert.strictEqual(match.route.props.handler.props.name, 'cat');
assert.deepEqual(match.match, {id: 'hello.with.periods'});
assert.strictEqual(match.path, '/cat/hello.with.periods');
assert.strictEqual(match.matchedPath, '/cat/hello.with.periods');
assert.strictEqual(match.unmatchedPath, null);
});
it("should pass string through unmodified", () => {
const result = parseRegExIntent("foo");
assert.strictEqual(result, "foo");
});
it("should pass string array through unmodified", () => {
it('_crushWallByPlayer', function() {
var store = _createGameStore();
store._prepare();
store._picksCount = 1;
let playerPos = store._maze.searchThingPos(store._things.player);
let upperPos = [playerPos[0] - 1, playerPos[1]];
let wallAtUpper = store._maze.getCellOrError(upperPos).getThing();
assert.strictEqual(wallAtUpper.getTypeId(), 'wall');
store._crushWallByPlayer(MazeModel.DIRECTIONS.UP);
let crushedThing = store._maze.getCellOrError(upperPos).getThing();
assert.strictEqual(crushedThing, null);
assert.strictEqual(store._picksCount, 0);
});
it('stringifies the given object. See https://github.com/twada/stringifier for details', () => {
const str = kocha.stringify({ foo: 1, bar: new Date(0) })
assert.strictEqual(str, 'Object{foo:1,bar:new Date("1970-01-01T00:00:00.000Z")}')
})
})
it('pageId', function() {
var store = new ScreenStore();
store._pageId = 'foo';
assert.strictEqual(store.pageId, 'foo');
});
});
it('returns message + stack if message is not in stack', () => {
const stack = 'foo\n'
const message = 'bar'
assert.strictEqual(formatError({ stack, message }), 'bar\nfoo\n')
})
.request(options, res => {
assert.strictEqual(res.statusCode, 500);
res.resume();
server.close();
})
.on("error", console.error);
return runner.run().then(() => {
assert.strictEqual(runner.tests[0].getRetryCount(), 7)
assert.strictEqual(runner.tests[1].getRetryCount(), 0)
td.verify(spy0(), { times: 8 })
td.verify(spy1(), { times: 1 })
})
})
return shouldRejected(promise).catch(function(error){
assert.strictEqual(error, undefined);
});
});