diff --git a/.github/workflows/jest-testing.yml b/.github/workflows/jest-testing.yml index 0f6ee5c..293dcde 100644 --- a/.github/workflows/jest-testing.yml +++ b/.github/workflows/jest-testing.yml @@ -28,9 +28,6 @@ jobs: - name: Install dependencies run: yarn install - - name: Setup tests - run: yarn pretest - - name: Build & Run test suite run: | yarn test | tee ./coverage.txt && exit ${PIPESTATUS[0]} diff --git a/build/esbuild-build-tests.ts b/build/esbuild-build-tests.ts deleted file mode 100644 index d13c55a..0000000 --- a/build/esbuild-build-tests.ts +++ /dev/null @@ -1,63 +0,0 @@ -import esbuild from "esbuild"; -import path from "path"; -import * as fs from "fs"; -import { createDynamicTypes } from "./dynamic-types"; - -const typescriptEntries = []; -export const entries = [...typescriptEntries]; - -export const esBuildContext: esbuild.BuildOptions = { - entryPoints: entries, - bundle: true, - outdir: "dist", -}; - -async function main() { - try { - await buildForEnvironments(); - await buildIndex(); - } catch (err) { - console.error(err); - process.exit(1); - } -} - -async function buildForEnvironments() { - ensureDistDir(); - - await esbuild - .build({ - ...esBuildContext, - tsconfig: "tsconfig.tests.json", - platform: "node", - outdir: "dist/tests/mocks", - format: "cjs", - }) - .then(() => { - console.log("Node.js esbuild complete"); - }) - .catch((err) => { - console.error(err); - process.exit(1); - }); -} - -async function buildIndex() { - await esbuild.build({ - entryPoints: ["index.ts"], - bundle: true, - format: "cjs", - outfile: "dist/index.js", - }); - - console.log("Index build complete."); -} - -function ensureDistDir() { - const distPath = path.resolve(__dirname, "dist"); - if (!fs.existsSync(distPath)) { - fs.mkdirSync(distPath, { recursive: true }); - } -} - -createDynamicTypes().then(main).catch(console.error); diff --git a/package.json b/package.json index 8cd56d0..cb79d98 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,7 @@ "postinstall": "git submodule update --init --recursive", "build": "run-s clean build:types", "build:types": "tsx build/esbuild-build.ts && tsc --emitDeclarationOnly --declaration --outDir dist", - "build:tests": "tsx build/esbuild-build-tests.ts && tsc --emitDeclarationOnly --declaration --project tsconfig.tests.json", "postbuild": "rm -rf dist/src", - "pretest": "run-s clean build:tests", "test": "jest", "clean": "rm -rf dist" }, diff --git a/tsconfig.tests.json b/tsconfig.tests.json deleted file mode 100644 index 236be8d..0000000 --- a/tsconfig.tests.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ESNext", - "module": "commonjs", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true, - "baseUrl": ".", - "paths": {}, - "outDir": "./dist", - "declaration": true, - "resolveJsonModule": true - }, - "include": ["index.ts", "tests/**/*.ts"], - "exclude": ["node_modules", "build", "tests/**/*.test.ts", "tests/script-test.ts", "lib", "dist", "jest.config.ts"] -}