Skip to content

Commit

Permalink
Added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat committed May 21, 2022
1 parent 8943c76 commit 50a7b05
Show file tree
Hide file tree
Showing 16 changed files with 1,853 additions and 116 deletions.
6 changes: 6 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extension": ["ts"],
"spec": "test/**/*.test.ts",
"loader": "ts-node/esm"
}

32 changes: 0 additions & 32 deletions esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/

import esbuild from 'esbuild';
import path from 'path';
import { fileURLToPath } from 'url';

await esbuild.build({
entryPoints: ['./src/index.ts'],
Expand All @@ -43,33 +41,3 @@ await esbuild.build({
'.js': '.mjs',
},
});

await esbuild.build({
entryPoints: ['./test/esbuild.ts'],
outdir: 'test/build',
bundle: true,
minify: true,
format: 'cjs',
entryNames: '[name]',
platform: 'node',
define: {
__dirname: JSON.stringify(
path.join(path.dirname(fileURLToPath(import.meta.url)), 'test'),
),
},
plugins: [
{
name: 'test-remap',
setup(build) {
build.onResolve({ filter: /^.*$/ }, ({ path, kind }) =>
kind !== 'entry-point'
? {
path: path === '../src' ? '../../dist' : path,
external: true,
}
: undefined,
);
},
},
],
});
Loading

0 comments on commit 50a7b05

Please sign in to comment.