Closed LuchoTurtle closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
e8a4856
) to head (1a3befc
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Keep getting this error, darn it.
Jest encountered an unexpected token
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
By default "node_modules" folder is ignored by transformers.
Here's what you can do:
• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
• If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/configuration
For information about custom transformations, see:
https://jestjs.io/docs/code-transformation
Details:
/Users/lucho/Documents/dwyl/nextra-demo/node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export { default as v1 } from './v1.js';
^^^^^^
SyntaxError: Unexpected token 'export'
9 |
10 | /**
> 11 | * This function checks external links that are present in the markdown files.
| ^
12 | * It checks if they're alive or dead using `markdown-lint-check`.
13 | */
14 | export function checkMarkdownExternalLinks(markdownBody) {
jest
really is config hell for ESM :(
Trying to debug
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From tests/unit/link-check.test.ts.
for ages now.
markdown-link-check
using async
messes up with Jest. The test effectively passes correctly (as it should) but Jest complains something is trying to be imported after the test is passed.
@nelsonic this should be ready for review 👌
closes #10
This PR adds a few new features:
.mdx
files and checks if they are alive. It additionally checks if themailto
e-mail addresses are valid and do exist. This package goes over the data content generated by https://github.com/contentlayerdev/contentlayer to find the links..mdx
files, applying linting according to default rules. These rules can be found at https://github.com/DavidAnson/markdownlint#rules--aliases. This script checks for the integrity of internal links, finding broken anchors between local documents (including sections).