-
Notifications
You must be signed in to change notification settings - Fork 8
/
suman-todos.txt
executable file
·3483 lines (2188 loc) · 115 KB
/
suman-todos.txt
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
three profiles:
1. [email protected] on safari "Olegzandr"
2. via facebook login on chrome
3. [email protected] on firefox "Olegzandr Denman"
4. Opera/Brave - Rakim via google login - alexmillsprojects
==========================================
use lstat instead of stat to look for test files
using stat instead of lstat might result in circular deps etc.
==========================================
run only one "it" test case
https://github.com/mochajs/mocha/issues/3409#issuecomment-395331888
suman --test="foo" --it="foo"
suman --find / --match / --grep is what we are looking for here...
===========================================
with this in mind: /test/src/dev/node/x.test.js
https://github.com/mochajs/mocha/issues/3250
beforeEachBlock
afterEachBlock
===========================================
There is an easier way to get a property from a json string. Using a package.json file as an example, try this:
#!/usr/bin/env bash
str=`cat package.json`;
my_val="$(node -pe "JSON.parse(\`$str\`)['version']")"
or
#!/usr/bin/env bash
prop="version"
my_val="$(node -pe "require('./package.json')['$prop']")"
===========================================
TODO: t.state = 'passed'/'failed' etc.
===========================================
run(function(b, context, before, after, beforeEach, afterEach))
===========================================
use procure instead of source, or load, or locate, gather
===========================================
add env vars to @config.json - execArgs or nodeFlags could be env vars
===========================================
//TODO: place array of tests in befores/afters so we know which tests pertain to the hook
===========================================
=> SUMAN_PROJECT_ROOT should be able to be set by the user.
===========================================
use nyc instead of istanbul
https://github.com/istanbuljs/nyc
===========================================
put $deps/$core on suman?
const {async} = suman.deps;
const {async} = suman.installed
===========================================
put
"const suman = require('suman');"
in each test file
===========================================
TAP YAML diagnostics:
https://github.com/tapjs/node-tap/issues/247
===========================================
var Messages = require('tap-emitter/lib/messages');
var messages = new Messages('13', 0);
console.log([
messages.version(),
messages.test({
ok: false,
testNumber: 1,
description: 'this is the message'
}),
messages.yaml(someError),
messages.plan(1),
messages.diagnostic('failed 1 of 1 tests'),
messages.diagnostic('time=19.221ms')
].join('\n'));
===========================================
exec() / invoke() / run() / register()
===========================================
"suman-watch-plugins": "latest",
===========================================
if not a .js file, we need to capture stdout/stderr in suman runner, and put it in the
.suman/runs folder
===========================================
it.cb.run(t => {
});
or
it.cb(t => {
});
===========================================
need to merge options object
before.cb.define(v =>
v.timeout(300)
.run(h => {
debugger;
console.log('this is before');
}));
===========================================
use ts-node/register
with TypeScript, just like Babel, in the run-child.js file
===========================================
inject hooks => add to $inject
shared => b.set() / b.get()
ioc => b.ioc
.source('a','b','c');
h.$inject should be h.?
===========================================
if (sumanOpts.coverage) {
//TODO: we can pass an env to tell suman where to put the coverage data
_suman.log.warning(chalk.yellow('coverage option was set to true, but we are running your tests via @run.sh.'));
_suman.log.warning(chalk.yellow('so in this case, you will need to run your coverage call via @run.sh.'));
}
===========================================
https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -eo pipefail
exit with command to the right that exits with non-zero
===========================================
suman --script x --tack-on="--require=ts-node/register"
===========================================
todo: ignore all .js files in project for purposes of version control
===========================================
load suman.globals.js after running require('suman');
or suman.init(module)?
===========================================
@config.json files need to have a property that
tells suman if all matching files are run through @transform.sh once,
or if each file is run through @transform.sh separately.
===========================================
command line --series, needs to take precedence over this:
const Test = suman.init(module, {}, {
series: false
});
===========================================
allow for default reporter:
reporters: {
default: 'std-reporter', =========================================== <<<<<<<<<<<<<<
map: {
'tap': 'suman-reporters/modules/tap-reporter'
}
},
===========================================
suman watch, suman-refine, suman-shell
need to pass env vars so that we get the right reporter at top level and child levels
===========================================
suman tests should work without having to run suman --init
see new option: use-default-config
===========================================
what is "return" for, in bash scripts? ("return" as opposed to "exit").
===========================================
use puppeteer to launch chrome instead of chrome-launcher
https://developers.google.com/web/updates/2017/04/headless-chrome
https://github.com/mochajs/mocha/pull/3152
===========================================
https://unix.stackexchange.com/questions/407222/find-location-of-shell-bash-function-on-disk
type npmlinkup
# Turn on extended shell debugging
shopt -s extdebug
# Dump the function's name, line number and fully qualified source file
declare -F foo
# Turn off extended shell debugging
shopt -u extdebug
===========================================
mocha context issue:
https://github.com/mochajs/mocha/issues/2014
===========================================
enable retries
retriesEnabled: false, in suman.conf.js
===========================================
default _suman.sumanOpts values?
we might need some for suman-reporters/lib/utils.ts
===========================================
this should only work for tests, not for hooks?
export const autoPass = function (t: IHookOrTestCaseParam) {
// add t.skip() type functionality // t.ignore().
_suman.log.warning(`test with description ${t.desc} has automatically passed.`);
if (t.callbackMode) {
t.done();
}
};
===========================================
[suman child stdout] => [suman child stdout / the-file-path]
===========================================
need to implement `suman --require x`
--require ts-node/register
mocha --require ts-node/register --reporter=dot test/**/*-test.ts --timeout=10000
===========================================
suman-types
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19817#issuecomment-342028894
===========================================
implement --debug-tests-and-hooks along with --debug-hooks
===========================================
suman --init should not install suman
at the end of the --init, suman should check to see if suman is in package.json or node_modules
it should recommend something like:
using the global suman version is totally acceptable
otherwise to install locally, use `npm install -D suman`
===========================================
skip and only do not work creates - Test.create(['bat', 'suit', {only: true},
===========================================
if function parameter name is in $ioc, but is listed explicity, then we should throw to let the user know.
e.g. describe('x', function(runMyQuestionsPage){});
when runMyQuestionsPage is on $ioc, instead of available.
===========================================
perhaps only --force should allow us to do optimistic ignoring of missing injectable deps.
===========================================/
const opts = {
$inject:{
ioc:[''],
iocStatic: ['']
}
};
===========================================/
use $ioc like this:
describe('hiya', ['age', b => {
console.log(b.ioc.age); // 3;
}]);
===========================================
node core will backport NODE_OPTIONS =>
https://github.com/nodejs/help/issues/925
https://github.com/nodejs/node/pull/16263
===========================================
better npm publish routine
https://github.com/sindresorhus/np
===========================================
debugging with chrome + chrome-launcher
https://bugs.chromium.org/p/chromium/issues/detail?id=778781#c3
===========================================
create suman-watch functionality that watches primary code-base and all symlinked directories in node_modules!
===========================================
if no test cases found, suman should exit with 1 not 0!!
probably operator error if no test cases found
===========================================
Suman watch - if watchPer has an item with --watch in it, then you have to throw err
===========================================
context('is good', b => {
b.$inject => should be what we get from $inject block stuff
b.set('good', true);
it('is good');
});
===========================================
chrome.debugger.attach({
tabId: tabId
}, '1.1', () => {
if (chrome.runtime.lastError) {
// oh no!
}
// we are good
});
===========================================
need to implement suman --browser --watch
===========================================
call suman.run() could put suman in "export mode"
otherwise, if you are not in "export mode", when you require a file,
it will just run from start to finish
===========================================
in the browser we can use
suman.browser.ioc.static.ts
suman.browser.ioc.ts
these file paths
===========================================
@AlexanderMills you can also enable inspector by
calling process._debugProcess(pid) from another Node.js instance. – Eugene 39 mins ago
===========================================
use $inject like so:
const {Test} = suman.init(module, {
$inject: ['a', 'b', 'c']
});
Test.create(function($inject){
const {a,b,c} = $inject;
});
===========================================
https://github.com/avajs/karma-ava
https://developers.soundcloud.com/blog/writing-your-own-karma-adapter
===========================================
https://code.google.com/archive/p/js-test-driver/
===========================================
suman --browser --watch
using watch will re-run tests on changes
===========================================
global_npm_modules_path="$(npm root -g)";
this npm command is slow, and I am looking to speed up this script.
One thing I could do is "cache" the result of the npm command, something like this:
export global_npm_modules_path=${global_npm_modules_path:-"$(npm root -g)"}
but my question is - how can I set global_npm_modules_path so that it's held in store by the parent shell / parent process?
@AlexanderMills, look at how programs like ssh-agent do it -- they instruct the user to eval "$(ssh-agent -s)".
If there were a prettier way to do things (that didn't break the security model), it would be in use in common/standard UNIX tools with comparable needs. – Charles Duffy 3 mins ago
@CharlesDuffy thanks what does that eval command accomplish though? How is it different than just running ssh-agent directly? – Alexander Mills 1 min ago edit
1 upvote
@AlexanderMills, the eval command tells the shell to run the output from ssh-agent as a series of shell commands.
Thus, it enables ssh-agent to modify the environment of the shell that calls it. – Charles Duffy 18 secs ago
===========================================
describe('nested1', opts, () => {}); ---> this makes an error (see 1.test.js)
[suman] ⚑ Suman fatal error => making a graceful exit =>
[suman] TypeError: arr.slice is not a function
[suman] at Object.exports.parseArgs (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/helpers/parse-pragmatik-args.js:20:29)
[suman] at /Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/test-suite-methods/make-describe.js:45:45
[suman] at /Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/dev/node/1.test.js:27:3
===========================================
https://www.jetbrains.com/help/webstorm/keyboard-shortcuts-you-cannot-miss.html
===========================================
suman --default => should run default tests given by config
===========================================
suman --watch --per instead of suman --watch-per
===========================================
create ctrl-c or ctrl-f icons
<kbd>Ctrl</kbd>-<kbd>C</kbd>
===========================================
FORCE_COLOR=0 suman -- => will use colors for watch, etc.
===========================================
use es6 symbols to hide properties?
https://www.keithcirkel.co.uk/metaprogramming-in-es6-symbols/
===========================================
@ORESoftware It depends on the version of node the running process uses.
If it's node 8, then you should be able to `kill -USR2 ${pidOfTheNodeProcess}` to enable the
--inspect behavior after the fact.
===========================================
suman-watch should be optionalDep?
suman-interactive should be optionalDep?
===========================================
"screenshots of suman in action"
===========================================
https://oresoftware.gitbooks.io/sumanjs/content/
https://github.com/GitbookIO/gitbook
https://wordpress.com/me => oresoftware / pqiw...
===========================================
cd $(dirname "$0")
[ ! -d "node_modules/babel-runtime" ] && npm install babel-runtime
[ ! -d "node_modules/babel-core" ] && npm install babel-core
[ ! -d "node_modules/babel-plugin-transform-runtime" ] && npm install babel-plugin-transform-runtime
[ ! -d "node_modules/babel-preset-es2015" ] && npm install babel-preset-es2015
[ ! -d "node_modules/babel-preset-es2016" ] && npm install babel-preset-es2016
[ ! -d "node_modules/babel-polyfill" ] && npm install babel-polyfill
[ ! -d "node_modules/babel-preset-stage-0" ] && npm install babel-preset-stage-0
[ ! -d "node_modules/babel-preset-stage-1" ] && npm install babel-preset-stage-1
[ ! -d "node_modules/babel-preset-stage-2" ] && npm install babel-preset-stage-2
[ ! -d "node_modules/babel-preset-stage-3" ] && npm install babel-preset-stage-3
===========================================
=> give user choice as to use bash or zsh or whatever for suman watch
===========================================
suman --scripts abc
=> should run the script that's in suman.conf.js
===========================================
use an env variable to tell suman to use suman-daemon / suman-fast
===========================================
the following should be in yellow or magenta:
(note that your test ran with suman-f, not suman)
===========================================
specify node start command with env var:
SUMAN_NODE_EXEC="node --foo --bar"
which would become:
bash -e "node --foo -bar ../suman/cli.js"
===========================================
babel:
removed these from {package.json}.devDependencies:
"babel-loader": "^6.4.1",
"babel-polyfill": "^6.23.0",
"babel-preset-latest": "^6.24.0",
===========================================
after always may not be run in the right order
async.eachSeries(allDescribeBlocks, function (block: ITestSuite, cb: Function) {
===========================================
=> chai 4.0.2 works.
===========================================
[suman]
[suman] ⚑ Suman fatal error => making a graceful exit =>
[suman] => Fatal error in hook => (to continue even in the event of an error in a hook use option {fatal:false}) =>
[suman] RangeError: Invalid array length
[suman] at Object.exports.padWithXSpaces (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman-utils/lib/index.js:185:12)
[suman] at EventEmitter.<anonymous> (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman-reporters/modules/std-reporter/index.js:70:30)
[suman] at TestBlock.startSuite (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/test-suite-helpers/make-start-suite.js:20:16)
[suman] at TestBlock.startSuite (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/test-suite-helpers/make-test-suite.js:140:31)
[suman] at runSuite (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/exec-suite.js:233:27)
[suman] at /Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/exec-suite.js:244:29
===========================================
_suman.whichSuman => needs to get fixed
===========================================
we should be able to create a test file with suman --create
and run the file, without running suman --init on a directory, see unnecessary error:
=> Suman could *not* locate your <suman-helpers-dir>; perhaps you need to update your suman.conf.js file, please see: ***
=> http://sumanjs.org/conf.html
=> We expected to find your <suman-helpers-dir> here =>
/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman-types/suman
=> If there is NO SUMAN HELPERS DIR, flip a boolean, and just use all the default files.
// >>>>> or just run the test with node instead of suman?
===========================================
=> describe.only / context.only does not work
Test.create('hotels2', {parallel: false}, function (it, before, beforeEach, describe) {
it.cb('second', t => {
setTimeout(t, 100);
});
describe.only('innner', function () {
it.cb('third', t => {
setTimeout(t, 100);
});
});
describe('outer', function () {
it.cb('fourth', t => {
setTimeout(t, 100);
});
});
});
===========================================
⚑ Suman fatal error => making a graceful exit =>
TypeError: context.skip is not a function
at TestSuiteBase.<anonymous> (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/simple.js:24:11)
at Domain.<anonymous> (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/exec-suite.js:184:24)
at startWholeShebang (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/exec-suite.js:135:15)
===========================================
[3] ✘ => test fail "get collection info based off duplicate users"
Error: no success property on body => { status: 500,
at /Users/alexamil/WebstormProjects/cisco/cdt-now/scripts/find-duplicate-users/js/get-cookies-with-selenium.js:80:16
_____________________________________________________________________
=> if error message is multi-line, it gets removed...for example when we call "'no success property on body => ' + util.inspect(x) "
===========================================
https://stackoverflow.com/a/1221870/5020949
There is an internal Bash variable called $PIPESTATUS;
it’s an array that holds the exit status of each command in your last foreground pipeline of commands.
<command> | tee out.txt ; test ${PIPESTATUS[0]} -eq 0
Or another alternative which also works with other shells (like zsh) would be to enable pipefail:
set -o pipefail
...
The first option does not work with zsh due to a little bit different syntax.
===========================================
∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆
===========================================
--bisect, to find which tests cause problems
http://make.bettermistak.es/2016/03/05/rspecs-bisect/
===========================================
node test/src/exp.js | grep -v [[suman]]
===========================================
h.set('x', y);
t.set('x', y):
???
===========================================
before hooks can be stubbed? => before('merry');
===========================================
fatal error in hook does not have cause or reason (the first line!):
⚑ Suman fatal error => making a graceful exit =>
Error: => fatal error in hook => (to continue even in the event of an error in a hook, use option {fatal:false}) =>
at TestSuite.h (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/test/src/exp.js:14:20)
at Domain.runHandleEachHook (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/test-suite-helpers/make-handle-each.js:151:66)
at /Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/test-suite-helpers/make-handle-each.js:75:15
at Domain.handleError (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/test-suite-helpers/make-handle-each.js:61:27)
===========================================
=> put Patreon link in all repos except main Suman repo
===========================================
use git submodules to publish suman-types
https://git-scm.com/book/en/v2/Git-Tools-Submodules
===========================================
use https://github.com/tunnckoCore/parse-function, instead of function-arguments
===========================================
suman test/src/tap-output/tap-producer1.js --runner --use-tap => exit code is 56
suman test/src/tap-output/tap-producer1.js --runner => exit code is 1
===============================================
in order for parallel-max to work properly,
the last test suite to be put on the queue, needs to wait.
=================================================
--use-tap prevents tables from being printed by runner, weird.
(probably because tap-reporter doesn't print tables, duh)
===========================================
"please report this on the Github issue..." => add a link to these instance in the codebase to sumanjs/suman#issues
===========================================
when a command in run.sh fails, we need to send that stderr
to the runner, e.g.:
=> [suman child stderr] => ./suman/test/src/mocha/@run.sh: line 6: mocha: command not found
===========================================
taskset -cp 0,4 9030
get bash script PID with $$
https://stackoverflow.com/questions/2493642/how-does-a-linux-unix-bash-script-know-its-own-pid
===========================================
need a methodology to run @run.sh scripts and write log information to file.
// @run.sh
protractor | tee blah # doesn't work because we want all commands from @run.sh to end up in log file
===========================================
if a dep request makes to require(dep) then we should coerce dep into a string that meets npm criteria
for example function_arguments => we should try to
require('function-arguments') and require('function_arguments')
===========================================
make-graceful-exit =>
1. cb({stack: {'seed-database-exit-code': code}});
versus:
2. cb({'seed-database-exit-code': code});
suman can handle 1 but not 2.
===========================================
when we install suman
[object Object]
=> Suman message => Suman was successfully installed locally.
===========================================
suman.ioc.js is being loaded for all make-describes
Error: ioc
at module.exports (/Users/alexamil/WebstormProjects/cisco/cdt-now/test/.suman/suman.ioc.js:81:15)
at Object.exports.acquireIocDeps (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/acquire-dependencies/acquire-ioc-deps.js:27:28)
at Domain.<anonymous> (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/test-suite-methods/make-describe.js:96:36)
at Domain.run (domain.js:242:14)
at TestSuite.run [as _run] (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/test-suite-methods/make-describe.js:87:15)
at runChild (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/test-suite-helpers/make-test-suite.js:26:15)
at TestSuiteMaker.TestSuite.__invokeChildren (/Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman/lib/test-suite-helpers/make-test-suite.js:205:19)
===========================================
suman child id should be a uuid not an integer
============================================
There is an easier way to get a property from a json string. Using a package.json file as an example, try this:
#!/usr/bin/env bash
str=`cat package.json`;
my_val="$(node -pe "JSON.parse(\`$str\`)['version']")"
or
#!/usr/bin/env bash
prop="version"
my_val="$(node -pe "require('./package.json')['$prop']")"
both techniques work great. enjoy.
============================================
suman needs to take a node path as argument SUMAN_NODEJS_EXEC_PATH=x
suman could source a .sh file that's in test/.suman/shell/*.sh
===========================================
use -- --seed instead of --user-args?
===========================================
if @run.sh exists for a file x, but the command is just "suman x", then the runner won't be used and @run.sh won't
be used. To correct this, if @run.sh is found, we must use the runner.
===========================================
put a "twitter like" button on the webpage
Please Share on Twitter if you like #mockgoose
Please Share on Twitter if you like #suman
===========================================
if sumanception > 0, then we have to use the runner, so that we collect tap output correctly
so that grandchildren do not write to grandparents directly.
===========================================
when a hook fails, we should include the hook type and name in graceful exit,
that's why (hook || test) was being passed to graceful exit in the first place.
===========================================
using tsc --watch to transpile files according to rules
https://github.com/Microsoft/TypeScript/issues/16779
=> tsc --p <name of your tsconfig.json> --watch --outDir <your new outDir>
===========================================
brew install phantomjs
https://code.tutsplus.com/tutorials/testing-javascript-with-phantomjs--net-28243
brew install sumanjs ???
===========================================
suman.ioc.js values should be injectable into suman.once.pre.js and suman.once.post.js
===========================================
https://github.com/avajs/karma-ava
===========================================
include yaml "diagnostics" as part of TAP
===========================================
https://github.com/substack/tape/issues/378
Getting a list of failing/passing tests after test suite execution
===========================================
SUCCEEDED/FAILED/KILLED/BAILED
need to add transpile/transform block before run block in gantt chart
d3 gantt chart
https://gist.github.com/dk8996/5449641
===========================================
if sumanception level > 1, then we shouldn't write any TAP results
because stdout cannot be multiplexed, etc.
actually each parent can successfully parse a child, so it will work.
===========================================
print test path run if using node x.js or suman x.js
sometimes I just forget what test I just ran lol
===========================================
suman-single-process should use vm to run in this context?
https://nodejs.org/api/vm.html#vm_script_runinthiscontext_options
===========================================
=> use suman --view-results, to view HTML rendering of results from last run
===========================================
use block scope
let foo;
{
let v = 2;
foo = v*2;
}
===========================================
suman --containerize should reference node_modules instead of re-installing
===========================================
if suman.init() is called more than once and we are not in SUMAN_SINGLE_PROCESS, we should fail right away
===========================================
afterAllParentHooks('yes', t => {
console.log('after all parent hooks');
});
===========================================
need to switch out function arguments parsing
===========================================
include $index file, inject that into Test.create
===========================================
add flag --auto-pass, which means runner or test always exits with code 0.
this is useful when the place suman in a CI/CD pipeline but don't want failing to tests to unnecessarily
break things.
===========================================
const strm = fs.createWriteStream(path.resolve(__dirname + '/../logs/stderr.log'));
const stderr = process.stderr.write;
process.stderr.write = function () {
let args = Array.from(arguments);
let firstArg = String(args[0]).replace(/\[[0-9]{1,2}m/g, '').replace(/\[[0-9]{1,2};[0-9]{1,2}m/g, '');
strm.write.apply(strm, [firstArg]);
stderr.apply(process.stderr, arguments);
};
===========================================
mocha internals video:
https://www.youtube.com/watch?v=zLayCLcIno0&feature=youtu.be
===========================================
=> https://github.com/mochajs/mocha/issues/911
create a methodology to run beforeEach before any child before blocks
describe('Create Article', () => {
beforeEach(() => console.log('CLEAN DB'))
context('When Article is valid', () => {
let flip = true;
beforeEach(() => flip && (flip = false; console.log('INSERTING VALID ARTICLE')))
it('should not fail')
it('should have some properties')
it('should send an email')
})
context('When Article is not valid', () => {
let flip = true;
beforeEach(() => flip && (flip = false; console.log('INSERTING NOT VALID ARTICLE')))
it('should fail')
it('should not send an email')
})
})
===========================================
https://github.com/nodejs/help/issues/735
const writable = fs.createWriteStream(<file2>)
writable.write('Test.create(function(){');
fs.createReadStream(<file1>, {end:false})
.pipe(new ReplaceStream('bar','star')).pipe(writable);
writable.end('})');
===========================================
use a symlink library to follow symlinks in test directory
library must detect circular deps
===========================================
supports non-NPM projects (global installation)
=> need to look for suman.conf.js and package.json, whichever comes first.
===========================================
--random / --rand should store the order in which the files were started
===========================================
we should allow people to put suman.conf.js somewhere besides project root, using some convention.
===========================================