Skip to content

Commit

Permalink
test: commonjs can be required
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Aug 29, 2024
1 parent ca70cf6 commit 07e9012
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/commonjs.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"use strict";

let AJQueryDefault = require("../");
let AJQueryExplicit = require("../ajquery.cjs");

if (!AJQueryDefault.$) {
throw new Error("did not export $ correctly");
}
if (!AJQueryDefault.$$) {
throw new Error("did not export $$ correctly");
}

if (AJQueryDefault.$ !== AJQueryExplicit.$) {
throw new Error("exported $s do not match");
}

if (AJQueryDefault.$$ !== AJQueryExplicit.$$) {
throw new Error("exported $$s do not match");
}

console.log(`\x1b[34mPASS\x1b[33m`);

0 comments on commit 07e9012

Please sign in to comment.