Skip to content

Commit

Permalink
test: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jan 16, 2025
1 parent 0c8dad1 commit d4c3e83
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "dependency",
"private": true,
"name": "@vitest/test-dep-conditions",
"type": "module",
"private": true,
"exports": {
".": {
"module": "./module.js",
"node": "./node.js",
"default": "./default.js"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from 'vitest';
import condition from './dependency';
import condition from '@vitest/test-dep-conditions';

test('condition is correct', () => {
expect(condition).toBe(TEST_CONDITION)
expect(condition).toBe('module')
})
1 change: 1 addition & 0 deletions test/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"test": "vitest --typecheck.enabled"
},
"devDependencies": {
"@vitest/test-dep-conditions": "file:./deps/test-dep-conditions",
"tinyexec": "^0.3.2",
"vite": "latest",
"vitest": "workspace:*"
Expand Down
9 changes: 0 additions & 9 deletions test/config/test/default-conditions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ test('correctly imports "module" dependency with default resolve.conditions', as
// dev condition is the default
const { stderr } = await runVitest({
root: 'fixtures/default-conditions',
server: {
deps: {
external: [/dependency/],
},
},
}, [], 'test', {
define: {
TEST_CONDITION: '"module"',
},
})

expect(stderr).toBe('')
Expand Down

0 comments on commit d4c3e83

Please sign in to comment.