Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('clones Date object', function() {
var date = new Date(2014, 10, 14, 23, 59, 59, 999);
var clone = R.clone(date);
assert.notStrictEqual(date, clone);
eq(clone, new Date(2014, 10, 14, 23, 59, 59, 999));
eq(clone.getDay(), 5); // friday
});
'use strict';
const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
// Verify that a shell is, in fact, executed
const doesNotExist = cp.spawn('does-not-exist', { shell: true });
assert.notStrictEqual(doesNotExist.spawnfile, 'does-not-exist');
doesNotExist.on('error', common.mustNotCall());
doesNotExist.on('exit', common.mustCall((code, signal) => {
assert.strictEqual(signal, null);
if (common.isWindows)
assert.strictEqual(code, 1); // Exit code of cmd.exe
else
assert.strictEqual(code, 127); // Exit code of /bin/sh
}));
// Verify that passing arguments works
const echo = cp.spawn('echo', ['foo'], {
encoding: 'utf8',
shell: true
});
let echoOutput = '';
function check(head: any, parser: any) {
const source = "for (" + head + ") console.log(i);";
const ast = recast.parse(source, { parser: parser });
const loop = ast.program.body[0];
assert.strictEqual(loop.type, "ForStatement");
loop.body = b.blockStatement([]);
const reprinted = recast.print(ast).code;
const openParenIndex = reprinted.indexOf("(");
assert.notStrictEqual(openParenIndex, -1);
const closeParenIndex = reprinted.indexOf(")", openParenIndex);
assert.notStrictEqual(closeParenIndex, -1);
const newHead = reprinted.slice(
openParenIndex + 1,
closeParenIndex
);
assert.strictEqual(newHead.split(";").length, 3);
}
const s = new TestStream();
assert.deepStrictEqual(s.listeners('foo'), []);
}
{
const ee = new events.EventEmitter();
ee.on('foo', listener);
const wrappedListener = ee.rawListeners('foo');
assert.strictEqual(wrappedListener.length, 1);
assert.strictEqual(wrappedListener[0], listener);
assert.notStrictEqual(wrappedListener, ee.rawListeners('foo'));
ee.once('foo', listener);
const wrappedListeners = ee.rawListeners('foo');
assert.strictEqual(wrappedListeners.length, 2);
assert.strictEqual(wrappedListeners[0], listener);
assert.notStrictEqual(wrappedListeners[1], listener);
assert.strictEqual(wrappedListeners[1].listener, listener);
assert.notStrictEqual(wrappedListeners, ee.rawListeners('foo'));
ee.emit('foo');
assert.strictEqual(wrappedListeners.length, 2);
assert.strictEqual(wrappedListeners[1].listener, listener);
}
{
const ee = new events.EventEmitter();
ee.once('foo', listener3);
ee.on('foo', listener4);
const rawListeners = ee.rawListeners('foo');
assert.strictEqual(rawListeners.length, 2);
assert.strictEqual(rawListeners[0](), 0);
const rawListener = ee.rawListeners('foo');
assert.strictEqual(rawListener.length, 1);
it("should be kept at top of outer function", function () {
var strictCode = String(strict);
var useStrictIndex = strictCode.indexOf("use strict");
var thisIndex = strictCode.indexOf("this");
assert.notStrictEqual(useStrictIndex, -1);
assert.ok(thisIndex > useStrictIndex);
assert.strictEqual(String(sloppy).indexOf("use strict"), -1);
check(strict(), [true]);
check(sloppy(), [false]);
});
});
it('aria-details', () => {
const { id, idref } = browser.execute(function() {
var integration = document.querySelector('integration-dynamic-scoped-ids');
var idElm = integration.shadowRoot.querySelector('.details-id');
var idrefElm = integration.shadowRoot.querySelector('.details-idref');
return {
id: idElm.id,
idref: idrefElm.ariaDetails,
};
}).value;
assert(id.length > 0, 'id attr should be non-empty string');
assert.notStrictEqual(id, 'details', 'id attr should be transformed');
assert.notStrictEqual(idref, 'details', 'idref attr should be transformed');
assert(id === idref, 'id attr and idref attr should be the same value');
});
it('aria-errormessage', () => {
it('aria-details', () => {
const { id, idref } = browser.execute(function() {
var integration = document.querySelector('integration-dynamic-scoped-ids');
var idElm = integration.shadowRoot.querySelector('.details-id');
var idrefElm = integration.shadowRoot.querySelector('.details-idref');
return {
id: idElm.id,
idref: idrefElm.ariaDetails,
};
}).value;
assert(id.length > 0, 'id attr should be non-empty string');
assert.notStrictEqual(id, 'details', 'id attr should be transformed');
assert.notStrictEqual(idref, 'details', 'idref attr should be transformed');
assert(id === idref, 'id attr and idref attr should be the same value');
});
it('aria-errormessage', () => {
{species: "Manaphy", ability: 'hydration', item: 'laggingtail', moves: ['rest']}
]);
battle.p1.active[0].damage = function () {
if (battle.activeMove.id === 'weatherball') {
assert.strictEqual(battle.activeMove.type, 'Water');
}
return BattleEngine.BattlePokemon.prototype.damage.apply(this, arguments);
};
battle.commitDecisions();
assert.strictEqual(battle.p2.active[0].template.speciesid, 'castformrainy');
battle.choose('p2', 'switch 2');
battle.commitDecisions();
assert.strictEqual(battle.p2.active[0].getStat('spe'), 2 * battle.p2.active[0].stats['spe']);
battle.choose('p2', 'switch 3');
battle.commitDecisions();
assert.notStrictEqual(battle.p2.active[0].maxhp - battle.p2.active[0].hp, 20);
battle.choose('p2', 'switch 4');
battle.commitDecisions();
assert.notStrictEqual(battle.p2.active[0].maxhp - battle.p2.active[0].hp, 20);
battle.choose('p2', 'switch 5');
battle.commitDecisions();
battle.commitDecisions();
assert.strictEqual(battle.p2.active[0].status, '');
});
var bt = new btree(3);
bt.put(10).put(30, "avalue").put(20).put(40).put(55);//cause root split
bt.put(5)
bt.put(11, "eleven")
bt.put(6);
bt.put(50).put(65).put(15)
bt.put(22).put(24).put(26).put(27).put(28).put(29);
bt.delete(20);
bt.delete(26);
bt.delete(6);
bt.checkInvariants(bt.root);
assert.strictEqual(bt.get(20), undefined);
assert.strictEqual(bt.get(26), undefined);
assert.strictEqual(bt.get(6), undefined);
assert.notStrictEqual(bt.get(11), "eleven")
assert.notStrictEqual(bt.get(30), "avalue")
}
onAuthenticated(err) {
assert.notStrictEqual(err, decorateRequestError);
assert.strictEqual(err, error);
done();
},
});