Skip to content

Commit

Permalink
Move test dir out the src directory
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed May 21, 2023
1 parent e4121ae commit 003e985
Show file tree
Hide file tree
Showing 28 changed files with 69 additions and 72 deletions.
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"scripts": {
"build": "tsc && denoify",
"test": "yarn test:node && yarn test:deno",
"test:deno": "deno run --reload --unstable --no-check deno_dist/test/mod.ts",
"test:node": "node dist/test/",
"test:deno": "deno run --reload --unstable --no-check deno_dist/mod.ts",
"test:node": "ts-node test/index.ts",
"lint:check": "eslint . --ext .ts,.tsx",
"lint": "npm run lint:check -- --fix",
"_format": "prettier '**/*.{ts,tsx,json,md}'",
Expand All @@ -34,12 +34,8 @@
"license": "MIT",
"files": [
"src/",
"!src/test/",
"dist/",
"!dist/test/",
"!dist/tsconfig.tsbuildinfo",
"!dist/esm/test/",
"!dist/esm/tsconfig.tsbuildinfo"
"!dist/tsconfig.tsbuildinfo"
],
"keywords": [],
"homepage": "https://github.com/garronej/tsafe",
Expand All @@ -55,7 +51,8 @@
"improved-garbanzo-easy": "^0.0.1",
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"typescript": "^5.0.4"
"typescript": "^5.0.4",
"ts-node": "^10.9.1"
},
"main": "dist/index.js",
"types": "dist/index.d.ts"
Expand Down
8 changes: 4 additions & 4 deletions src/test/Equals.ts → test/Equals.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Equals } from "../Equals";
import { assert } from "../assert";
import type { Unite } from "../tools/Unite";
import type { StrictEquals } from "../tools/StrictEquals";
import type { Equals } from "../src/Equals";
import { assert } from "../src/assert";
import type { Unite } from "../src/tools/Unite";
import type { StrictEquals } from "../src/tools/StrictEquals";

type Shape = Circle | Square;

Expand Down
6 changes: 3 additions & 3 deletions src/test/Extends.ts → test/Extends.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Equals } from "../Equals";
import type { Extends } from "../Extends";
import { assert } from "../assert";
import type { Equals } from "../src/Equals";
import type { Extends } from "../src/Extends";
import { assert } from "../src/assert";

const emptyObj = {};

Expand Down
6 changes: 3 additions & 3 deletions src/test/MethodNames.ts → test/MethodNames.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { MethodNames } from "../MethodNames";
import { assert } from "../assert";
import type { Equals } from "../Equals";
import type { MethodNames } from "../src/MethodNames";
import { assert } from "../src/assert";
import type { Equals } from "../src/Equals";

{
type A = {
Expand Down
6 changes: 3 additions & 3 deletions src/test/Parameters.ts → test/Parameters.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import type { Parameters } from "../Parameters";
import { assert } from "../assert";
import type { Equals } from "../Equals";
import type { Parameters } from "../src/Parameters";
import { assert } from "../src/assert";
import type { Equals } from "../src/Equals";

{
const myFunction = (arg1: unknown, arg2: string, extraParams: { a: number; b: number }) => {
Expand Down
6 changes: 3 additions & 3 deletions src/test/Params0.ts → test/Params0.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import type { Param0 } from "../Param0";
import { assert } from "../assert";
import type { Equals } from "../Equals";
import type { Param0 } from "../src/Param0";
import { assert } from "../src/assert";
import type { Equals } from "../src/Equals";

//@ts-ignore
function test<T, U>() {
Expand Down
6 changes: 3 additions & 3 deletions src/test/PickOptionals.ts → test/PickOptionals.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import type { PickOptionals } from "../PickOptionals";
import { assert } from "../assert";
import type { Equals } from "../Equals";
import type { PickOptionals } from "../src/PickOptionals";
import { assert } from "../src/assert";
import type { Equals } from "../src/Equals";

{
type A = {
Expand Down
6 changes: 3 additions & 3 deletions src/test/PickRequired.ts → test/PickRequired.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { PickRequired } from "../PickRequired";
import { assert } from "../assert";
import type { Equals } from "../Equals";
import { PickRequired } from "../src/PickRequired";
import { assert } from "../src/assert";
import type { Equals } from "../src/Equals";

{
type A = {
Expand Down
6 changes: 3 additions & 3 deletions src/test/ReturnType.ts → test/ReturnType.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import type { ReturnType } from "../ReturnType";
import { assert } from "../assert";
import type { Equals } from "../Equals";
import type { ReturnType } from "../src/ReturnType";
import { assert } from "../src/assert";
import type { Equals } from "../src/Equals";

{
const getStringAsync: () => Promise<string> = null as any;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { UnionToIntersection } from "../UnionToIntersection";
import type { UnionToIntersection } from "../src/UnionToIntersection";
import type { Equals } from "..";
import { assert } from "../assert";
import { assert } from "../src/assert";

{
type A = { foo: string };
Expand Down
6 changes: 3 additions & 3 deletions src/test/UnpackPromise.ts → test/UnpackPromise.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import type { UnpackPromise } from "../UnpackPromise";
import { assert } from "../assert";
import type { Equals } from "../Equals";
import type { UnpackPromise } from "../src/UnpackPromise";
import { assert } from "../src/assert";
import type { Equals } from "../src/Equals";

//@ts-ignore
function test<T>() {
Expand Down
6 changes: 3 additions & 3 deletions src/test/UnpackTypeGuard.ts → test/UnpackTypeGuard.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { UnpackTypeGuard } from "../lab/UnpackTypeGuard";
import { assert } from "../assert";
import type { Equals } from "../Equals";
import type { UnpackTypeGuard } from "../src/lab/UnpackTypeGuard";
import { assert } from "../src/assert";
import type { Equals } from "../src/Equals";

{
const isFoo = (_o: any): _o is "foo" => {
Expand Down
6 changes: 3 additions & 3 deletions src/test/assertIs.ts → test/assertIs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import { assert } from "../assert";
import { is } from "../is";
import type { Equals } from "../Equals";
import { assert } from "../src/assert";
import { is } from "../src/is";
import type { Equals } from "../src/Equals";

{
const x: string | number | boolean = null as any;
Expand Down
4 changes: 2 additions & 2 deletions src/test/exclude.ts → test/exclude.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { exclude } from "../exclude";
import { assert } from "../assert";
import { exclude } from "../src/exclude";
import { assert } from "../src/assert";
import { same } from "evt/tools/inDepth/same";

{
Expand Down
6 changes: 3 additions & 3 deletions src/test/exclude.types.ts → test/exclude.types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { exclude } from "../exclude";
import { assert } from "../assert";
import type { Equals } from "../Equals";
import { exclude } from "../src/exclude";
import { assert } from "../src/assert";
import type { Equals } from "../src/Equals";

{
const x = (["a", "b", "c"] as const).filter(exclude(["a"]));
Expand Down
4 changes: 2 additions & 2 deletions src/test/flip.ts → test/flip.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { flip } from "../flip";
import { assert } from "../assert";
import { flip } from "../src/flip";
import { assert } from "../src/assert";

{
const obj = {
Expand Down
2 changes: 1 addition & 1 deletion src/test/flip.type.ts → test/flip.type.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { flip } from "../flip";
import { flip } from "../src/flip";

{
const obj = {
Expand Down
2 changes: 1 addition & 1 deletion src/test/getProjectRoot.ts → test/getProjectRoot.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { getProjectRoot } from "../tools/getProjectRoot";
import { getProjectRoot } from "../src/tools/getProjectRoot";

console.log(`Project root path: ${getProjectRoot()} does it seems right ? If yes then PASS`);
2 changes: 1 addition & 1 deletion src/test/id.ts → test/id.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { id } from "../id";
import { id } from "../src/id";

{
type Square = {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/test/isPromiseLike.ts → test/isPromiseLike.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { isPromiseLike } from "../isPromiseLike";
import { assert } from "../assert";
import { isPromiseLike } from "../src/isPromiseLike";
import { assert } from "../src/assert";

{
const x = new Promise<void>(resolve => setTimeout(() => resolve, 1000));
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Equals, ObjectEntries } from "..";
import { objectEntries } from "../objectEntries";
import { assert } from "../assert";
import { Reflect } from "../Reflect";
import { objectEntries } from "../src/objectEntries";
import { assert } from "../src/assert";
import { Reflect } from "../src/Reflect";

{
const input = Reflect<{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Equals, ObjectFromEntries } from "..";
import { objectFromEntries } from "../objectFromEntries";
import { assert } from "../assert";
import { id } from "../id";
import { objectFromEntries } from "../src/objectFromEntries";
import { assert } from "../src/assert";
import { id } from "../src/id";

{
const entries = [
Expand Down
4 changes: 2 additions & 2 deletions src/test/objectKeys.ts → test/objectKeys.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { objectKeys } from "../objectKeys";
import { assert } from "../assert";
import { objectKeys } from "../src/objectKeys";
import { assert } from "../src/assert";
import { same } from "evt/tools/inDepth/same";

{
Expand Down
6 changes: 3 additions & 3 deletions src/test/objectKeys.types.ts → test/objectKeys.types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { objectKeys } from "../objectKeys";
import { assert } from "../assert";
import type { Equals } from "../Equals";
import { objectKeys } from "../src/objectKeys";
import { assert } from "../src/assert";
import type { Equals } from "../src/Equals";

{
const obj = {
Expand Down
4 changes: 2 additions & 2 deletions src/test/withDefault.ts → test/withDefault.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { withDefaults } from "../lab/withDefaults";
import { withDefaults } from "../src/lab/withDefaults";
import { same } from "evt/tools/inDepth/same";
import { assert } from "../assert";
import { assert } from "../src/assert";

{
const f = (params: { foo: string; bar: number }): string => {
Expand Down
6 changes: 3 additions & 3 deletions src/test/withDefaults.types.ts → test/withDefaults.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-explicit-any */

import { assert } from "../assert";
import { withDefaults } from "../lab/withDefaults";
import type { Equals } from "../Equals";
import { assert } from "../src/assert";
import { withDefaults } from "../src/lab/withDefaults";
import type { Equals } from "../src/Equals";

const x: <T>() => T = null as any;

Expand Down

0 comments on commit 003e985

Please sign in to comment.