diff --git a/.eslintrc.js b/.eslintrc.js index 9163ebe..b8d1bef 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,7 +14,8 @@ module.exports = { 'simple-import-sort' ], rules: { - 'max-len': ['warn', {'code': 100}] + 'max-len': ['warn', {'code': 100}], + "simple-import-sort/sort": "error" }, overrides: [ { diff --git a/package.json b/package.json index ca1d80c..b168955 100644 --- a/package.json +++ b/package.json @@ -36,10 +36,10 @@ ], "scripts": { "toc": "doctoc README.md", - "lint": "eslint src/**/*.js --fix", + "lint": "eslint src --fix", "clean": "rimraf dist", "build": "npm run clean && babel src --out-dir dist --ignore '**/__tests__/**'", - "test": "jest src/__tests__ ", + "test": "jest src", "test:watch": "npm run test -- --watch", "test:update": "npm run test -- --updateSnapshot --coverage", "setup": "npm install && npm run validate", @@ -125,8 +125,9 @@ "^.+\\.svelte$": "jest-transform-svelte", "^.+\\.html$": "svelte-test/transform" }, - "transformIgnorePatterns": [ - "/node_modules/(?!svelte).+\\.js$" + "moduleFileExtensions": [ + "js", + "svelte" ] } } diff --git a/src/__tests__/act.test.js b/src/__tests__/act.test.js index 8547a2c..6ab7796 100644 --- a/src/__tests__/act.test.js +++ b/src/__tests__/act.test.js @@ -1,5 +1,5 @@ -import { render as stlRender, fireEvent, act } from '..' -import Comp from './fixtures/Comp.svelte' +import { act, fireEvent, render as stlRender } from '..' +import Comp from './fixtures/Comp' describe('act', () => { let props diff --git a/src/__tests__/auto-cleanup-skip.test.js b/src/__tests__/auto-cleanup-skip.test.js index 103a87c..df54d43 100644 --- a/src/__tests__/auto-cleanup-skip.test.js +++ b/src/__tests__/auto-cleanup-skip.test.js @@ -1,4 +1,4 @@ -import Comp from './fixtures/Comp.svelte' +import Comp from './fixtures/Comp' describe('auto-cleanup-skip', () => { let render diff --git a/src/__tests__/auto-cleanup.test.js b/src/__tests__/auto-cleanup.test.js index eaa4d4b..3ed6515 100644 --- a/src/__tests__/auto-cleanup.test.js +++ b/src/__tests__/auto-cleanup.test.js @@ -1,5 +1,5 @@ -import Comp from './fixtures/Comp.svelte' import { render } from '..' +import Comp from './fixtures/Comp' describe('auto-cleanup', () => { // This just verifies that by importing STL in an diff --git a/src/__tests__/debug.test.js b/src/__tests__/debug.test.js index 3d30f81..ca646bc 100644 --- a/src/__tests__/debug.test.js +++ b/src/__tests__/debug.test.js @@ -1,7 +1,8 @@ -import { render } from '..' -import Comp from './fixtures/Comp.svelte' import { prettyDOM } from '@testing-library/dom' +import { render } from '..' +import Comp from './fixtures/Comp' + describe('debug', () => { beforeEach(() => { jest.spyOn(console, 'log').mockImplementation(() => {}) diff --git a/src/__tests__/events.test.js b/src/__tests__/events.test.js index d373c6e..60d21c4 100644 --- a/src/__tests__/events.test.js +++ b/src/__tests__/events.test.js @@ -1,5 +1,5 @@ import { fireEvent, render } from '..' -import Comp from './fixtures/Comp.svelte' +import Comp from './fixtures/Comp' describe('events', () => { test('state changes are flushed after firing an event', async () => { diff --git a/src/__tests__/fixtures/Comp.html b/src/__tests__/fixtures/Comp.html index 26d920a..d6dc7f4 100644 --- a/src/__tests__/fixtures/Comp.html +++ b/src/__tests__/fixtures/Comp.html @@ -8,11 +8,7 @@ } - +