Skip to content

Commit

Permalink
Merge pull request #114 from rodneylab/test__add_node_tests
Browse files Browse the repository at this point in the history
test: ☑️ add Node tests
  • Loading branch information
rodneylab authored Nov 30, 2024
2 parents a44e7f3 + b167acc commit 3d1593c
Show file tree
Hide file tree
Showing 14 changed files with 911 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test configuration

- [ ] cargo test run with all tests passing
- [ ] Deno tests run and passed
- [ ] Vitest test run with all tests passing

**Test Configuration**:

Expand Down
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ updates:
directory: /
schedule:
interval: weekly
- package-ecosystem: "npm"
# Look for `package.json` and `lock` files in the `root` directory
directory: "/"
schedule:
interval: "weekly"
35 changes: 35 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Node
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
permissions: read-all
jobs:
test:
name: Vite Tests
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
disable-telemetry: true
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
version: 8
- name: Install Node dependencies
run: pnpm install
- name: Check Format
run: pnpm run check:formatting
- uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 # stable
- name: Run tests
run: cargo install wasm-pack
- name: Build WASM
run: pnpm build
- name: Run unit tests
run: pnpm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules
/target
.DS_Store
rusty-tags.vi
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pkg/**
node_modules/**
pnpm-lock.yaml
lib/*
mod.ts
3 changes: 3 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/** @type {import("prettier").Config} */
export default {
};
13 changes: 11 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
"license": "BSD-3-Clause",
"exports": "./mod.ts",
"fmt": {
"exclude": [".github/"]
"exclude": [
".github/",
".prettierrc.mjs",
"pnpm-lock.yaml",
"node_modules/",
"test/"
]
},
"test": {
"exclude": ["test/"]
},
"tasks": {
"check": "deno fmt --check && deno lint && deno check **/*.ts",
"check": "deno fmt --check && deno lint && deno check mod.ts mod_test.ts",
"test": "deno test -A",
"wasmbuild:deno": "deno run -A jsr:@deno/[email protected] --project=parsedown",
"wasmbuild:node": "wasm-pack build --target nodejs --scope rodneylab",
Expand Down
9 changes: 8 additions & 1 deletion deno.lock

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

2 changes: 1 addition & 1 deletion lib/parsedown.generated.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// deno-fmt-ignore-file
/// <reference types="./parsedown.generated.d.ts" />

// source-hash: e4fde3bd5a122432349fb0aa28da0d1827c4d198
// source-hash: bc0127bb39f9a938a25cd8cb0b00b1dd6f14e9b2
let wasm;

const heap = new Array(128).fill(undefined);
Expand Down
Binary file modified lib/parsedown_bg.wasm
Binary file not shown.
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "root",
"collaborators": [
"Rodney Johnson <[email protected]>"
],
"description": "Markdown processing",
"version": "1.4.3",
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "https://github.com/rodneylab/parsedown"
},
"keywords": [],
"scripts": {
"build": "wasm-pack build --target nodejs --scope rodneylab",
"format": "prettier --write './**/*.ts'",
"check:formatting": "prettier --check './**/*.ts'",
"test": "vitest run",
"test:watch": "vitest"
},
"devDependencies": {
"@rodneylab/parsedown": "link:pkg",
"husky": "^9.1.7",
"prettier": "^3.3.3",
"vitest": "^2.1.5"
},
"type": "module"
}
Loading

0 comments on commit 3d1593c

Please sign in to comment.