Skip to content

Commit

Permalink
20999: Updated WASM test packages for security (#188)
Browse files Browse the repository at this point in the history
- Added additional local development setup
  • Loading branch information
lancegliser authored Jul 22, 2024
1 parent 83c708d commit 7e7786d
Show file tree
Hide file tree
Showing 7 changed files with 1,699 additions and 299 deletions.
1 change: 1 addition & 0 deletions test/wasm_test/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AMALGAM_WASM_DIR=../../.out/build
26 changes: 26 additions & 0 deletions test/wasm_test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*


# NPM
*.tgz

node_modules
lib
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store


# Scratch files
scratch/*
16 changes: 12 additions & 4 deletions test/wasm_test/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# Getting Started

Install dependencies
## Install dependencies

npm install
```bash
npm install
```

## Define environment variables

Define the environment variable `AMALGAM_WASM_DIR` to the directory where the following files exist:

- amalgam-st.wasm
- amalgam-st.cjs
- amalgam-st.data

Run tests
On your personal machine, you may find it easier to copy [.env.sample](./.env.sample) to `.env`.

## Run tests

npm run test
```bash
npm run test
```
6 changes: 2 additions & 4 deletions test/wasm_test/jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const config = {
// forceCoverageMatch: [],

// A path to a module which exports an async function that is triggered once before all test suites
// globalSetup: undefined,
globalSetup: "./jest/global.setup.js",

// A path to a module which exports an async function that is triggered once after all test suites
// globalTeardown: undefined,
Expand Down Expand Up @@ -154,9 +154,7 @@ const config = {
// testLocationInResults: false,

// The glob patterns Jest uses to detect test files
testMatch: [
"**/?(*.)+(spec|test).cjs?(x)"
],
testMatch: ["**/?(*.)+(spec|test).cjs?(x)"],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
Expand Down
5 changes: 5 additions & 0 deletions test/wasm_test/jest/global.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { config } from "dotenv";

export default async () => {
config();
};
Loading

0 comments on commit 7e7786d

Please sign in to comment.