Skip to content

Commit 5bbb939

Browse files
committed
fix: or-sample type issue in example
1 parent 7f0bee1 commit 5bbb939

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

examples/tsconfig.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4+
"baseUrl": ".",
45
"paths": {
5-
"*": [
6-
"src/*",
7-
"stories/*",
8-
"typings/*"
9-
],
106
"or-sample": [
11-
"src/index.ts"
7+
"../src"
128
]
139
}
14-
}
10+
},
11+
"include": [
12+
"stories",
13+
"../src"
14+
],
15+
"exclude": [
16+
"node_modules"
17+
]
1518
}

tests/Sample.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import React from 'react'
33

44
import Sample from '../src'
55

6-
describe('src/index', () => {
7-
function renderBtnFactory(type?: 'warning' | 'primary') {
8-
const wrapper = mount(<Sample type={type}>test</Sample>)
9-
expect(wrapper.find('.or-btn').length).toBe(1)
10-
if (type) {
11-
expect(wrapper.find(`.or-btn-${type}`).length).toBe(1)
12-
}
6+
function renderBtnFactory(type?: 'warning' | 'primary') {
7+
const wrapper = mount(<Sample type={type}>test</Sample>)
8+
expect(wrapper.find('.or-btn').length).toBe(1)
9+
if (type) {
10+
expect(wrapper.find(`.or-btn-${type}`).length).toBe(1)
1311
}
12+
}
1413

14+
describe('src/index', () => {
1515
it('should render properly: no type', () => {
1616
renderBtnFactory()
1717
})

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"exclude": [
2424
"tests",
2525
"examples",
26-
"node_modules",
27-
"**/node_modules/*"
26+
"node_modules"
2827
]
2928
}

0 commit comments

Comments
 (0)