[ENHANCEMENT] Properly configure eslint to work with jest (#988)

* chore: make aware eslint that we use jest

By setting up the jest environment, we no longer need to declare the
'test' global in the configuration.

* chore: don't need to import expect, it's a jest environment global

* chore: don't need to import expect when creating undefined test
This commit is contained in:
Christian C. Salvadó
2019-06-17 23:34:45 -06:00
committed by Angelos Chalaris
parent 3cafbf43f1
commit 83a6a6ea32
374 changed files with 2 additions and 377 deletions

View File

@ -2,10 +2,8 @@
"env": { "env": {
"browser": true, "browser": true,
"es6": true, "es6": true,
"node": true "node": true,
}, "jest": true
"globals": {
"test": false
}, },
"extends": "eslint:recommended", "extends": "eslint:recommended",
"parserOptions": { "parserOptions": {

View File

@ -28,7 +28,6 @@ try {
// Create files for undefined tests // Create files for undefined tests
undefinedTests.forEach(snippet => { undefinedTests.forEach(snippet => {
const exportTest = [ const exportTest = [
`const expect = require('expect');`,
`const {${snippet}} = require('./_30s.js');`, `const {${snippet}} = require('./_30s.js');`,
`\ntest('${snippet} is a Function', () => {`, `\ntest('${snippet} is a Function', () => {`,
` expect(${snippet}).toBeInstanceOf(Function);`, ` expect(${snippet}).toBeInstanceOf(Function);`,

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {CSVToArray} = require('./_30s.js'); const {CSVToArray} = require('./_30s.js');
test('CSVToArray is a Function', () => { test('CSVToArray is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {CSVToJSON} = require('./_30s.js'); const {CSVToJSON} = require('./_30s.js');
test('CSVToJSON is a Function', () => { test('CSVToJSON is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {JSONToDate} = require('./_30s.js'); const {JSONToDate} = require('./_30s.js');
test('JSONToDate is a Function', () => { test('JSONToDate is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {JSONToFile} = require('./_30s.js'); const {JSONToFile} = require('./_30s.js');
test('JSONToFile is a Function', () => { test('JSONToFile is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {JSONtoCSV} = require('./_30s.js'); const {JSONtoCSV} = require('./_30s.js');
test('JSONtoCSV is a Function', () => { test('JSONtoCSV is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {RGBToHex} = require('./_30s.js'); const {RGBToHex} = require('./_30s.js');
test('RGBToHex is a Function', () => { test('RGBToHex is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {URLJoin} = require('./_30s.js'); const {URLJoin} = require('./_30s.js');
test('URLJoin is a Function', () => { test('URLJoin is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {UUIDGeneratorBrowser} = require('./_30s.js'); const {UUIDGeneratorBrowser} = require('./_30s.js');
test('UUIDGeneratorBrowser is a Function', () => { test('UUIDGeneratorBrowser is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {UUIDGeneratorNode} = require('./_30s.js'); const {UUIDGeneratorNode} = require('./_30s.js');
test('UUIDGeneratorNode is a Function', () => { test('UUIDGeneratorNode is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {all} = require('./_30s.js'); const {all} = require('./_30s.js');
test('all is a Function', () => { test('all is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {allEqual} = require('./_30s.js'); const {allEqual} = require('./_30s.js');
test('allEqual is a Function', () => { test('allEqual is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {any} = require('./_30s.js'); const {any} = require('./_30s.js');
test('any is a Function', () => { test('any is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {approximatelyEqual} = require('./_30s.js'); const {approximatelyEqual} = require('./_30s.js');
test('approximatelyEqual is a Function', () => { test('approximatelyEqual is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {arrayToCSV} = require('./_30s.js'); const {arrayToCSV} = require('./_30s.js');
test('arrayToCSV is a Function', () => { test('arrayToCSV is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {arrayToHtmlList} = require('./_30s.js'); const {arrayToHtmlList} = require('./_30s.js');
test('arrayToHtmlList is a Function', () => { test('arrayToHtmlList is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {ary} = require('./_30s.js'); const {ary} = require('./_30s.js');
test('ary is a Function', () => { test('ary is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {atob} = require('./_30s.js'); const {atob} = require('./_30s.js');
test('atob is a Function', () => { test('atob is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {attempt} = require('./_30s.js'); const {attempt} = require('./_30s.js');
test('attempt is a Function', () => { test('attempt is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {average} = require('./_30s.js'); const {average} = require('./_30s.js');
test('average is a Function', () => { test('average is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {averageBy} = require('./_30s.js'); const {averageBy} = require('./_30s.js');
test('averageBy is a Function', () => { test('averageBy is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {bifurcate} = require('./_30s.js'); const {bifurcate} = require('./_30s.js');
test('bifurcate is a Function', () => { test('bifurcate is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {bifurcateBy} = require('./_30s.js'); const {bifurcateBy} = require('./_30s.js');
test('bifurcateBy is a Function', () => { test('bifurcateBy is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {binarySearch} = require('./_30s.js'); const {binarySearch} = require('./_30s.js');
test('binarySearch is a Function', () => { test('binarySearch is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {bind} = require('./_30s.js'); const {bind} = require('./_30s.js');
test('bind is a Function', () => { test('bind is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {bindAll} = require('./_30s.js'); const {bindAll} = require('./_30s.js');
test('bindAll is a Function', () => { test('bindAll is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {bindKey} = require('./_30s.js'); const {bindKey} = require('./_30s.js');
test('bindKey is a Function', () => { test('bindKey is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {binomialCoefficient} = require('./_30s.js'); const {binomialCoefficient} = require('./_30s.js');
test('binomialCoefficient is a Function', () => { test('binomialCoefficient is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {bottomVisible} = require('./_30s.js'); const {bottomVisible} = require('./_30s.js');
test('bottomVisible is a Function', () => { test('bottomVisible is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {btoa} = require('./_30s.js'); const {btoa} = require('./_30s.js');
test('btoa is a Function', () => { test('btoa is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const { byteSize } = require('./_30s.js'); const { byteSize } = require('./_30s.js');
const Blob = class { const Blob = class {
constructor(s) { constructor(s) {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {call} = require('./_30s.js'); const {call} = require('./_30s.js');
test('call is a Function', () => { test('call is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {capitalize} = require('./_30s.js'); const {capitalize} = require('./_30s.js');
test('capitalize is a Function', () => { test('capitalize is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {capitalizeEveryWord} = require('./_30s.js'); const {capitalizeEveryWord} = require('./_30s.js');
test('capitalizeEveryWord is a Function', () => { test('capitalizeEveryWord is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {castArray} = require('./_30s.js'); const {castArray} = require('./_30s.js');
test('castArray is a Function', () => { test('castArray is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {celsiusToFahrenheit} = require('./_30s.js'); const {celsiusToFahrenheit} = require('./_30s.js');
test('celsiusToFahrenheit is a Function', () => { test('celsiusToFahrenheit is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {chainAsync} = require('./_30s.js'); const {chainAsync} = require('./_30s.js');
test('chainAsync is a Function', () => { test('chainAsync is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {checkProp} = require('./_30s.js'); const {checkProp} = require('./_30s.js');
test('checkProp is a Function', () => { test('checkProp is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {chunk} = require('./_30s.js'); const {chunk} = require('./_30s.js');
test('chunk is a Function', () => { test('chunk is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {clampNumber} = require('./_30s.js'); const {clampNumber} = require('./_30s.js');
test('clampNumber is a Function', () => { test('clampNumber is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {cleanObj} = require('./_30s.js'); const {cleanObj} = require('./_30s.js');
test('cleanObj is a Function', () => { test('cleanObj is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {cloneRegExp} = require('./_30s.js'); const {cloneRegExp} = require('./_30s.js');
test('cloneRegExp is a Function', () => { test('cloneRegExp is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {coalesce} = require('./_30s.js'); const {coalesce} = require('./_30s.js');
test('coalesce is a Function', () => { test('coalesce is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {coalesceFactory} = require('./_30s.js'); const {coalesceFactory} = require('./_30s.js');
test('coalesceFactory is a Function', () => { test('coalesceFactory is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {collatz} = require('./_30s.js'); const {collatz} = require('./_30s.js');
test('collatz is a Function', () => { test('collatz is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {collectInto} = require('./_30s.js'); const {collectInto} = require('./_30s.js');
test('collectInto is a Function', () => { test('collectInto is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {colorize} = require('./_30s.js'); const {colorize} = require('./_30s.js');
test('colorize is a Function', () => { test('colorize is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {compact} = require('./_30s.js'); const {compact} = require('./_30s.js');
test('compact is a Function', () => { test('compact is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {compactWhitespace} = require('./_30s.js'); const {compactWhitespace} = require('./_30s.js');
test('compactWhitespace is a Function', () => { test('compactWhitespace is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {compose} = require('./_30s.js'); const {compose} = require('./_30s.js');
test('compose is a Function', () => { test('compose is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {composeRight} = require('./_30s.js'); const {composeRight} = require('./_30s.js');
test('composeRight is a Function', () => { test('composeRight is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {converge} = require('./_30s.js'); const {converge} = require('./_30s.js');
test('converge is a Function', () => { test('converge is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {copyToClipboard} = require('./_30s.js'); const {copyToClipboard} = require('./_30s.js');
test('copyToClipboard is a Function', () => { test('copyToClipboard is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {countBy} = require('./_30s.js'); const {countBy} = require('./_30s.js');
test('countBy is a Function', () => { test('countBy is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {countOccurrences} = require('./_30s.js'); const {countOccurrences} = require('./_30s.js');
test('countOccurrences is a Function', () => { test('countOccurrences is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {countVowels} = require('./_30s.js'); const {countVowels} = require('./_30s.js');
test('countVowels is a Function', () => { test('countVowels is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {counter} = require('./_30s.js'); const {counter} = require('./_30s.js');
test('counter is a Function', () => { test('counter is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {createDirIfNotExists} = require('./_30s.js'); const {createDirIfNotExists} = require('./_30s.js');
test('createDirIfNotExists is a Function', () => { test('createDirIfNotExists is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {createElement} = require('./_30s.js'); const {createElement} = require('./_30s.js');
test('createElement is a Function', () => { test('createElement is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {createEventHub} = require('./_30s.js'); const {createEventHub} = require('./_30s.js');
test('createEventHub is a Function', () => { test('createEventHub is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {currentURL} = require('./_30s.js'); const {currentURL} = require('./_30s.js');
test('currentURL is a Function', () => { test('currentURL is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {curry} = require('./_30s.js'); const {curry} = require('./_30s.js');
test('curry is a Function', () => { test('curry is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {dayOfYear} = require('./_30s.js'); const {dayOfYear} = require('./_30s.js');
test('dayOfYear is a Function', () => { test('dayOfYear is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {debounce} = require('./_30s.js'); const {debounce} = require('./_30s.js');
test('debounce is a Function', () => { test('debounce is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {decapitalize} = require('./_30s.js'); const {decapitalize} = require('./_30s.js');
test('decapitalize is a Function', () => { test('decapitalize is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {deepClone} = require('./_30s.js'); const {deepClone} = require('./_30s.js');
test('deepClone is a Function', () => { test('deepClone is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {deepFlatten} = require('./_30s.js'); const {deepFlatten} = require('./_30s.js');
test('deepFlatten is a Function', () => { test('deepFlatten is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {deepFreeze} = require('./_30s.js'); const {deepFreeze} = require('./_30s.js');
test('deepFreeze is a Function', () => { test('deepFreeze is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {deepGet} = require('./_30s.js'); const {deepGet} = require('./_30s.js');
let idx = 2 let idx = 2

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const { deepMapKeys, toCamelCase } = require('./_30s.js'); const { deepMapKeys, toCamelCase } = require('./_30s.js');
test('deepMapKeys is a Function', () => { test('deepMapKeys is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {defaults} = require('./_30s.js'); const {defaults} = require('./_30s.js');
test('defaults is a Function', () => { test('defaults is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {defer} = require('./_30s.js'); const {defer} = require('./_30s.js');
test('defer is a Function', () => { test('defer is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {degreesToRads} = require('./_30s.js'); const {degreesToRads} = require('./_30s.js');
// const approxeq = (v1,v2, diff = 0.001) => Math.abs(v1 - v2) < diff; // const approxeq = (v1,v2, diff = 0.001) => Math.abs(v1 - v2) < diff;

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {delay} = require('./_30s.js'); const {delay} = require('./_30s.js');
test('delay is a Function', () => { test('delay is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {detectDeviceType} = require('./_30s.js'); const {detectDeviceType} = require('./_30s.js');
test('detectDeviceType is a Function', () => { test('detectDeviceType is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {difference} = require('./_30s.js'); const {difference} = require('./_30s.js');
test('difference is a Function', () => { test('difference is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {differenceBy} = require('./_30s.js'); const {differenceBy} = require('./_30s.js');
test('differenceBy is a Function', () => { test('differenceBy is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {differenceWith} = require('./_30s.js'); const {differenceWith} = require('./_30s.js');
test('differenceWith is a Function', () => { test('differenceWith is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {dig} = require('./_30s.js'); const {dig} = require('./_30s.js');
const data = { const data = {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {digitize} = require('./_30s.js'); const {digitize} = require('./_30s.js');
test('digitize is a Function', () => { test('digitize is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {distance} = require('./_30s.js'); const {distance} = require('./_30s.js');
test('distance is a Function', () => { test('distance is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {drop} = require('./_30s.js'); const {drop} = require('./_30s.js');
test('drop is a Function', () => { test('drop is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {dropRight} = require('./_30s.js'); const {dropRight} = require('./_30s.js');
test('dropRight is a Function', () => { test('dropRight is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {dropRightWhile} = require('./_30s.js'); const {dropRightWhile} = require('./_30s.js');
test('dropRightWhile is a Function', () => { test('dropRightWhile is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {dropWhile} = require('./_30s.js'); const {dropWhile} = require('./_30s.js');
test('dropWhile is a Function', () => { test('dropWhile is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {elementContains} = require('./_30s.js'); const {elementContains} = require('./_30s.js');
test('elementContains is a Function', () => { test('elementContains is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {elementIsVisibleInViewport} = require('./_30s.js'); const {elementIsVisibleInViewport} = require('./_30s.js');
test('elementIsVisibleInViewport is a Function', () => { test('elementIsVisibleInViewport is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {elo} = require('./_30s.js'); const {elo} = require('./_30s.js');
test('elo is a Function', () => { test('elo is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {equals} = require('./_30s.js'); const {equals} = require('./_30s.js');
test('equals is a Function', () => { test('equals is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {escapeHTML} = require('./_30s.js'); const {escapeHTML} = require('./_30s.js');
test('escapeHTML is a Function', () => { test('escapeHTML is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {escapeRegExp} = require('./_30s.js'); const {escapeRegExp} = require('./_30s.js');
test('escapeRegExp is a Function', () => { test('escapeRegExp is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {everyNth} = require('./_30s.js'); const {everyNth} = require('./_30s.js');
test('everyNth is a Function', () => { test('everyNth is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {extendHex} = require('./_30s.js'); const {extendHex} = require('./_30s.js');
test('extendHex is a Function', () => { test('extendHex is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {factorial} = require('./_30s.js'); const {factorial} = require('./_30s.js');
test('factorial is a Function', () => { test('factorial is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {factors} = require('./_30s.js'); const {factors} = require('./_30s.js');
test('factors is a Function', () => { test('factors is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {fahrenheitToCelsius} = require('./_30s.js'); const {fahrenheitToCelsius} = require('./_30s.js');
test('fahrenheitToCelsius is a Function', () => { test('fahrenheitToCelsius is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {fibonacci} = require('./_30s.js'); const {fibonacci} = require('./_30s.js');
test('fibonacci is a Function', () => { test('fibonacci is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {fibonacciCountUntilNum} = require('./_30s.js'); const {fibonacciCountUntilNum} = require('./_30s.js');
test('fibonacciCountUntilNum is a Function', () => { test('fibonacciCountUntilNum is a Function', () => {

View File

@ -1,4 +1,3 @@
const expect = require('expect');
const {fibonacciUntilNum} = require('./_30s.js'); const {fibonacciUntilNum} = require('./_30s.js');
test('fibonacciUntilNum is a Function', () => { test('fibonacciUntilNum is a Function', () => {

Some files were not shown because too many files have changed in this diff Show More