diff --git a/.gitignore b/.gitignore index a78a71ba..fdbc06a8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ node_modules/ .DS_Store react-markdown.min.js yarn.lock -!/lib/complex-types.d.ts diff --git a/.remarkignore b/.remarkignore deleted file mode 100644 index ebb6519a..00000000 --- a/.remarkignore +++ /dev/null @@ -1 +0,0 @@ -/test/fixtures/ diff --git a/package.json b/package.json index c3f0d1d3..0a6786e1 100644 --- a/package.json +++ b/package.json @@ -121,8 +121,8 @@ "format": "remark . --frail --output --quiet && prettier . --log-level warn --write && xo --fix", "prepack": "npm run build && npm run format", "test": "npm run build && npm run format && npm run test-coverage", - "test-api": "node --conditions development --experimental-loader=./test/loader.js --no-warnings test/test.jsx", - "test-coverage": "c8 --100 --reporter lcov npm run test-api" + "test-api": "node --conditions development --experimental-loader=./script/load-jsx.js --no-warnings test.jsx", + "test-coverage": "c8 --100 --exclude script/ --reporter lcov npm run test-api" }, "prettier": { "bracketSpacing": false, @@ -182,7 +182,7 @@ }, { "files": [ - "test/**/*.jsx" + "**/*.jsx" ], "rules": { "no-unused-vars": "off" diff --git a/test/loader.js b/script/load-jsx.js similarity index 100% rename from test/loader.js rename to script/load-jsx.js diff --git a/test/test.jsx b/test.jsx similarity index 99% rename from test/test.jsx rename to test.jsx index 35580e9e..ae6bca61 100644 --- a/test/test.jsx +++ b/test.jsx @@ -1,7 +1,7 @@ /* @jsxRuntime automatic @jsxImportSource react */ /** * @typedef {import('hast').Root} Root - * @typedef {import('../index.js').ExtraProps} ExtraProps + * @typedef {import('./index.js').ExtraProps} ExtraProps */ import assert from 'node:assert/strict' @@ -11,11 +11,11 @@ import rehypeRaw from 'rehype-raw' import remarkGfm from 'remark-gfm' import remarkToc from 'remark-toc' import {visit} from 'unist-util-visit' -import Markdown from '../index.js' +import Markdown from './index.js' test('react-markdown', async function (t) { await t.test('should expose the public api', async function () { - assert.deepEqual(Object.keys(await import('../index.js')).sort(), [ + assert.deepEqual(Object.keys(await import('./index.js')).sort(), [ 'default', 'uriTransformer' ])