Skip to content

Commit

Permalink
test: remove non-ESM browser test runner and dependency on webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
LiosK committed Jun 21, 2023
1 parent 5e25d35 commit ee41cc5
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 1,265 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v3.0.0 - unreleased

### Removed

- Non-ESM browser test runner

## v2.5.0 - 2023-06-21

### Added
Expand Down
1,255 changes: 1 addition & 1,254 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"crypto": false
},
"scripts": {
"build": "tsc && webpack ./test/*.mjs -o ./test/bundle --mode production",
"build": "tsc",
"doc": "typedoc ./src/index.ts --gitRevision \"v$npm_package_version\"",
"postbuild": "rm -f ./dist/cjs/*.d.cts",
"prebuild": "rm -rf ./dist ./test/bundle",
"prebuild": "rm -rf ./dist",
"predoc": "rm -rf ./docs",
"prepare": "npm run build && npm run doc && npm run test",
"test": "mocha"
Expand All @@ -53,8 +53,6 @@
"devDependencies": {
"mocha": "^10.2.0",
"typedoc": "^0.24.8",
"typescript": "^5.1.3",
"webpack": "^5.87.0",
"webpack-cli": "^5.0.1"
"typescript": "^5.1.3"
}
}
1 change: 0 additions & 1 deletion test/bundle/main.js

This file was deleted.

3 changes: 2 additions & 1 deletion test/generator.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { scru128, scru128String, Scru128Generator, Scru128Id } from "scru128";
import { Scru128Generator, Scru128Id } from "../dist/index.js";

const assert = (expression, message = "") => {
if (!expression) {
throw new Error("Assertion failed" + (message ? ": " + message : ""));
Expand Down
3 changes: 2 additions & 1 deletion test/identifier.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Scru128Generator, Scru128Id } from "scru128";
import { Scru128Generator, Scru128Id } from "../dist/index.js";

const assert = (expression, message = "") => {
if (!expression) {
throw new Error("Assertion failed" + (message ? ": " + message : ""));
Expand Down
6 changes: 4 additions & 2 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
mocha.setup("bdd");
mocha.checkLeaks();
</script>
<script src="./bundle/main.js"></script>
<script class="mocha-exec">
<script type="module" src="./generator.mjs"></script>
<script type="module" src="./identifier.mjs"></script>
<script type="module" src="./index.mjs"></script>
<script type="module" class="mocha-exec">
mocha.run();
</script>
</body>
Expand Down
8 changes: 7 additions & 1 deletion test/index.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { scru128, scru128String, Scru128Generator, Scru128Id } from "scru128";
import {
scru128,
scru128String,
Scru128Generator,
Scru128Id,
} from "../dist/index.js";

const assert = (expression, message = "") => {
if (!expression) {
throw new Error("Assertion failed" + (message ? ": " + message : ""));
Expand Down

0 comments on commit ee41cc5

Please sign in to comment.