mirror of https://github.com/eleith/emailjs.git
test: enable transparent cjs bundle testing
This commit is contained in:
parent
92e4d7f1ef
commit
ce4683d8aa
|
@ -11,18 +11,21 @@ jobs:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: node
|
- name: node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: install
|
- name: install
|
||||||
run: yarn
|
run: yarn
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
run: yarn test
|
run: yarn test
|
||||||
|
|
||||||
|
- name: test-cjs
|
||||||
|
run: yarn test-cjs
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
export default {
|
export default {
|
||||||
files: ['test/*.ts'],
|
files: ['test/*.ts'],
|
||||||
extensions: ['ts'],
|
extensions: ['ts'],
|
||||||
require: ['ts-node/register'],
|
require: ['./email.test.ts'],
|
||||||
environmentVariables: {
|
environmentVariables: {
|
||||||
NODE_TLS_REJECT_UNAUTHORIZED: '0',
|
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": {
|
"scripts": {
|
||||||
"build": "rollup -c rollup.config.ts",
|
"build": "rollup -c rollup.config.ts",
|
||||||
"lint": "eslint *.ts \"+(smtp|test)/*.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"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue