From 0ece3528751a0d254e637a61ff1c547d5af9fa28 Mon Sep 17 00:00:00 2001 From: Danny Banks Date: Tue, 24 Nov 2020 22:38:06 -0800 Subject: [PATCH 1/2] chore(tests): add eslint-jst and fix lint errors --- .eslintrc.json | 6 +- __tests__/common/transforms.test.js | 8 +- __tests__/formats/javascriptObject.test.js | 12 +- __tests__/formats/lessIcons.test.js | 7 +- __tests__/formats/lessVariables.test.js | 7 +- __tests__/formats/scssIcons.test.js | 11 +- __tests__/formats/scssMaps.test.js | 13 +- __tests__/formats/scssVariables.test.js | 11 +- __tests__/register/format.test.js | 20 +- __tests__/transform/propertySetup.test.js | 1 - __tests__/utils/combineJSON.test.js | 4 +- __tests__/utils/deepExtend.test.js | 4 +- lib/common/actions.js | 3 +- lib/common/formats.js | 4 +- lib/register/action.js | 1 - package-lock.json | 211 +++++++++++++++++++++ package.json | 4 +- 17 files changed, 259 insertions(+), 68 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 7717b8c37..f64250052 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,6 +2,7 @@ "parserOptions": { "ecmaVersion": 6 }, + "plugins": ["jest"], "env": { "node": true, "mocha": true, @@ -11,7 +12,10 @@ "Buffer": true, "escape": true }, - "extends": "eslint:recommended", + "extends": [ + "eslint:recommended", + "plugin:jest/recommended" + ], "rules": { "no-console": 0, "no-unused-vars": 1, diff --git a/__tests__/common/transforms.test.js b/__tests__/common/transforms.test.js index 691e2ef2f..9e45d9d01 100644 --- a/__tests__/common/transforms.test.js +++ b/__tests__/common/transforms.test.js @@ -281,15 +281,11 @@ describe('common', () => { expect(value).toBe("#aaaaaaff"); }); - it('should handle rgb colors', () => { + it('should handle rgba colors', () => { var value = transforms["color/hex8"].transformer({ - value: "rgb(170,170,170)" - }); - var value2 = transforms["color/hex8"].transformer({ value: "rgba(170,170,170,0.6)" }); - expect(value).toBe("#aaaaaaff"); - expect(value2).toBe("#aaaaaa99"); + expect(value).toBe("#aaaaaa99"); }); }); diff --git a/__tests__/formats/javascriptObject.test.js b/__tests__/formats/javascriptObject.test.js index dcb2683c0..56de41c3a 100644 --- a/__tests__/formats/javascriptObject.test.js +++ b/__tests__/formats/javascriptObject.test.js @@ -33,13 +33,11 @@ var formatter = formats['javascript/object'].bind(file); describe('formats', () => { describe('javascript/object', () => { - it('should be valid JS syntax', done => { - try { - vm.runInNewContext(formatter(dictionary, {}, file)) - return done(); - } catch (err) { - return done(new Error(err)); - } + it('should be valid JS syntax', () => { + const script = new vm.Script(formatter(dictionary, {}, file)); + const context = {}; + script.runInNewContext(context); + expect(context.foo.color.red.value).toEqual(dictionary.properties.color.red.value); }); }); diff --git a/__tests__/formats/lessIcons.test.js b/__tests__/formats/lessIcons.test.js index dfbcdf74d..03653d2af 100644 --- a/__tests__/formats/lessIcons.test.js +++ b/__tests__/formats/lessIcons.test.js @@ -48,14 +48,13 @@ var formatter = formats['less/icons'].bind(file); describe('formats', () => { describe('less/icons', () => { - it('should have a valid less syntax', done => { - less.render(formatter(dictionary, config, file)) + it('should have a valid less syntax', () => { + return less.render(formatter(dictionary, config, file)) .then(function(output) { expect(output).toBeDefined(); - done(); }) .catch(function(err) { - done(new Error(err)) + throw new Error(err); }); }); diff --git a/__tests__/formats/lessVariables.test.js b/__tests__/formats/lessVariables.test.js index 7a09203e5..24bc0234f 100644 --- a/__tests__/formats/lessVariables.test.js +++ b/__tests__/formats/lessVariables.test.js @@ -50,14 +50,13 @@ var formatter = formats['less/variables'].bind(file); describe('formats', () => { describe('less/variables', () => { - it('should have a valid less syntax', done => { - less.render(formatter(dictionary, {}, file)) + it('should have a valid less syntax', () => { + return less.render(formatter(dictionary, {}, file)) .then(function(output) { expect(output).toBeDefined(); - done(); }) .catch(function(err) { - done(new Error(err)) + throw new Error(err); }); }); diff --git a/__tests__/formats/scssIcons.test.js b/__tests__/formats/scssIcons.test.js index 466dc52b3..fec539a26 100644 --- a/__tests__/formats/scssIcons.test.js +++ b/__tests__/formats/scssIcons.test.js @@ -48,16 +48,11 @@ var formatter = formats['scss/icons'].bind(file); describe('formats', () => { describe('scss/icons', () => { - it('should have a valid scss syntax', done => { - scss.render({ + it('should have a valid scss syntax', () => { + const result = scss.renderSync({ data: formatter(dictionary, config, file), - }, function(err, result) { - if(err) { - return done(new Error(err)); - } - expect(result.css).toBeDefined(); - return done(); }); + expect(result.css).toBeDefined(); }); }); diff --git a/__tests__/formats/scssMaps.test.js b/__tests__/formats/scssMaps.test.js index b21e696e0..baadc9d22 100644 --- a/__tests__/formats/scssMaps.test.js +++ b/__tests__/formats/scssMaps.test.js @@ -207,7 +207,7 @@ var dictionary = { describe('formats', () => { _.each(['scss/map-flat', 'scss/map-deep'], function(key) { - describe(key, () => { + describe(`${key}`, () => { var file = { "destination": "__output/", @@ -229,16 +229,11 @@ describe('formats', () => { expect(typeof output).toBe('string'); }); - it('should have a valid scss syntax', done => { - scss.render({ + it('should have a valid scss syntax', () => { + const result = scss.renderSync({ data: output, - }, function(err, result) { - if(err) { - return done(new Error(err)); - } - expect(result.css).toBeDefined(); - return done(); }); + expect(result.css).toBeDefined(); }); it(key + ' snapshot', () => { diff --git a/__tests__/formats/scssVariables.test.js b/__tests__/formats/scssVariables.test.js index aebe27f5e..cb1215776 100644 --- a/__tests__/formats/scssVariables.test.js +++ b/__tests__/formats/scssVariables.test.js @@ -51,16 +51,11 @@ var formatter = formats['scss/variables'].bind(file); describe('formats', () => { describe('scss/variables', () => { - it('should have a valid scss syntax', done => { - scss.render({ + it('should have a valid scss syntax', () => { + const result = scss.renderSync({ data: formatter(dictionary, {}, file), - }, function(err, result) { - if(err) { - return done(new Error(err)); - } - expect(result.css).toBeDefined(); - return done(); }); + expect(result.css).toBeDefined(); }); it('should optionally use !default', () => { diff --git a/__tests__/register/format.test.js b/__tests__/register/format.test.js index 97acf8197..a6cebdbaf 100644 --- a/__tests__/register/format.test.js +++ b/__tests__/register/format.test.js @@ -18,68 +18,70 @@ describe('register', () => { describe('format', () => { it('should error if name is not a string', () => { + const errorMessage = `Can't register format; format.name must be a string` expect( StyleDictionaryExtended.registerFormat.bind(null, { formatter: function() {} }) - ).toThrow('Can\'t register format; format.name must be a string'); + ).toThrow(errorMessage); expect( StyleDictionaryExtended.registerFormat.bind(null, { name: 1, formatter: function() {} }) - ).toThrow('Can\'t register format; format.name must be a string'); + ).toThrow(errorMessage); expect( StyleDictionaryExtended.registerFormat.bind(null, { name: [], formatter: function() {} }) - ); + ).toThrow(errorMessage); expect( StyleDictionaryExtended.registerFormat.bind(null, { name: {}, formatter: function() {} }) - ).toThrow('Can\'t register format; format.name must be a string'); + ).toThrow(errorMessage); }); it('should error if format is not a function', () => { + const errorMessage = `Can't register format; format.formatter must be a function` expect( StyleDictionaryExtended.registerFormat.bind(null, { name: 'test' }) - ).toThrow('Can\'t register format; format.formatter must be a function'); + ).toThrow(errorMessage); expect( StyleDictionaryExtended.registerFormat.bind(null, { name: 'test', formatter: 1 }) - ).toThrow('Can\'t register format; format.formatter must be a function'); + ).toThrow(errorMessage); expect( StyleDictionaryExtended.registerFormat.bind(null, { name: 'test', formatter: 'name' }) - ).toThrow('Can\'t register format; format.formatter must be a function'); + ).toThrow(errorMessage); expect( StyleDictionaryExtended.registerFormat.bind(null, { name: 'test', formatter: [] }) - ).toThrow('Can\'t register format; format.formatter must be a function'); + ).toThrow(errorMessage); expect( StyleDictionaryExtended.registerFormat.bind(null, { name: 'test', formatter: {} }) - ).toThrow('Can\'t register format; format.formatter must be a function'); + ).toThrow(errorMessage); }); it('should work if name and format are good', () => { diff --git a/__tests__/transform/propertySetup.test.js b/__tests__/transform/propertySetup.test.js index aabc43abe..746a843f6 100644 --- a/__tests__/transform/propertySetup.test.js +++ b/__tests__/transform/propertySetup.test.js @@ -42,7 +42,6 @@ describe('transform', () => { ["color","base"] ); expect(typeof test).toBe('object'); - expect(test); expect(test).toHaveProperty('value'); expect(test).toHaveProperty('original'); expect(test).toHaveProperty('attributes'); diff --git a/__tests__/utils/combineJSON.test.js b/__tests__/utils/combineJSON.test.js index 57baabd26..44532b259 100644 --- a/__tests__/utils/combineJSON.test.js +++ b/__tests__/utils/combineJSON.test.js @@ -91,12 +91,12 @@ describe('utils', () => { const testOutput = { test: 'test' }; const parsers = [{ pattern: /.json$/, - parse: (content) => { + parse: () => { return { test: 'foo' } } },{ pattern: /.json$/, - parse: (content) => { + parse: () => { return testOutput } }]; diff --git a/__tests__/utils/deepExtend.test.js b/__tests__/utils/deepExtend.test.js index d2bde878e..16eb847d7 100644 --- a/__tests__/utils/deepExtend.test.js +++ b/__tests__/utils/deepExtend.test.js @@ -29,7 +29,7 @@ describe('utils', () => { expect(test2).toHaveProperty('foo', 'blah'); }); - it('should override nested properties', () => { + it('overrides nested properties', () => { var test = deepExtend([{foo: {foo:'bar'}}, {foo: {foo:'baz'}}]); expect(test).toHaveProperty('foo.foo', 'baz'); @@ -37,7 +37,7 @@ describe('utils', () => { expect(test2).toHaveProperty('foo.foo', 'blah'); }); - it('should override nested properties', () => { + it('properly merges nested properties', () => { var test = deepExtend([{foo: {bar:'bar'}}, {foo: {baz:'baz'}}]); expect(test).toHaveProperty('foo.baz', 'baz'); expect(test).toHaveProperty('foo.bar', 'bar'); diff --git a/lib/common/actions.js b/lib/common/actions.js index 15503eadf..a14741c92 100644 --- a/lib/common/actions.js +++ b/lib/common/actions.js @@ -12,8 +12,7 @@ */ var _ = require('lodash'), - fs = require('fs-extra'), - chalk = require('chalk'); + fs = require('fs-extra'); /** * @namespace Actions diff --git a/lib/common/formats.js b/lib/common/formats.js index d48bfb07b..dfd76d4bf 100644 --- a/lib/common/formats.js +++ b/lib/common/formats.js @@ -215,7 +215,7 @@ module.exports = { * $color-background-alt: #eeeeee !default; * ``` */ - 'scss/variables': function(dictionary, config, file) { + 'scss/variables': function(dictionary) { return fileHeader(this.options, 'short') + formattedVariables('sass', dictionary.allProperties); }, @@ -245,7 +245,7 @@ module.exports = { * \@color-background-alt: #eeeeee; * ``` */ - 'less/variables': function(dictionary, config, file) { + 'less/variables': function(dictionary) { return fileHeader(this.options, 'short') + formattedVariables('less', dictionary.allProperties); }, diff --git a/lib/register/action.js b/lib/register/action.js index 6ec7d9fe6..45c004813 100644 --- a/lib/register/action.js +++ b/lib/register/action.js @@ -10,7 +10,6 @@ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ -var chalk = require('chalk'); /** * Adds a custom action to the style property builder. Custom diff --git a/package-lock.json b/package-lock.json index bfae7de3b..c58cc1d76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2143,12 +2143,40 @@ "glob-to-regexp": "^0.3.0" } }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + } + } + }, "@nodelib/fs.stat": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", "dev": true }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -2257,6 +2285,12 @@ "@types/istanbul-lib-report": "*" } }, + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "dev": true + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -2314,6 +2348,144 @@ "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", "dev": true }, + "@typescript-eslint/experimental-utils": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.8.2.tgz", + "integrity": "sha512-hpTw6o6IhBZEsQsjuw/4RWmceRyESfAiEzAEnXHKG1X7S5DXFaZ4IO1JO7CW1aQ604leQBzjZmuMI9QBCAJX8Q==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/scope-manager": "4.8.2", + "@typescript-eslint/types": "4.8.2", + "@typescript-eslint/typescript-estree": "4.8.2", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + } + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.8.2.tgz", + "integrity": "sha512-qHQ8ODi7mMin4Sq2eh/6eu03uVzsf5TX+J43xRmiq8ujng7ViQSHNPLOHGw/Wr5dFEoxq/ubKhzClIIdQy5q3g==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.8.2", + "@typescript-eslint/visitor-keys": "4.8.2" + } + }, + "@typescript-eslint/types": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.8.2.tgz", + "integrity": "sha512-z1/AVcVF8ju5ObaHe2fOpZYEQrwHyZ7PTOlmjd3EoFeX9sv7UekQhfrCmgUO7PruLNfSHrJGQvrW3Q7xQ8EoAw==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.8.2.tgz", + "integrity": "sha512-HToGNwI6fekH0dOw3XEVESUm71Onfam0AKin6f26S2FtUmO7o3cLlWgrIaT1q3vjB3wCTdww3Dx2iGq5wtUOCg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.8.2", + "@typescript-eslint/visitor-keys": "4.8.2", + "debug": "^4.1.1", + "globby": "^11.0.1", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "fast-glob": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "globby": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", + "integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.8.2.tgz", + "integrity": "sha512-Vg+/SJTMZJEKKGHW7YC21QxgKJrSbxoYYd3MEUGtW7zuytHuEcksewq0DUmo4eh/CTNrVJGSdIY9AtRb6riWFw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.8.2", + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true + } + } + }, "JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", @@ -6363,6 +6535,15 @@ } } }, + "eslint-plugin-jest": { + "version": "24.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.1.3.tgz", + "integrity": "sha512-dNGGjzuEzCE3d5EPZQ/QGtmlMotqnYWD/QpCZ1UuZlrMAdhG5rldh0N0haCvhGnUkSeuORS5VNROwF9Hrgn3Lg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "^4.0.1" + } + }, "eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -6855,6 +7036,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fastq": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz", + "integrity": "sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "fb-watchman": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", @@ -12396,6 +12586,12 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -12417,6 +12613,12 @@ "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true }, + "run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", + "dev": true + }, "rxjs": { "version": "6.6.3", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", @@ -14558,6 +14760,15 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", diff --git a/package.json b/package.json index 1ee009f7b..c8b9cf8b4 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "test": "npm run test-types && npm run lint && jest --runInBand", "test-types": "tsd", "test-watch": "npm run test-types && npm run lint && jest --runInBand --watch", - "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha -- test/*.js test/**/*.js", "generate-docs": "node ./scripts/generateDocs.js", "serve-docs": "docsify serve docs -p 3000 -P 12345", "install-cli": "npm install -g $(npm pack)", @@ -122,6 +121,7 @@ "docsify": "^4.11.3", "docsify-cli": "^4.4.0", "eslint": "^6.8.0", + "eslint-plugin-jest": "^24.1.3", "husky": "^4.2.5", "istanbul": "^0.4.5", "jest": "^25.4.0", @@ -135,4 +135,4 @@ "tsd": "^0.11.0", "yaml": "^1.10.0" } -} \ No newline at end of file +} From 641f4b469924928472ffa597065f76eaaa533211 Mon Sep 17 00:00:00 2001 From: Danny Banks Date: Mon, 30 Nov 2020 11:22:45 -0800 Subject: [PATCH 2/2] chore: removing valid title eslint rule --- .eslintrc.json | 3 ++- __tests__/formats/scssMaps.test.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index f64250052..edc9d0dc0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -20,6 +20,7 @@ "no-console": 0, "no-unused-vars": 1, "comma-dangle": 0, - "no-prototype-builtins": 0 + "no-prototype-builtins": 0, + "jest/valid-title": 0 } } diff --git a/__tests__/formats/scssMaps.test.js b/__tests__/formats/scssMaps.test.js index baadc9d22..eb004df47 100644 --- a/__tests__/formats/scssMaps.test.js +++ b/__tests__/formats/scssMaps.test.js @@ -207,7 +207,7 @@ var dictionary = { describe('formats', () => { _.each(['scss/map-flat', 'scss/map-deep'], function(key) { - describe(`${key}`, () => { + describe(key, () => { var file = { "destination": "__output/",