Skip to content

Commit

Permalink
Test the actual build output
Browse files Browse the repository at this point in the history
- This changes the test runner from Playwright to `node:test` and
  `snapshot-fixtures`.
- This publishes source maps
- This publishes declaration maps
  • Loading branch information
remcohaszing committed Apr 29, 2024
1 parent c1b06ff commit 4ef9cc8
Show file tree
Hide file tree
Showing 36 changed files with 173 additions and 180 deletions.
2 changes: 1 addition & 1 deletion .c8rc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"100": true,
"include": ["index.ts"],
"include": ["src/remark-mermaid.ts"],
"reporter": ["html", "lcov", "text"]
}
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
coverage/
dist/
node_modules/
test-results/
*.d.ts
*.js
*.log
*.tgz
5 changes: 1 addition & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
**/*-snapshots/*
coverage/
dist/
test-results/
fixtures/
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions test/fixtures/error/options.ts → fixtures/error/options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { type RemarkMermaidOptions } from 'remark-mermaidjs'

export const options: RemarkMermaidOptions = {
/** @type {import('remark-mermaidjs').RemarkMermaidOptions} */
export default {
errorFallback(node, error, vfile) {
return {
type: 'code',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions fixtures/errorEmpty/options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('remark-mermaidjs').RemarkMermaidOptions} */
export default {
// eslint-disable-next-line @typescript-eslint/no-empty-function
errorFallback() {}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions fixtures/forest/options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('remark-mermaidjs').RemarkMermaidOptions} */
export default {
mermaidConfig: {
theme: 'forest'
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
180 changes: 99 additions & 81 deletions package-lock.json

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

15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
"name": "remark-mermaidjs",
"version": "6.0.0",
"description": "A remark plugin to render mermaid diagrams",
"exports": "./index.js",
"exports": "./dist/remark-mermaidjs.js",
"main": "./dist/remark-mermaidjs.js",
"type": "module",
"files": [
"index.d.ts",
"index.js"
"dist",
"src",
"!*.test.*"
],
"scripts": {
"prepack": "tsc --noEmit false",
"test": "c8 playwright test"
"prepack": "tsc --build",
"pretest": "tsc --build",
"test": "c8 node --enable-source-maps ./dist/remark-mermaidjs.test.js"
},
"author": "Remco Haszing <[email protected]>",
"license": "MIT",
Expand All @@ -36,7 +39,6 @@
"vfile": "^6.0.0"
},
"devDependencies": {
"@playwright/test": "^1.0.0",
"@types/hast": "^3.0.0",
"c8": "^8.0.0",
"eslint": "^8.0.0",
Expand All @@ -47,6 +49,7 @@
"remark-cli": "^11.0.0",
"remark-preset-remcohaszing": "^2.0.0",
"remark-rehype": "^11.0.0",
"snapshot-fixtures": "^1.0.0",
"typescript": "^5.0.0"
}
}
8 changes: 0 additions & 8 deletions playwright.config.ts

This file was deleted.

Loading

0 comments on commit 4ef9cc8

Please sign in to comment.