Skip to content

Commit

Permalink
[dev] add ESM support test (currently failing)
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed May 8, 2024
1 parent 31c6c3b commit 0e1be7b
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 22 deletions.
100 changes: 79 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"docs": "virmator docs",
"format": "prettier --color --cache --cache-strategy content \"./**/*.+(cjs|css|graphql|html|js|json|jsx|less|md|mjs|scss|toml|ts|tsx|yaml|yml)\"",
"publish": "virmator publish \"npm run compile && npm run test:all\"",
"test": "mocha --colors --config 'configs/mocha.config.cjs'",
"test": "test-as-package mocha --colors --config 'configs/mocha.config.cjs'",
"test:all": "concurrently --colors --kill-others-on-fail -c auto --names types,tests,spelling,format,docs,deps \"npm run test:types\" \"npm run test\" \"npm run test:spelling\" \"npm run test:format\" \"npm run test:docs\" \"npm run test:deps\"",
"test:deps": "virmator deps check",
"test:docs": "virmator docs check",
Expand All @@ -42,6 +42,7 @@
"pdfjs-dist": "4.2.67"
},
"devDependencies": {
"@augment-vir/node-js": "^28.0.0",
"@electrovir/nyc": "^15.1.0-fix0",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@types/chai": "^4.3.16",
Expand All @@ -64,6 +65,7 @@
"prettier-plugin-packagejson": "^2.5.0",
"prettier-plugin-sort-json": "^4.0.0",
"prettier-plugin-toml": "^2.0.1",
"test-as-package": "^1.0.0",
"tsx": "^4.9.3",
"type-fest": "^4.18.2",
"typedoc": "^0.25.13",
Expand Down
10 changes: 10 additions & 0 deletions src/esm-support.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {runShellCommand} from '@augment-vir/node-js';

describe('test as esm package', () => {
it('runs', async () => {
await runShellCommand(
`node --experimental-default-type=module -e "console.log(await import('pdf-text-reader'))"`,
{rejectOnError: true},
);
});
});

0 comments on commit 0e1be7b

Please sign in to comment.