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]
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: install
|
||||
run: yarn
|
||||
- name: install
|
||||
run: yarn
|
||||
|
||||
- name: test
|
||||
run: yarn test
|
||||
- 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