diff --git a/package-lock.json b/package-lock.json index bd247fef..345f5004 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1603,9 +1603,9 @@ } }, "@testing-library/react": { - "version": "10.4.4", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-10.4.4.tgz", - "integrity": "sha512-SKDQ2jBdg9UQQYQragkvXOzNp4hnCdOvXyZ52rg+OXiiumVxkAutdvvRzBF4PrbvMQ27Z6gx0GVo2YQ1Mcip8g==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-10.4.5.tgz", + "integrity": "sha512-M5A0W4VphBiEm4vgnq7vHC+/e4Bp/3iIOAWap1FtIiA+Zom6BtXpY3RSTOqc8bZsCcu9gFBZ/lxaiMW6uJddWg==", "dev": true, "requires": { "@babel/runtime": "^7.10.3", @@ -1886,9 +1886,9 @@ "dev": true }, "@types/react": { - "version": "16.9.41", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.41.tgz", - "integrity": "sha512-6cFei7F7L4wwuM+IND/Q2cV1koQUvJ8iSV+Gwn0c3kvABZ691g7sp3hfEQHOUBJtccl1gPi+EyNjMIl9nGA0ug==", + "version": "16.9.42", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.42.tgz", + "integrity": "sha512-iGy6HwfVfotqJ+PfRZ4eqPHPP5NdPZgQlr0lTs8EfkODRBV9cYy8QMKcC9qPCe1JrESC1Im6SrCFR6tQgg74ag==", "dev": true, "requires": { "@types/prop-types": "*", @@ -3349,9 +3349,9 @@ } }, "csstype": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.10.tgz", - "integrity": "sha512-D34BqZU4cIlMCY93rZHbrq9pjTAQJ3U8S8rfBqjwHxkGPThWFjzZDQpgMJY0QViLxth6ZKYiwFBo14RdN44U/w==", + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.11.tgz", + "integrity": "sha512-l8YyEC9NBkSm783PFTvh0FmJy7s5pFKrDp49ZL7zBGX3fWkO+N4EEyan1qqp8cwPLDcD0OSdyY6hAMoxp34JFw==", "dev": true }, "damerau-levenshtein": { diff --git a/package.json b/package.json index 9834a82f..458f7197 100644 --- a/package.json +++ b/package.json @@ -45,10 +45,10 @@ "author": "Josep M Sobrepere", "module": "dist/react-rxjs.esm.js", "devDependencies": { - "@testing-library/react": "^10.4.4", + "@testing-library/react": "^10.4.5", "@testing-library/react-hooks": "^3.3.0", "@types/jest": "^26.0.4", - "@types/react": "^16.9.41", + "@types/react": "^16.9.42", "@types/react-dom": "^16.9.8", "bundlesize": "^0.18.0", "codecov": "^3.7.0", diff --git a/test/Subscribe.test.tsx b/src/Subscribe.test.tsx similarity index 97% rename from test/Subscribe.test.tsx rename to src/Subscribe.test.tsx index 718e9140..f8dfb45d 100644 --- a/test/Subscribe.test.tsx +++ b/src/Subscribe.test.tsx @@ -2,7 +2,7 @@ import React from "react" import { render } from "@testing-library/react" import { defer, Subject } from "rxjs" import { share, finalize } from "rxjs/operators" -import { Subscribe } from "../src" +import { Subscribe } from "./" const wait = (ms: number) => new Promise(res => setTimeout(res, ms)) diff --git a/src/Subscribe.tsx b/src/Subscribe.tsx index 09c9a833..6184f1f0 100644 --- a/src/Subscribe.tsx +++ b/src/Subscribe.tsx @@ -1,5 +1,5 @@ import React from "react" -import { useSubscribe } from "./" +import { useSubscribe } from "./useSubscribe" import { Observable } from "rxjs" /** diff --git a/test/connectFactoryObservable.test.tsx b/src/connectFactoryObservable.test.tsx similarity index 99% rename from test/connectFactoryObservable.test.tsx rename to src/connectFactoryObservable.test.tsx index 0ae4fe6c..f15c3263 100644 --- a/test/connectFactoryObservable.test.tsx +++ b/src/connectFactoryObservable.test.tsx @@ -1,5 +1,3 @@ -import { connectFactoryObservable } from "../src" -import { TestErrorBoundary } from "../test/TestErrorBoundary" import { from, of, @@ -20,6 +18,8 @@ import { screen, render, } from "@testing-library/react" +import { connectFactoryObservable } from "./" +import { TestErrorBoundary } from "./test-helpers/TestErrorBoundary" const wait = (ms: number) => new Promise(res => setTimeout(res, ms)) diff --git a/test/connectObservable.test.tsx b/src/connectObservable.test.tsx similarity index 98% rename from test/connectObservable.test.tsx rename to src/connectObservable.test.tsx index f78013c5..87ad0bc4 100644 --- a/test/connectObservable.test.tsx +++ b/src/connectObservable.test.tsx @@ -16,8 +16,8 @@ import { Observable, } from "rxjs" import { delay, scan, startWith, map, switchMap } from "rxjs/operators" -import { connectObservable, SUSPENSE } from "../src" -import { TestErrorBoundary } from "../test/TestErrorBoundary" +import { connectObservable, SUSPENSE } from "./" +import { TestErrorBoundary } from "./test-helpers/TestErrorBoundary" const wait = (ms: number) => new Promise(res => setTimeout(res, ms)) diff --git a/test/operators/share-latest.test.ts b/src/operators/share-latest.test.ts similarity index 98% rename from test/operators/share-latest.test.ts rename to src/operators/share-latest.test.ts index 249261c1..5154fdf3 100644 --- a/test/operators/share-latest.test.ts +++ b/src/operators/share-latest.test.ts @@ -1,6 +1,6 @@ -import { shareLatest } from "../../src" import { TestScheduler } from "rxjs/testing" import { from } from "rxjs" +import { shareLatest } from "../" const scheduler = () => new TestScheduler((actual, expected) => { diff --git a/test/operators/suspend.test.ts b/src/operators/suspend.test.ts similarity index 92% rename from test/operators/suspend.test.ts rename to src/operators/suspend.test.ts index ea2033e8..1f0567e1 100644 --- a/test/operators/suspend.test.ts +++ b/src/operators/suspend.test.ts @@ -1,5 +1,5 @@ import { TestScheduler } from "rxjs/testing" -import { suspend, SUSPENSE } from "../../src" +import { suspend, SUSPENSE } from "../" const scheduler = () => new TestScheduler((actual, expected) => { diff --git a/test/operators/suspended.test.ts b/src/operators/suspended.test.ts similarity index 91% rename from test/operators/suspended.test.ts rename to src/operators/suspended.test.ts index ae6b3342..8c5f7cdb 100644 --- a/test/operators/suspended.test.ts +++ b/src/operators/suspended.test.ts @@ -1,5 +1,5 @@ import { TestScheduler } from "rxjs/testing" -import { suspended, SUSPENSE } from "../../src" +import { suspended, SUSPENSE } from "../" const scheduler = () => new TestScheduler((actual, expected) => { diff --git a/test/operators/switchMapSuspended.test.ts b/src/operators/switchMapSuspended.test.ts similarity index 94% rename from test/operators/switchMapSuspended.test.ts rename to src/operators/switchMapSuspended.test.ts index 0ab3fd6f..812c1a12 100644 --- a/test/operators/switchMapSuspended.test.ts +++ b/src/operators/switchMapSuspended.test.ts @@ -1,5 +1,5 @@ import { TestScheduler } from "rxjs/testing" -import { switchMapSuspended, SUSPENSE } from "../../src" +import { switchMapSuspended, SUSPENSE } from "../" const scheduler = () => new TestScheduler((actual, expected) => { diff --git a/test/subjectFactory.test.ts b/src/subjectFactory.test.ts similarity index 98% rename from test/subjectFactory.test.ts rename to src/subjectFactory.test.ts index 838e3d7d..68343e5e 100644 --- a/test/subjectFactory.test.ts +++ b/src/subjectFactory.test.ts @@ -1,6 +1,6 @@ -import { subjectFactory } from "../src" import { scan } from "rxjs/operators" -import { EMPTY_VALUE } from "../src/internal/empty-value" +import { EMPTY_VALUE } from "./internal/empty-value" +import { subjectFactory } from "./" describe("createSubjectsFactory", () => { test("it releasess the subject when is no longer needed", () => { diff --git a/test/TestErrorBoundary.tsx b/src/test-helpers/TestErrorBoundary.tsx similarity index 100% rename from test/TestErrorBoundary.tsx rename to src/test-helpers/TestErrorBoundary.tsx diff --git a/test/useSubscribe.test.ts b/src/useSubscribe.test.ts similarity index 97% rename from test/useSubscribe.test.ts rename to src/useSubscribe.test.ts index 70b99c6e..39d7f9ee 100644 --- a/test/useSubscribe.test.ts +++ b/src/useSubscribe.test.ts @@ -1,7 +1,7 @@ import { defer, Subject } from "rxjs" import { share, finalize } from "rxjs/operators" -import { useSubscribe } from "../src" import { renderHook } from "@testing-library/react-hooks" +import { useSubscribe } from "./" const wait = (ms: number) => new Promise(res => setTimeout(res, ms)) diff --git a/tsconfig.json b/tsconfig.json index 99084d17..162a4190 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "importHelpers": true, "declaration": true, "sourceMap": true, - "rootDirs": ["./src", "./test"], + "rootDir": "./src", "strict": true, "noImplicitAny": true, "strictNullChecks": true, @@ -20,11 +20,15 @@ "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "moduleResolution": "node", - "baseUrl": "./", + "baseUrl": "./src", "paths": { "*": ["src/*", "node_modules/*"] }, "jsx": "react", "esModuleInterop": true - } + }, + "exclude": [ + "**/*.test.ts", + "./src/test-helpers" + ] }