fx/test.sh

10 lines
370 B
Bash
Raw Normal View History

2018-01-25 17:30:05 +00:00
#!/usr/bin/env bash
set -euxo pipefail
2018-01-25 17:35:55 +00:00
readonly fx='node index.js'
echo '[{"greeting": "hello world"}]' | $fx
echo '{"key": "value"}' | $fx "x => x.key"
echo '[1, 2, 3, 4, 5]' | $fx "this.map(x => x * this.length)"
echo '[1, 2, 3, 4, 5]' | $fx "for (let i of this) if (i % 2 == 0) yield i"
echo '{"items": ["foo", "bar"]}' | $fx "this.items" "yield* this; yield 'baz'"