Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/browser/provider/built-in/locally-installed.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export default {

browserName = browserName.toLowerCase().split(' ')[0];

return browserNames.indexOf(browserName) > -1;
return browserNames.includes(browserName);
},
};
4 changes: 2 additions & 2 deletions src/client-functions/selectors/add-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const filterNodes = new ClientFunctionBuilder((nodes, filter, querySelectorRoot,
for (let i = 0; i < matching.length; i++)
matchingArr.push(matching[i]);

filter = node => matchingArr.indexOf(node) > -1;
filter = node => matchingArr.includes(node);
}

if (typeof filter === 'function') {
Expand All @@ -61,7 +61,7 @@ const expandSelectorResults = new ClientFunctionBuilder((selector, populateDeriv

if (derivativeNodes) {
for (let j = 0; j < derivativeNodes.length; j++) {
if (result.indexOf(derivativeNodes[j]) < 0)
if (!result.includes(derivativeNodes[j]))
result.push(derivativeNodes[j]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/client-functions/selectors/create-snapshot-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default function createSnapshotMethods (snapshot) {
const isElementSnapshot = !!snapshot.tagName;

if (isElementSnapshot) {
snapshot.hasClass = name => snapshot.classNames.indexOf(name) > -1;
snapshot.hasClass = name => snapshot.classNames.includes(name);
snapshot.getStyleProperty = prop => snapshot.style[prop];
snapshot.getAttribute = attrName => snapshot.attributes[attrName];
snapshot.hasAttribute = attrName => snapshot.attributes.hasOwnProperty(attrName);
Expand Down
2 changes: 1 addition & 1 deletion src/client/ui/select-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function onWindowClick (e, dispatched, preventDefault) {

preventDefault();

const isDisabled = target.className.indexOf(DISABLED_CLASS) > -1;
const isDisabled = target.className.includes(DISABLED_CLASS);

if (isDisabled && browserUtils.isWebKit)
return;
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/test-file/formats/es-next/get-test-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class EsNextTestFileParser extends TestFileParserBase {
getStringValue (token) {
const stringTypes = [this.tokenType.StringLiteral, this.tokenType.TemplateLiteral, this.tokenType.Identifier];

if (stringTypes.indexOf(token.type) > -1)
if (stringTypes.includes(token.type))
return this.formatFnArg(token);

return null;
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/test-file/formats/typescript/get-test-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import TypescriptConfiguration from '../../../../configuration/typescript-config

function replaceComments (code) {
return code.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, match => {
const lastSymbol = match.indexOf('\n') > -1 ? '\n' : ' ';
const lastSymbol = match.includes('\n') ? '\n' : ' ';

return repeat(' ', match.length + lastSymbol);
});
Expand Down Expand Up @@ -85,7 +85,7 @@ class TypeScriptTestFileParser extends TestFileParserBase {
getStringValue (token) {
const stringTypes = [this.tokenType.StringLiteral, this.tokenType.TemplateExpression];

if (stringTypes.indexOf(token.kind) > -1 || token.text && token.kind !== this.tokenType.NumericLiteral)
if (stringTypes.includes(token.kind) || token.text && token.kind !== this.tokenType.NumericLiteral)
return this.formatFnArg(token);

return null;
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/test-file/test-file-parser-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class TestFileParserBase {

//NOTE: fixture.skip('fixtureName'), test.only('testName') etc.
const isMemberCall = type === this.tokenType.PropertyAccessExpression &&
METHODS_SPECIFYING_NAME.indexOf(apiFn) > -1;
METHODS_SPECIFYING_NAME.includes(apiFn);

//NOTE: fixture.before().after()('fixtureName'), test.before()`testName`.after() etc.
const isTailCall = type === this.tokenType.CallExpression;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/handle-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let handlingTestErrors = false;

function printErrorMessagesAndTerminate (...messages) {
// eslint-disable-next-line no-console
messages.map(msg => console.log(msg));
messages.forEach(msg => console.log(msg));

// eslint-disable-next-line no-process-exit
setTimeout(() => process.exit(1), 0);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function splitQuotedText (str, splitChar, quotes = '"\'') {
currentPart = '';
}
}
else if (quotes.indexOf(currentChar) > -1) {
else if (quotes.includes(currentChar)) {
if (quoteChar === currentChar)
quoteChar = null;
else if (!quoteChar)
Expand Down Expand Up @@ -90,7 +90,7 @@ function getDisplayedItemText (item, quote) {
export function getConcatenatedValuesString (array, separator = DEFAULT_CONCATENATED_VALUES.SEPARATOR, quoteChar = DEFAULT_CONCATENATED_VALUES.QUOTE_CHAR) {
const clonedArray = [...array];

if (separator.indexOf('\n') > -1)
if (separator.includes('\n'))
return clonedArray.map(item => getDisplayedItemText(item, quoteChar)).join(separator);

else if (clonedArray.length === 1)
Expand Down
Loading