Files
metabase/bin/test-cljs.js
Eric Normand 21e1ca15c6 Correct output for dashboard filter variables (#56619)
* Correct output for dashboard filter variables

* Whitespace

* Add node script for testing clojurescript

* Enhance format-unit and add parse-unit.

parse-unit is new.

format-unit now works with moment (cljs) or java.time (clj) values, not just strings and numbers. I also added two new
units (:day-of-week-abbrev and :month-of-year-full).

* Refactor to use time/parse-unit and time/format-unit
2025-04-15 14:42:20 -05:00

20 lines
563 B
JavaScript

#!node
const namespace = process.argv[2];
const fs = require("fs");
const debounce = require("lodash.debounce");
const { spawn } = require('child_process');
const debouncedHandler = debounce((event, filename) => {
console.log(`Change detected: ${event} - ${filename}`);
const child = spawn('node', namespace?['target/node-tests.js', "--test="+ namespace]:['target/node-tests.js'], { stdio: 'inherit' });
}, 300);
console.log("Watching target/node-tests.js");
fs.watch("target/node-tests.js", { recursive: true }, debouncedHandler);
debouncedHandler();