Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
assert.equal(board.blocks[0], 3)
assert.equal(board.blocks[3], 0)
assert.equal(board.blankpos, 3)
board.swapRight(3)
assert.equal(board.blocks[3], 4)
assert.equal(board.blocks[4], 0)
assert.equal(board.blankpos, 4)
board.swapAbove(4)
assert.equal(board.blocks[4], 1)
assert.equal(board.blocks[1], 0)
assert.equal(board.blankpos, 1)
board.swapLeft(1)
assert.equal(board.blocks[1], 3)
assert.equal(board.blocks[0], 0)
assert.equal(board.blankpos, 0)
board.swapAbove(3)
assert.equal(board.blocks[3], 0)
assert.equal(board.blocks[0], 4)
assert.equal(board.blankpos, 3)
})
it('should throw error when no-empty block swapped', () => {
it('cannot listen without a window object', () => {
let router = Router()
assert.throws(() => router.start(), 'start should throw without a window')
assert.equal(router.isListening, false, 'isListening should still be false')
})
})
it('should support `defaultValue`', function() {
const inputValue = 'my value';
const field = new Field(this);
field.init('input', {props: {defaultValue: inputValue}});
assert.equal(field.getValue('input'), inputValue);
});
it('escapes special characters', function() {
let path = new FieldPath('f.o.o');
assert.equal(path.formattedName, '`f.o.o`');
});
it('LDY_ABSX', () => {
mockedROM = new ROM(new Uint8Array([op.LDY_ABSX, 0xA5, 0x10]));
bus.ROM = mockedROM;
cpu.registors.X = 0x05;
mockedMemory.write(0x10AA, 0xAA);
const cycle = cpu.exec();
const expected = {
...defaultRegistors,
P: { ...defaultRegistors.P, negative: true },
PC: 0x8003,
Y: 0xAA,
X: 0x05,
};
assert.equal(cycle, 4);
assert.deepEqual(cpu.registors, expected);
});
});
it('Should root element have expected element and styles', () => {
const balloon = shallow();
const expectedStyles = {width: '100%', height: '100%', zIndex: 100};
assert.equal(balloon.type(), 'div');
assert.deepEqual(balloon.prop('style'), expectedStyles);
});
assert.equal(newVal, handlerValue);
const modifierFn = sinon.spy(val => val * val);
const trailingNoopFn = sinon.spy();
instance.addEventHandler(handlerName, modifierFn);
instance.addEventHandler(handlerName, trailingNoopFn);
try {
newVal = await instance.processEventHandlers(handlerName, handlerValue);
} catch (e) {
throw e;
}
assert.equal(noopFunc.callCount, 2);
assert.equal(promiseFn.callCount, 2);
assert.equal(modifierFn.callCount, 1);
assert.ok(modifierFn.calledWith(5));
assert.equal(trailingNoopFn.callCount, 1);
assert.equal(newVal, handlerValue * handlerValue);
});
.addEdge(v1, w1)
.addEdge(v1, w2)
.addEdge(v2, w1)
.addEdge(v2, w2)
const transformed = new EdgeConcentrationTransformer().transform(graph)
assert.equal(transformed.inDegree(u1), 0)
assert.equal(transformed.outDegree(u1), 1)
assert.equal(transformed.inDegree(u2), 0)
assert.equal(transformed.outDegree(u2), 1)
assert.equal(transformed.inDegree(v1), 1)
assert.equal(transformed.outDegree(v1), 1)
assert.equal(transformed.inDegree(v2), 1)
assert.equal(transformed.outDegree(v2), 1)
assert.equal(transformed.inDegree(w1), 2)
assert.equal(transformed.outDegree(w1), 0)
assert.equal(transformed.inDegree(w2), 2)
assert.equal(transformed.outDegree(w2), 0)
})
it('test 1', () => {
assert.equal(b, 1)
assert.equal(be, 2)
assert.equal(a, 0)
assert.equal(ae, 1)
})
})
component.on('componentError', (err) => {
assert.equal(err.message, 'Date is not a valid day.');
assert.equal(err.component.key, 'date');
done();
});