Skip to content

Commit 7efa89a

Browse files
committed
docs: use consistent assertion styles
1 parent c73c21d commit 7efa89a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+76
-76
lines changed

docs/en/api/createLocalVue.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ const wrapper = shallow(Foo, {
1919
localVue,
2020
mocks: { foo: true }
2121
})
22-
expect(wrapper.vm.foo).to.equal(true)
22+
expect(wrapper.vm.foo).toBe(true)
2323

2424
const freshWrapper = shallow(Foo)
25-
expect(freshWrapper.vm.foo).to.equal(false)
25+
expect(freshWrapper.vm.foo).toBe(false)
2626
```
2727

2828
- **See also:** [General Tips](../guides/general-tips.md)

docs/en/api/mount.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import Foo from './Foo.vue'
2727
describe('Foo', () => {
2828
it('renders a div', () => {
2929
const wrapper = mount(Foo)
30-
expect(wrapper.contains('div')).to.equal(true)
30+
expect(wrapper.contains('div')).toBe(true)
3131
})
3232
})
3333
```
@@ -45,7 +45,7 @@ describe('Foo', () => {
4545
color: 'red'
4646
}
4747
})
48-
expect(wrapper.hasProp('color', 'red')).to.equal(true)
48+
expect(wrapper.hasProp('color', 'red')).toBe(true)
4949
})
5050
})
5151
```
@@ -62,7 +62,7 @@ describe('Foo', () => {
6262
const wrapper = mount(Foo, {
6363
attachToDocument: true
6464
})
65-
expect(wrapper.contains('div')).to.equal(true)
65+
expect(wrapper.contains('div')).toBe(true)
6666
})
6767
})
6868
```
@@ -84,7 +84,7 @@ describe('Foo', () => {
8484
foo: '<div />'
8585
}
8686
})
87-
expect(wrapper.contains('div')).to.equal(true)
87+
expect(wrapper.contains('div')).toBe(true)
8888
})
8989
})
9090
```
@@ -104,7 +104,7 @@ describe('Foo', () => {
104104
$route
105105
}
106106
})
107-
expect(wrapper.vm.$route.path).to.equal($route.path)
107+
expect(wrapper.vm.$route.path).toBe($route.path)
108108
})
109109
})
110110
```
@@ -127,8 +127,8 @@ describe('Foo', () => {
127127
FooBar: Faz
128128
}
129129
})
130-
expect(wrapper.contains('.stubbed')).to.equal(true)
131-
expect(wrapper.contains(Bar)).to.equal(true)
130+
expect(wrapper.contains('.stubbed')).toBe(true)
131+
expect(wrapper.contains(Bar)).toBe(true)
132132
})
133133
})
134134
```

docs/en/api/options.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const wrapper = shallow(Component, {
5454
foo: '<div />'
5555
}
5656
})
57-
expect(wrapper.find('div')).to.equal(true)
57+
expect(wrapper.find('div')).toBe(true)
5858
```
5959

6060
### `stubs`
@@ -99,7 +99,7 @@ const wrapper = shallow(Component, {
9999
$route
100100
}
101101
})
102-
expect(wrapper.vm.$route.path).to.equal($route.path)
102+
expect(wrapper.vm.$route.path).toBe($route.path)
103103
```
104104

105105
### `localVue`
@@ -131,7 +131,7 @@ const wrapper = mount(Component, {
131131
localVue,
132132
router
133133
})
134-
expect(wrapper.vm.$route).to.be.an('object')
134+
expect(wrapper.vm.$route).toBeInstanceOf(Object)
135135
```
136136

137137
### `attachToDocument`

docs/en/api/selectors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ import { expect } from 'chai'
3939
import Foo from './Foo.vue'
4040

4141
const wrapper = shallow(Foo)
42-
expect(wrapper.is(Foo)).to.equal(true)
42+
expect(wrapper.is(Foo)).toBe(true)
4343
```

docs/en/api/shallow.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import Foo from './Foo.vue'
3939
describe('Foo', () => {
4040
it('renders a div', () => {
4141
const wrapper = shallow(Foo)
42-
expect(wrapper.contains('div')).to.equal(true)
42+
expect(wrapper.contains('div')).toBe(true)
4343
})
4444
})
4545
```
@@ -58,7 +58,7 @@ describe('Foo', () => {
5858
color: 'red'
5959
}
6060
})
61-
expect(wrapper.hasProp('color', 'red')).to.equal(true)
61+
expect(wrapper.hasProp('color', 'red')).toBe(true)
6262
})
6363
})
6464
```
@@ -75,7 +75,7 @@ describe('Foo', () => {
7575
const wrapper = shallow(Foo, {
7676
attachToDocument: true
7777
})
78-
expect(wrapper.contains('div')).to.equal(true)
78+
expect(wrapper.contains('div')).toBe(true)
7979
})
8080
})
8181
```
@@ -98,7 +98,7 @@ describe('Foo', () => {
9898
foo: '<div />'
9999
}
100100
})
101-
expect(wrapper.find('div')).to.equal(true)
101+
expect(wrapper.find('div')).toBe(true)
102102
})
103103
})
104104
```
@@ -118,7 +118,7 @@ describe('Foo', () => {
118118
$route
119119
}
120120
})
121-
expect(wrapper.vm.$route.path).to.equal($route.path)
121+
expect(wrapper.vm.$route.path).toBe($route.path)
122122
})
123123
})
124124
```

docs/en/api/wrapper-array/at.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import Foo from './Foo.vue'
1717
const wrapper = shallow(Foo)
1818
const divArray = wrapper.findAll('div')
1919
const secondDiv = divArray.at(1)
20-
expect(secondDiv.is('p')).to.equal(true)
20+
expect(secondDiv.is('p')).toBe(true)
2121
```

docs/en/api/wrapper-array/contains.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ import Bar from './Bar.vue'
1919

2020
const wrapper = shallow(Foo)
2121
const divArray = wrapper.findAll('div')
22-
expect(divArray.contains('p')).to.equal(true)
23-
expect(divArray.contains(Bar)).to.equal(true)
22+
expect(divArray.contains('p')).toBe(true)
23+
expect(divArray.contains(Bar)).toBe(true)
2424
```

docs/en/api/wrapper-array/hasAttribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import Foo from './Foo.vue'
1717

1818
const wrapper = mount(Foo)
1919
const divArray = wrapper.findAll('div')
20-
expect(divArray.hasAttribute('id', 'foo')).to.equal(true)
20+
expect(divArray.hasAttribute('id', 'foo')).toBe(true)
2121
```

docs/en/api/wrapper-array/hasClass.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ import Foo from './Foo.vue'
1616

1717
const wrapper = mount(Foo)
1818
const divArray = wrapper.findAll('div')
19-
expect(divArray.hasClass('bar')).to.equal(true)
19+
expect(divArray.hasClass('bar')).toBe(true)
2020
```

docs/en/api/wrapper-array/hasProp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ import Bar from './Bar.vue'
2020

2121
const wrapper = mount(Foo)
2222
const barArray = wrapper.findAll(Bar)
23-
expect(barArray.hasProp('bar', 10)).to.equal(true)
23+
expect(barArray.hasProp('bar', 10)).toBe(true)
2424
```

0 commit comments

Comments
 (0)