forked from plaid/deprecated-async-problem
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest
executable file
·66 lines (57 loc) · 1.45 KB
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env bash
node_modules/.bin/babel await.js >await.compiled.js
passed="\033[0;32mpassed\033[0m\n"
failed="\033[0;31mfailed\033[0m\n"
test() {
local actual
local expected
printf "Testing \033[0;36m%s\033[0m...\n" "$1"
printf %s "- correct directory name... "
expected="$(printf "FOO\nBAR\nBAZ\n")"
if ! actual="$(node --harmony "$1" input)" ; then
printf "$failed"
elif [[ "$actual" == "$expected" ]] ; then
printf "$passed"
else
printf "$failed"
fi
printf %s "- incorrect directory name... "
expected="^Error: ENOENT[,:] .* 'XXX/index.txt'$"
if actual="$(node --harmony "$1" XXX 2>&1 1>/dev/null)" ; then
printf "$failed"
elif [[ $? != 1 ]] ; then
printf "$failed"
elif [[ "$actual" =~ $expected ]] ; then
printf "$passed"
else
printf "$failed"
fi
printf %s "- inaccurate index... "
rm -f -- input/baz.txt
expected="^Error: ENOENT[,:] .* 'input/baz.txt'$"
if actual="$(node --harmony "$1" input 2>&1 1>/dev/null)" ; then
printf "$failed"
elif [[ $? != 1 ]] ; then
printf "$failed"
elif [[ "$actual" =~ $expected ]] ; then
printf "$passed"
else
printf "$failed"
fi
git checkout -- input/baz.txt
echo
}
test synchronous.js
test callbacks.js
test async.js
test async-seq.js
test kgo.js
test righto.js
test promises.js
test promises-ramda.js
test most.js
test coroutines-co.js
test coroutines-bluebird.js
test await.compiled.js
test tasks.js
test lazy-either.js