Skip to content

Commit 682a7e6

Browse files
author
Larry Botha
committed
test(jest.test.js): add module name mapping, move test files
1 parent f96f154 commit 682a7e6

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

test/config/jest.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ module.exports = {
77

88
moduleFileExtensions: ['js', 'svelte'],
99

10-
testMatch: ['<rootDir>/test/*.spec.js'],
10+
moduleNameMapper: {
11+
'^lib/(.*)': '<rootDir>/lib/$1',
12+
},
13+
14+
testMatch: ['<rootDir>/test/specs/**/*.spec.js'],
1115

1216
transform: {
1317
'^.+\\.svelte$': 'svelte-jester',

test/textarea.spec.js renamed to test/specs/components/textarea.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {render as renderTl, fireEvent, waitFor} from '@testing-library/svelte';
22

3-
import Form from '../lib/components/Form.svelte';
4-
import Textarea from '../lib/components/Textarea.svelte';
3+
import Form from 'lib/components/Form.svelte';
4+
import Textarea from 'lib/components/Textarea.svelte';
55

66
const defaultProps = {
77
initialValues: {

test/library.spec.js renamed to test/specs/library.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/* globals beforeEach, console, describe, expect, it, require, jest */
2-
const {createForm} = require('../lib');
32
const yup = require('yup');
43
const Chance = require('chance');
54

5+
const {createForm} = require('../../lib');
6+
67
const chance = new Chance();
78

89
function nonEmpty(array) {

0 commit comments

Comments
 (0)