Cameron Martin | 21ed4a2 | 2024-04-22 11:08:19 +0100 | [diff] [blame] | 1 | import test from "tape"; |
| 2 | import { IncludeTest as IncludeTestEs5 } from "./gen-nodejs/Include_types.js"; |
| 3 | import { IncludeTest as IncludeTestEs6 } from "./gen-nodejs-es6/Include_types.js"; |
| 4 | import { IncludeTest as IncludeTestEsm } from "./gen-nodejs-esm/Include_types.mjs"; |
| 5 | |
| 6 | function constructTest(classVariant) { |
| 7 | return function (t) { |
| 8 | const obj = new classVariant({ bools: { im_true: true, im_false: false } }); |
| 9 | |
| 10 | t.assert(obj.bools.im_true === true); |
| 11 | t.assert(obj.bools.im_false === false); |
| 12 | t.end(); |
| 13 | }; |
| 14 | } |
| 15 | |
| 16 | test("construct es5", constructTest(IncludeTestEs5)); |
| 17 | test("construct es6", constructTest(IncludeTestEs6)); |
| 18 | test("construct esm", constructTest(IncludeTestEsm)); |