Skip to content

Commit f6e60d0

Browse files
committed
(refactor): move tests to test/, test-utils/ to test/config/
- have been putting tests separately from source nowadays in other of my libraries, so standardize around that - put fixtures just in test/ (later could be in test/fixtures/), leave config/ solely for test config type things
1 parent 25ff907 commit f6e60d0

7 files changed

+7
-7
lines changed

jest.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
module.exports = {
22
moduleNameMapper: {
33
// allow importing of Jest as an ES Module (https://github.com/facebook/jest/pull/7571#issuecomment-498634094)
4-
'^jest$': '<rootDir>/test-utils/jest-export.js'
4+
'^jest$': '<rootDir>/test/config/jest-export.js'
55
},
66
setupFilesAfterEnv: [
77
// configure enzyme w/ react adapter
8-
'<rootDir>/test-utils/configure-enzyme.js',
8+
'<rootDir>/test/config/configure-enzyme.js',
99
// polyfill window.resizeTo
10-
'<rootDir>/test-utils/window-resizeTo.js'
10+
'<rootDir>/test/config/window-resizeTo.js'
1111
],
1212
transform: {
1313
// use babel-jest@23 for babel@6 support (https://github.com/facebook/jest/issues/8230#issuecomment-479470547)
1414
'\\.js$': require.resolve('babel-jest')
1515
},
1616
coveragePathIgnorePatterns: [
1717
'/node_modules/', // default
18-
'<rootDir>/test-utils/' // ignore test-utils
18+
'<rootDir>/test/' // ignore any test helper files
1919
]
2020
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "A React wrapper component around signature_pad. Unopinionated and heavily updated fork of react-signature-pad",
55
"main": "build/index.js",
66
"files": [
7-
"src/index.js",
7+
"src/",
88
"build/"
99
],
1010
"author": "Anton Gilgur",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/index.spec.js renamed to test/index.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import jest, { describe, it, test, expect } from 'jest'
22
import { mount } from 'enzyme'
33
import React from 'react'
44

5-
import SignatureCanvas from './index.js'
6-
import { propsF, dotF } from '../test-utils/fixtures.js'
5+
import SignatureCanvas from '../src/index.js'
6+
import { propsF, dotF } from './fixtures.js'
77

88
test('mounts canvas and instance properly', () => {
99
const wrapper = mount(<SignatureCanvas />)

0 commit comments

Comments
 (0)