Skip to content

Commit 51ebc99

Browse files
authored
2.1.2 (#37)
* Removed root import error when installed as dependency * Fixed valid default true
1 parent 435debf commit 51ebc99

27 files changed

+136
-19716
lines changed

__tests__/suits/Area.test.tsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import React from 'react';
22
import { mount } from 'enzyme';
3-
import { Validator } from '@/Validator';
4-
import { ValidatorArea, ValidatorAreaProps } from '@/components/ValidatorArea';
5-
import ValidatorProvider, { ValidatorProviderProps } from '@/components/ValidatorProvider';
6-
import { ProviderScope } from '@/ProviderScope';
7-
import required from '@/rules/required';
3+
import {
4+
ValidatorArea,
5+
ValidatorAreaProps,
6+
Validator,
7+
ValidatorProvider,
8+
ValidatorProviderProps,
9+
ProviderScope,
10+
required
11+
} from '../../src';
812
import tick from '../common/tick';
913

1014
describe('test ValidatorProvider', () => {

__tests__/suits/Provider.test.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import React from 'react';
22
import { mount } from 'enzyme';
3-
import { Validator } from '@/Validator';
4-
import ValidatorProvider, { ValidatorProviderProps } from '@/components/ValidatorProvider';
5-
import { ValidatorArea } from '@/components/ValidatorArea';
3+
import {
4+
Validator,
5+
ValidatorProvider,
6+
ValidatorProviderProps,
7+
ValidatorArea
8+
} from '../../src';
69
import tick from '../common/tick';
710

811
describe('test ValidatorProvider', () => {

__tests__/suits/Validator.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { Rule } from '@/Rule';
2-
import { Validator } from '@/Validator';
1+
import { Validator, Rule } from '../../src';
32

43
describe('test validator', () => {
54
beforeEach(() => {

__tests__/suits/rules/activeUrl.test.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { Validator } from '@/Validator';
2-
import activeUrl from '@/rules/activeUrl';
1+
import {
2+
Validator,
3+
activeUrl
4+
} from '../../../src';
35
import fetchMock from 'jest-fetch-mock';
46

57
describe('test activeUrl rule', () => {

__tests__/suits/rules/checked.test.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { Validator } from '@/Validator';
2-
import checked from '@/rules/checked';
1+
import {
2+
Validator,
3+
checked
4+
} from '../../../src';
35

46
describe('test checked rule', (): void => {
57
beforeEach((): void => {

__tests__/suits/rules/max.test.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import React from 'react';
22
import { mount } from 'enzyme';
3-
import max from '@/rules/max';
4-
import { Validator } from '@/Validator';
5-
import { ValidatorArea, ValidatorAreaProps } from '@/components/ValidatorArea';
3+
import {
4+
Validator,
5+
ValidatorArea,
6+
ValidatorAreaProps,
7+
IncorrectArgumentTypeError,
8+
max
9+
} from '../../../src';
610
import tick from '../../common/tick';
7-
import { IncorrectArgumentTypeError } from '@/rules';
811

912
describe('test max rule', () => {
1013
beforeEach(() => {

__tests__/suits/rules/min.test.tsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import min from '@/rules/min';
2-
import { Validator } from '@/Validator';
3-
import { mount } from 'enzyme';
4-
import { ValidatorArea, ValidatorAreaProps } from '@/components/ValidatorArea';
51
import React from 'react';
2+
import { mount } from 'enzyme';
3+
import {
4+
min,
5+
Validator,
6+
ValidatorArea,
7+
IncorrectArgumentTypeError,
8+
ValidatorAreaProps
9+
} from '../../../src';
610
import tick from '../../common/tick';
7-
import { IncorrectArgumentTypeError } from '@/rules';
811

912
describe('test min rule', () => {
1013
beforeEach(() => {

__tests__/suits/rules/regex.test.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
import { Validator } from '@/Validator';
21
import { mount } from 'enzyme';
3-
import { ValidatorArea, ValidatorAreaProps } from '@/components/ValidatorArea';
42
import React from 'react';
5-
import regex from '@/rules/regex';
3+
import {
4+
Validator,
5+
ValidatorArea,
6+
ValidatorAreaProps,
7+
regex
8+
} from '../../../src';
69
import tick from '../../common/tick';
710

811
describe('test regex rule', () => {

__tests__/suits/rules/required.test.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import React from 'react';
22
import { mount } from 'enzyme';
3-
import required from '@/rules/required';
4-
import { ValidatorAreaProps, ValidatorArea } from '@/components/ValidatorArea';
5-
import { Validator } from '@/Validator';
3+
import {
4+
required,
5+
ValidatorAreaProps,
6+
ValidatorArea,
7+
Validator
8+
} from '../../../src';
69
import tick from '../../common/tick';
710

811
describe('test required rule', () => {

__tests__/suits/utils/dom.test.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { getValue, htmlCollectionToArray, isInputElement, isSelectElement } from '@/common/dom';
1+
import {
2+
getValue,
3+
htmlCollectionToArray,
4+
isInputElement,
5+
isSelectElement
6+
} from '../../../src/common/dom';
27

38
describe('dom helpers test', () => {
49
it('should convert HtmlCollection to array', () => {

jest.config.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"testRegex": "(/__tests__/suits/|(\\.|/)(test|spec))\\.[jt]sx?$",
3-
"setupFilesAfterEnv": ["./setupTests.ts"],
4-
"moduleNameMapper": {
5-
"@/(.*)": "<rootDir>/src/$1"
6-
}
3+
"setupFilesAfterEnv": ["./setupTests.ts"]
74
}

0 commit comments

Comments
 (0)