test: commonjs can be required
This commit is contained in:
parent
cef7e822eb
commit
b47f4eeb31
|
@ -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`);
|
Loading…
Reference in New Issue