8000 fix(test): fix utils.spec.js tests · designemail/nativescript-vue@66dec97 · GitHub
[go: up one dir, main page]

Skip to content

Commit 66dec97

Browse files
committed
fix(test): fix utils.spec.js tests
1 parent 5ee5f96 commit 66dec97

File tree

6 files changed

+45
-20
lines changed

6 files changed

+45
-20
lines changed

tests/jest-setup.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,31 @@ jest.mock('@nativescript/core/utils/utils', () => {
1111
}
1212
}, {virtual: true})
1313

14-
jest.mock('@nativescript/core/ui/core/view', () => {
15-
return {
16-
View() {
17-
}
18-
}
19-
}, {virtual: true})
20-
jest.mock('@nativescript/core/ui/content-view', () => {
21-
return {
22-
ContentView() {
23-
}
24-
}
25-
}, {virtual: true})
26-
jest.mock('@nativescript/core/ui/layouts/layout-base', () => {
27-
return {
28-
LayoutBase() {
29-
}
30-
}< 8000 /div>
31-
}, {virtual: true})
14+
jest.mock(
15+
'@nativescript/core/ui/core/view',
16+
() => require('ns-ui-mocks/view'),
17+
{ virtual: true },
18+
)
19+
20+
jest.mock(
21+
'@nativescript/core/ui/content-view',
22+
() => require('ns-ui-mocks/contentview'),
23+
{ virtual: true }
24+
)
25+
26+
jest.mock(
27+
'@nativescript/core/ui/layouts/layout-base',
28+
() => require('ns-ui-mocks/layoutbase'),
29+
{ virtual: true }
30+
)
31+
3232
jest.mock('@nativescript/core/application', () => {
3333
return {
3434
Application() {
3535
}
3636
}
3737
}, {virtual: true})
38+
3839
jest.mock('@nativescript/core/ui/frame', () => {
3940
const getComponentByName = require('register').getComponentByName
4041
const Frame = getComponentByName('Frame')

tests/ns-ui-mocks/contentview.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const NSComponent = require('./base')
2+
3+
class ContentView extends NSComponent {
4+
}
5+
6+
module.exports = {
7+
ContentView
8+
}

tests/ns-ui-mocks/frame.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const NSComponent = require('./ns-ui-mocks/base')
1+
const NSComponent = require('./base')
22

33
const topmostFrame = () => {
44
this.navigatedTo = 'nowhere'

tests/ns-ui-mocks/layoutbase.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const NSComponent = require('./base')
2+
3+
class LayoutBase extends NSComponent {
4+
}
5+
6+
module.exports = {
7+
LayoutBase
8+
}

tests/ns-ui-mocks/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const NSComponent = require('./ns-ui-mocks/base')
1+
const NSComponent = require('./base')
22

33
class Page extends NSComponent {
44
}

tests/ns-ui-mocks/view.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const NSComponent = require('./base')
2+
3+
class View extends NSComponent {
4+
}
5+
6+
module.exports = {
7+
View
8+
}

0 commit comments

Comments
 (0)
0