Skip to content

Commit

Permalink
internal: Start moving some type only tests out of jest
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed May 7, 2024
1 parent bfc5338 commit ae4ae50
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 19 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ jobs:
at: ~/
- run:
command: |
cd packages/endpoint
yarn run typecheck
yarn workspaces foreach -Ap --include @data-client/endpoint --include @data-client/rest run typecheck
unit_tests:
parameters:
Expand Down
4 changes: 3 additions & 1 deletion packages/rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@
"build": "run build:lib && run build:legacy:lib && run build:bundle",
"dev": "run build:lib -w",
"prepare": "run build:lib",
"prepack": "run prepare && run build:bundle && run build:legacy:lib"
"prepack": "run prepare && run build:bundle && run build:legacy:lib",
"tsc:ci": "yarn g:tsc --project tsconfig.test.json",
"typecheck": "run tsc:ci"
},
"author": "Nathaniel Tucker <me@ntucker.me> (https://github.com/ntucker)",
"funding": "https://github.com/sponsors/ntucker",
Expand Down
2 changes: 1 addition & 1 deletion packages/rest/src/__tests__/RestEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Entity, schema } from '@data-client/endpoint';
import { useController } from '@data-client/react';
import { useSuspense } from '@data-client/react';
import { CacheProvider } from '@data-client/react';
import { Article, CoolerArticle, CoolerArticleResource } from '__tests__/new';
import { CoolerArticle, CoolerArticleResource } from '__tests__/new';
import nock from 'nock';

import { makeRenderDataClient } from '../../../test';
Expand Down
2 changes: 1 addition & 1 deletion packages/rest/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"outDir": "lib",
"rootDir": "src",
},
"include": ["src"],
"include": ["src", "typescript-tests"],
"references": [
{ "path": "../../__tests__" },
{ "path": "../normalizr" },
Expand Down
15 changes: 15 additions & 0 deletions packages/rest/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"noEmit": true,
"emitDeclarationOnly": false,
"skipLibCheck": true,
"noImplicitAny": false,
"composite": false,
"rootDir": "../..",
"paths": {
"__tests__/*": ["__tests__/*"]
}
},
"include": ["typescript-tests"]
}
12 changes: 0 additions & 12 deletions packages/rest/tsconfig.typetest.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Entity, schema } from '@data-client/endpoint';
import { useController, useSuspense } from '@data-client/react';
import { User } from '__tests__/new';

import createResource from '../createResource';
import RestEndpoint, { GetEndpoint, MutateEndpoint } from '../RestEndpoint';
import createResource from '../src/createResource';
import RestEndpoint, { GetEndpoint, MutateEndpoint } from '../src/RestEndpoint';

it('RestEndpoint construct and extend with typed options', () => {
new RestEndpoint({
Expand Down

0 comments on commit ae4ae50

Please sign in to comment.