Skip to content

Commit 1d2297d

Browse files
committed
Run the main test suite against the Babel plugin too
1 parent 1a0607d commit 1d2297d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/babel.test.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,14 @@ describe('htm/babel', () => {
151151
}).code
152152
).toBe(`h("div",{"$$$_h_[1]":"$$$_h_[2]"},["$$$_h_[3]"]);`);
153153
});
154+
155+
describe('main test suite', () => {
156+
// Run all of the main tests against the Babel plugin:
157+
const mod = require('fs').readFileSync(require('path').resolve(__dirname, 'index.test.mjs'), 'utf8').replace(/\\0/g, '\0');
158+
const { code } = transform(mod.replace(/^\s*import\s*.+?\s*from\s+(['"]).*?\1[\s;]*$/im, 'const htm = function(){};'), {
159+
babelrc: false,
160+
plugins: [htmBabelPlugin]
161+
});
162+
eval(code);
163+
});
154164
});

0 commit comments

Comments
 (0)