Skip to content

Commit cbebed7

Browse files
committed
chore: update tests
1 parent a54d74e commit cbebed7

File tree

4 files changed

+14
-31
lines changed

4 files changed

+14
-31
lines changed

test/fixture/app/nuxt.config.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
import { resolve } from 'path'
2-
import type { NuxtConfig } from '@nuxt/types'
3-
import { resolveConfig } from '../../../src/index'
1+
import { nuxtConfig } from '../../../src/index'
42

5-
export default <NuxtConfig>resolveConfig({
6-
name: 'myApp',
7-
rootDir: __dirname,
3+
export default nuxtConfig({
4+
name: 'MyApp',
85
extends: '../themes/red/nuxt.config',
9-
10-
components: [
11-
resolve(__dirname, 'components')
12-
]
6+
rootDir: __dirname
137
})

test/fixture/themes/base/nuxt.config.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
import { resolve } from 'path'
2-
import type { NuxtConfig } from '@nuxt/types'
3-
import { resolveConfig } from '../../../../src/index'
1+
import { nuxtConfig } from '../../../../src/index'
42

5-
export default <NuxtConfig>resolveConfig({
6-
name: 'baseTheme',
3+
export default nuxtConfig({
4+
name: 'BaseTheme',
75
rootDir: __dirname,
86
srcDir: __dirname,
97

10-
components: [
11-
{ path: resolve(__dirname, 'components'), global: true }
12-
],
13-
148
publicRuntimeConfig: {
159
color: 'blue'
1610
}
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
import { resolve } from 'path'
1+
import { nuxtConfig } from '../../../../src/index'
22

3-
export default {
4-
name: 'baseThemeEx',
5-
rootDir: __dirname,
3+
export default nuxtConfig({
4+
name: 'RedTheme',
65
extends: '../base/nuxt.config',
7-
8-
components: [
9-
resolve(__dirname, 'components')
10-
],
6+
rootDir: __dirname,
117

128
publicRuntimeConfig: {
139
color: 'red'
1410
}
15-
}
11+
})

test/index.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { resolve } from 'path'
2-
import { resolveConfig } from '../src'
1+
import { nuxtConfig } from '../src'
32
import config from './fixture/app/nuxt.config'
43

54
const scrub = (input) => {
@@ -24,7 +23,7 @@ const scrub = (input) => {
2423

2524
it('fails on config being a function', () => {
2625
const config = () => ({})
27-
expect(() => resolveConfig(config))
26+
expect(() => nuxtConfig(config))
2827
.toThrow('extending is not possible with nuxt config as a function')
2928
})
3029

0 commit comments

Comments
 (0)