Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it(`shouldn't inadvertently replace DOM nodes`, function() {
// setup
el.replace = sinon.spy();
// test
parent1.name = el;
shouldTrackElement(parent1); // previously this would cause el.replace to be called
expect(el.replace.called).to.equal(false);
parent1.name = undefined;
parent1.id = el;
shouldTrackElement(parent2); // previously this would cause el.replace to be called
expect(el.replace.called).to.equal(false);
parent1.id = undefined;
parent1.type = el;
shouldTrackElement(parent2); // previously this would cause el.replace to be called
expect(el.replace.called).to.equal(false);
parent1.type = undefined;
describe('app - integration tests', function () {
this.timeout(10000);
const staticCurrentTime = new Date();
let messagingQueue, componentGroupId;
const appLogQueueCallbackSpy = sinon.spy();
const reqLogQueueCallbackSpy = sinon.spy();
let dbConnection;
let app, agent;
let jwtToken;
before(function (done) {
MockDate.set(staticCurrentTime);
// create a logs exchange on the messaging queue
messagingQueue = amqp.createConnection({url: process.env.RABBMITMQ_CONN_ENDPOINT});
messagingQueue.on('ready', () => {
describe('remove, should call the remove() on collection obj', function() {
const removeSpy = sinon.spy(testCollectionStub, 'deleteMany');
beforeEach(function() {
removeSpy.reset();
});
after(function() {
removeSpy.restore();
});
it ('should return the count after delete', async function() {
// do remove
const pred = {id: 1};
const cnt = await dao.remove(pred);
assert.strictEqual(cnt, 1);
it('should trigger an onInvalid handler, if passed, when form is invalid', () => {
const onValid = sinon.spy();
const onInvalid = sinon.spy();
mount(
,
);
expect(onValid.called).toEqual(false);
expect(onInvalid.called).toEqual(true);
});
test('timeout', function (done) {
var spy = sinon.spy()
var serverSpy = sinon.spy()
replay = createReplayServer(assertReplay)
server = createTimeoutServer()
proxy = rocky()
.forward(targetUrl)
.replay(replayUrl)
.listen(ports.proxy)
proxy.get('/test')
.options({ timeout: 50 })
.on('proxyReq', spy)
.on('proxy:error', spy)
supertest(proxyUrl)
.get('/test')
it("should call updateAABBPoint when passed a Point", function() {
var collider = new Crash.Point(new Crash.V);
var cache = Crash.updateAABBPoint;
var spy = Crash.updateAABBPoint = sinon.spy();
Crash.updateAABB(collider);
Crash.updateAABBPoint = cache;
expect(spy.called).to.be.ok();
expect(spy.callCount).to.be(1);
});
});
beforeEach(function () {
Tunnel = require_tunnel_module();
sinon.spy(wx, 'sendSocketMessage');
});
const initTest = () => {
const consoleProxy = {
trace: sinon.spy(function trace () { }),
debug: sinon.spy(function debug () { }),
info: sinon.spy(function info () { }),
warn: sinon.spy(function warn () { }),
error: sinon.spy(function error () { }),
critical: sinon.spy(function critical () { })
};
const system = start(configureLogging(logToConsole({ consoleProxy })));
return [consoleProxy, system];
};
beforeEach(() => {
setupDefaultRootLazy();
setupWrapper();
oReq = LazyRewireAPI.__get__('Req');
StubReq = sinon.spy(function ({ src }) {
const me = this;
me.src = src;
});
LazyRewireAPI.__set__('Req', StubReq);
});
afterEach(() => {
function setup(){
const store = configureStore(topicsReducer)
const state = store.getState()
let props = {
styles:{},
styleConstants:{},
userPrefs:{},
actions,
...state
}
sinon.spy(Topics.prototype,"render")
sinon.spy(Topics.prototype,"componentDidMount")
let wrapper = shallow()
return {wrapper,store}
}