Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
typeof reduxCode !== 'undefined' &&
code.toString().includes('switch') &&
code.toString().includes('case') &&
code.toString().includes('default'),
error_6);
testResults[6].status = true;
} catch (err) {
passed = false;
testResults[6].status = false;
}
const noWhiteSpace = code.toString().replace(/\s/g,'');
// test 7:
try {
assert(
(noWhiteSpace.includes('constLOGIN=\'LOGIN\'') || noWhiteSpace.includes('constLOGIN="LOGIN"')) &&
(noWhiteSpace.includes('constLOGOUT=\'LOGOUT\'') || noWhiteSpace.includes('constLOGOUT="LOGOUT"')),
error_7);
testResults[7].status = true;
} catch (err) {
passed = false;
testResults[7].status = false;
}
// test 8:
try {
assert(
noWhiteSpace.includes('caseLOGIN:') &&
noWhiteSpace.includes('caseLOGOUT:') &&
noWhiteSpace.includes('type:LOGIN') &&
noWhiteSpace.includes('type:LOGOUT'),
foreach(content, (value, key) => {
if (isMediaQueryDeclaration.test(key)) {
processMediaQuery(styles, key.substring(1), value, parent);
} else if (isStandaloneSelector.test(key)) {
assert(false, 'stand-alone selectors are not allowed at the top-level');
} else if (hasAttachedSelector.test(key)) {
const [styleName, selectorName] = splitSelector(key);
processStyleAndSelector(styles, styleName, selectorName, value, parent);
} else if (key.charAt(0) === '$') {
const firstSubKey = Object.keys(value)[0];
if (!isPlainObject(value[firstSubKey])) {
// needs to be deprecated
processStyle(styles, key, value);
} else {
transformStyleSheetObjectIntoSpecification(value, styles, key.substring(1));
}
} else {
processStyle(styles, key, value, parent);
}
});
it("to object", function() {
assert(toObject(allTypes), "serializable");
assert.deepEqual(
toObject(allTypes),
toObject(allTypes),
"serializable (single to)"
);
assert.deepEqual(
toObject(toObject(allTypes)),
toObject(allTypes),
"serializable (double to)"
);
assert.deepEqual(
toObject(fromObject(allTypes)),
toObject(allTypes),
"non-serializable"
);
assert.deepEqual(
let firstCreateCanvas,
secondCreateCanvas,
firstCreateCanvasAgain;
canvas.createCanvas(() => {
firstCreateCanvas = easeljs.createCanvas;
canvas.createCanvas(() => {
secondCreateCanvas = easeljs.createCanvas;
});
firstCreateCanvasAgain = easeljs.createCanvas;
});
assert(firstCreateCanvas, 'firstCreateCanvas should exist');
assert(secondCreateCanvas, 'secondCreateCanvas should exist');
assert(firstCreateCanvasAgain, 'firstCreateCanvasAgain should exist');
assert(secondCreateCanvas !== firstCreateCanvas, '1st and 2nd should not be the same');
assert(firstCreateCanvas === firstCreateCanvasAgain, '1st and 3rd should be the same');
assert(!easeljs.createCanvas, 'createCanvas should not exist');
});
}).then(() => {
assert(dispatchRequest.calledWith(19));
assert(dispatchRequest.neverCalledWith(6));
});
});
it('should return ranges for already-open files', () => {
tracker.addFileMessages([messageForInitiallyOpenFile]);
const range = tracker.getCurrentRange(messageForInitiallyOpenFile);
invariant(range != null);
expect(range.isEqual(new Range([1, 18], [1, 22]))).toBeTruthy();
checkRep(tracker);
});
async flush(): Promise {
assert(!this._closed)
if (this._dataBlock.isEmpty()) return
assert(!this._pendingIndexEntry)
await this.writeBlock(this._dataBlock, this._pendingHandle)
this._pendingIndexEntry = true
if (!!this._metaBlock) {
this._metaBlock.startBlock(this._offset)
}
}
function setLoggerLevelHelper(level: string): void {
const logger = getLog4jsLogger(category);
invariant(logger);
logger.setLevel(level);
}
describe('Main file', () => {
assert(RU);
});
return (assertion: boolean, reason: string) => {
assert(assertion, `${message}: ${reason}`);
return true;
};
}