Skip to content

Commit

Permalink
test: test both alias
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jan 13, 2024
1 parent fc901dc commit 847aff5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions test/workspaces-browser/space_browser_inline/test/basic.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { expect, test } from 'vitest'

// @ts-expect-error test vite resolve.alias
import testAlias from 'test-alias-from'
// @ts-expect-error alias
import testAliasVite from 'test-alias-from-vite'

// @ts-expect-error alias
import testAliasVitest from 'test-alias-from-vitest'

test('window is defined', () => {
expect(typeof window).toBe('object')
})

test('alias from workspace inline config', () => {
expect(testAlias).toBe('hello')
expect(testAliasVite).toBe('hello')
expect(testAliasVitest).toBe('hello')
})
8 changes: 4 additions & 4 deletions test/workspaces-browser/vitest.workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export default defineWorkspace([
headless: true,
provider: process.env.PROVIDER || 'webdriverio',
},
alias: {
'test-alias-from-vitest': new URL('./space_browser_inline/test-alias-to.ts', import.meta.url).pathname,
},
},
resolve: {
alias: {
'test-alias-from': new URL(
'./space_browser_inline/test-alias-to.ts',
import.meta.url,
).pathname,
'test-alias-from-vite': new URL('./space_browser_inline/test-alias-to.ts', import.meta.url).pathname,
},
},
},
Expand Down

0 comments on commit 847aff5

Please sign in to comment.