Skip to content

Commit 3bd2639

Browse files
authored
Merge pull request #56 from mihar-22/pr
chore: minor build tweaks and cleaning
2 parents da44d97 + bbb1237 commit 3bd2639

14 files changed

+30
-33
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ module.exports = {
1414
'simple-import-sort'
1515
],
1616
rules: {
17-
'max-len': ['warn', {'code': 100}]
17+
'max-len': ['warn', {'code': 100}],
18+
"simple-import-sort/sort": "error"
1819
},
1920
overrides: [
2021
{

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
],
3737
"scripts": {
3838
"toc": "doctoc README.md",
39-
"lint": "eslint src/**/*.js --fix",
39+
"lint": "eslint src --fix",
4040
"clean": "rimraf dist",
4141
"build": "npm run clean && babel src --out-dir dist --ignore '**/__tests__/**'",
42-
"test": "jest src/__tests__ ",
42+
"test": "jest src",
4343
"test:watch": "npm run test -- --watch",
4444
"test:update": "npm run test -- --updateSnapshot --coverage",
4545
"setup": "npm install && npm run validate",
@@ -125,8 +125,9 @@
125125
"^.+\\.svelte$": "jest-transform-svelte",
126126
"^.+\\.html$": "svelte-test/transform"
127127
},
128-
"transformIgnorePatterns": [
129-
"/node_modules/(?!svelte).+\\.js$"
128+
"moduleFileExtensions": [
129+
"js",
130+
"svelte"
130131
]
131132
}
132133
}

src/__tests__/act.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { render as stlRender, fireEvent, act } from '..'
2-
import Comp from './fixtures/Comp.svelte'
1+
import { act, fireEvent, render as stlRender } from '..'
2+
import Comp from './fixtures/Comp'
33

44
describe('act', () => {
55
let props

src/__tests__/auto-cleanup-skip.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Comp from './fixtures/Comp.svelte'
1+
import Comp from './fixtures/Comp'
22

33
describe('auto-cleanup-skip', () => {
44
let render

src/__tests__/auto-cleanup.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Comp from './fixtures/Comp.svelte'
21
import { render } from '..'
2+
import Comp from './fixtures/Comp'
33

44
describe('auto-cleanup', () => {
55
// This just verifies that by importing STL in an

src/__tests__/debug.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { render } from '..'
2-
import Comp from './fixtures/Comp.svelte'
31
import { prettyDOM } from '@testing-library/dom'
42

3+
import { render } from '..'
4+
import Comp from './fixtures/Comp'
5+
56
describe('debug', () => {
67
beforeEach(() => {
78
jest.spyOn(console, 'log').mockImplementation(() => {})

src/__tests__/events.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { fireEvent, render } from '..'
2-
import Comp from './fixtures/Comp.svelte'
2+
import Comp from './fixtures/Comp'
33

44
describe('events', () => {
55
test('state changes are flushed after firing an event', async () => {

src/__tests__/fixtures/Comp.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
}
99
</script>
1010

11-
<style>
12-
h1 {
13-
color: purple;
14-
}
15-
</style>
11+
<style></style>
1612

1713
<h1>Hello {name}!</h1>
1814

src/__tests__/fixtures/Stopwatch.svelte

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@
3232

3333
<style></style>
3434

35-
<div>
36-
<span>{lapse}ms</span>
37-
<button on:click={handleRunClick}>
38-
{running ? 'Stop' : 'Start'}
39-
</button>
40-
<button on:click={handleClearClick}>Clear</button>
41-
</div>
35+
<span>{lapse}ms</span>
4236

37+
<button on:click={handleRunClick}>
38+
{running ? 'Stop' : 'Start'}
39+
</button>
40+
41+
<button on:click={handleClearClick}>Clear</button>

src/__tests__/multi-base.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { render } from '..'
2-
import Comp from './fixtures/Comp.svelte'
2+
import Comp from './fixtures/Comp'
33

44
describe('multi-base', () => {
55
let treeA

src/__tests__/render.test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import {
2-
render as stlRender,
3-
act
2+
act,
3+
render as stlRender
44
} from '..'
5-
6-
import Comp from './fixtures/Comp.svelte'
5+
import Comp from './fixtures/Comp'
76
import CompDefault from './fixtures/Comp.html'
87

98
describe('render', () => {

src/__tests__/rerender.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { render } from '..'
2-
import Comp from './fixtures/Comp.svelte'
2+
import Comp from './fixtures/Comp'
33

44
describe('rerender', () => {
55
test('mounts new component successfully', () => {

src/__tests__/unmount.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { render, fireEvent, act } from '..'
2-
import Stopwatch from './fixtures/Stopwatch.svelte'
1+
import { act, fireEvent, render } from '..'
2+
import Stopwatch from './fixtures/Stopwatch'
33

44
describe('unmount', () => {
55
test('unmounts component successfully', async () => {

src/pure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getQueriesForElement, prettyDOM, fireEvent as dtlFireEvent } from '@testing-library/dom'
1+
import { fireEvent as dtlFireEvent, getQueriesForElement, prettyDOM } from '@testing-library/dom'
22
import { tick } from 'svelte'
33

44
const containerCache = new Map()

0 commit comments

Comments
 (0)