Skip to content

Commit

Permalink
test: add case for paths outside the project root
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Nov 12, 2024
1 parent 117f94d commit 81e5a85
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/__fixtures__/paths-outside-root/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"root": "./my-app"
}
3 changes: 3 additions & 0 deletions test/__fixtures__/paths-outside-root/my-app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { log } from '~utils/log'

log('Hello, world!')
5 changes: 5 additions & 0 deletions test/__fixtures__/paths-outside-root/my-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"private": true,
"name": "my-app",
"version": "0.0.0"
}
11 changes: 11 additions & 0 deletions test/__fixtures__/paths-outside-root/my-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"exclude": ["dist"],
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"skipLibCheck": true,
"paths": {
"~utils/*": ["../my-utils/*"]
}
}
}
1 change: 1 addition & 0 deletions test/__fixtures__/paths-outside-root/my-utils/log.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const log: (...args: any[]) => void = console.log.bind(console)
8 changes: 8 additions & 0 deletions test/__fixtures__/paths-outside-root/my-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"exclude": ["dist"],
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"skipLibCheck": true
}
}

0 comments on commit 81e5a85

Please sign in to comment.