Skip to content

Commit 6b3087a

Browse files
authored
chore: use self references in type tests (#11716)
1 parent 457d1c7 commit 6b3087a

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

packages/router/src/__typetests__/routeParamsTypes.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, test } from 'tstyche'
22

3-
import type { RouteParams, ParamType } from '../routeParamsTypes.js'
3+
import type { RouteParams, ParamType } from '@redwoodjs/router'
44

55
/**
66
* FAQ:
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"incremental": true,
5-
"declarationMap": false,
6-
"emitDeclarationOnly": false,
74
"types": []
85
},
96
"include": ["./"],
10-
"exclude": [],
11-
"references": [{ "path": "../../" }]
7+
"exclude": []
128
}

packages/router/src/__typetests__/useLocation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect, test } from 'tstyche'
22

3-
import { useLocation } from '../location.js'
3+
import { useLocation } from '@redwoodjs/router'
44

55
test('useLocation types', () => {
66
const location = useLocation()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"types": []
5+
},
6+
"exclude": []
7+
}

packages/storage/src/__typetests__/types.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { expect, test } from 'tstyche'
22

3-
import { createUploadsConfig, setupStorage } from 'src/index.js'
3+
import { createUploadsConfig, setupStorage } from '@redwoodjs/storage'
44

55
import { MemoryStorage } from '../adapters/MemoryStorage/MemoryStorage.js'
66
import { type UploadsConfig } from '../prismaExtension.js'
77

8-
// Use the createUplodsConfig helper here....
8+
// Use the createUploadsConfig helper here....
99
// otherwise the types won't be accurate
1010
const uploadsConfig = createUploadsConfig({
1111
dummy: {
@@ -25,7 +25,7 @@ const { saveFiles } = setupStorage({
2525

2626
// const prismaClient = new PrismaClient().$extends(storagePrismaExtension)
2727

28-
test('only configured models have savers', async () => {
28+
test('only configured models have savers', () => {
2929
expect(saveFiles).type.toHaveProperty('forDummy')
3030
expect(saveFiles).type.toHaveProperty('forDumbo')
3131

@@ -52,7 +52,7 @@ test('inline config for save files is OK!', () => {
5252
expect(saveFiles).type.not.toHaveProperty('forDumbo')
5353
})
5454

55-
test('UploadsConfig accepts all available models with their fields', async () => {
55+
test('UploadsConfig accepts all available models with their fields', () => {
5656
expect<UploadsConfig>().type.toHaveProperty('dummy')
5757
expect<UploadsConfig>().type.toHaveProperty('dumbo')
5858
expect<UploadsConfig>().type.toHaveProperty('book')

packages/web/src/__typetests__/tsconfig.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"incremental": true,
5-
"declarationMap": false,
6-
"emitDeclarationOnly": false,
7-
"sourceMap": true,
84
"types": []
95
},
106
"include": ["./"],

0 commit comments

Comments
 (0)