mirror of https://github.com/eleith/emailjs.git
test: enable transparent cjs bundle testing
This commit is contained in:
parent
92e4d7f1ef
commit
ce4683d8aa
|
@ -26,3 +26,6 @@ jobs:
|
|||
|
||||
- name: test
|
||||
run: yarn test
|
||||
|
||||
- name: test-cjs
|
||||
run: yarn test-cjs
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export default {
|
||||
files: ['test/*.ts'],
|
||||
extensions: ['ts'],
|
||||
require: ['ts-node/register'],
|
||||
require: ['./email.test.ts'],
|
||||
environmentVariables: {
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: '0',
|
||||
},
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
require('ts-node/register');
|
||||
if (process.title === 'cjs') {
|
||||
require('./rollup/email.cjs');
|
||||
require.cache[require.resolve('./email.ts')] =
|
||||
require.cache[require.resolve('./rollup/email.cjs')];
|
||||
console.log('Testing email.cjs...\n');
|
||||
}
|
|
@ -56,7 +56,8 @@
|
|||
"scripts": {
|
||||
"build": "rollup -c rollup.config.ts",
|
||||
"lint": "eslint *.ts \"+(smtp|test)/*.ts\"",
|
||||
"test": "ava --serial"
|
||||
"test": "ava --serial",
|
||||
"test-cjs": "npm run build && npm run test -- --node-arguments='--title=cjs'"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue