mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
694 B
26 lines
694 B
import { promisify } from 'util' |
|
import * as cp from 'child_process' |
|
|
|
const exec = promisify(cp.exec) |
|
|
|
export const tests = [] |
|
|
|
tests.push(async ({ path, eq }) => { |
|
const { stdout } = await exec(`node ${path} discovery`) |
|
return eq(stdout.trim(), 'verydisco') |
|
}) |
|
|
|
tests.push(async ({ path, eq }) => { |
|
const { stdout } = await exec(`node ${path} "kiss cool"`) |
|
return eq(stdout.trim(), "sski olco") |
|
}) |
|
|
|
tests.push(async ({ path, eq }) => { |
|
const { stdout } = await exec(`node ${path} kiss cool`) |
|
return eq(stdout.trim(), "sski") |
|
}) |
|
|
|
tests.push(async ({ path, eq }) => { |
|
const { stdout } = await exec(`node ${path} "Node is awesome"`) |
|
return eq(stdout.trim(), "deNo si omeawes") |
|
})
|
|
|