Public
Script
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import process from "node:process";
import test from "npm:tape";
const stream = test.createStream({ objectMode: true });
stream.on("data", function(row) {
console.log(JSON.stringify(row));
});
test("timing test", function(t) {
t.plan(2);
t.equal(typeof Date.now, "function");
var start = Date.now();
setTimeout(function() {
t.equal(Date.now() - start, 100);
}, 100);
});
export const testing = new Promise(resolve => {
stream.on("end", function(row) {
resolve("ok");
});
});
November 13, 2023