aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/assertion-error/index.js
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-13 21:34:48 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-13 21:34:48 -0800
commit76cb9c2a39d477a64824a985ade40507e3bbade1 (patch)
tree41e997aa9c6f538d3a136af61dae9424db2005a9 /vanilla/node_modules/assertion-error/index.js
parent819a39a21ac992b1393244a4c283bbb125208c69 (diff)
downloadneko-76cb9c2a39d477a64824a985ade40507e3bbade1.tar.gz
neko-76cb9c2a39d477a64824a985ade40507e3bbade1.tar.bz2
neko-76cb9c2a39d477a64824a985ade40507e3bbade1.zip
feat(vanilla): add testing infrastructure and tests (NK-wjnczv)
Diffstat (limited to 'vanilla/node_modules/assertion-error/index.js')
-rw-r--r--vanilla/node_modules/assertion-error/index.js60
1 files changed, 60 insertions, 0 deletions
diff --git a/vanilla/node_modules/assertion-error/index.js b/vanilla/node_modules/assertion-error/index.js
new file mode 100644
index 0000000..2bfcb81
--- /dev/null
+++ b/vanilla/node_modules/assertion-error/index.js
@@ -0,0 +1,60 @@
+// deno-fmt-ignore-file
+// deno-lint-ignore-file
+// This code was bundled using `deno bundle` and it's not recommended to edit it manually
+
+const canElideFrames = "captureStackTrace" in Error;
+class AssertionError extends Error {
+ message;
+ get name() {
+ return "AssertionError";
+ }
+ get ok() {
+ return false;
+ }
+ constructor(message = "Unspecified AssertionError", props, ssf){
+ super(message);
+ this.message = message;
+ if (canElideFrames) {
+ Error.captureStackTrace(this, ssf || AssertionError);
+ }
+ for(const key in props){
+ if (!(key in this)) {
+ this[key] = props[key];
+ }
+ }
+ }
+ toJSON(stack) {
+ return {
+ ...this,
+ name: this.name,
+ message: this.message,
+ ok: false,
+ stack: stack !== false ? this.stack : undefined
+ };
+ }
+}
+class AssertionResult {
+ get name() {
+ return "AssertionResult";
+ }
+ get ok() {
+ return true;
+ }
+ constructor(props){
+ for(const key in props){
+ if (!(key in this)) {
+ this[key] = props[key];
+ }
+ }
+ }
+ toJSON() {
+ return {
+ ...this,
+ name: this.name,
+ ok: this.ok
+ };
+ }
+}
+export { AssertionError as AssertionError };
+export { AssertionResult as AssertionResult };
+