@@ -10,44 +10,94 @@ if (macroCondition(dependencySatisfies('ember-mocha', '*'))) {
1010 let { expect } = importSync ( 'chai' ) ;
1111
1212 describe ( 'Unit | Mocha | patch-testem-output' , ( ) => {
13- it ( 'add partition number to test name when `split` is passed' , function ( ) {
14- expect (
15- TestemOutput . updateTestName (
16- new Map ( ) . set ( 'split' , 2 ) ,
17- 'test_module | test_name'
18- )
19- ) . to . equal ( 'Exam Partition 1 - test_module | test_name' ) ;
20- } ) ;
13+ describe ( '`preserveTestName` is passed' , ( ) => {
14+ it ( 'does not add partition number to test name when `split` is passed' , function ( ) {
15+ expect (
16+ TestemOutput . updateTestName (
17+ new Map ( ) . set ( 'split' , 2 ) . set ( 'preserveTestName' , true ) ,
18+ 'test_module | test_name'
19+ )
20+ ) . to . equal ( 'test_module | test_name' ) ;
21+ } ) ;
2122
22- it ( 'add partition number to test name when `split` and `partition` are passed' , function ( ) {
23- expect (
24- TestemOutput . updateTestName (
25- new Map ( ) . set ( 'split' , 2 ) . set ( 'partition' , 2 ) ,
26- 'test_module | test_name'
27- )
28- ) . to . equal ( 'Exam Partition 2 - test_module | test_name' ) ;
29- } ) ;
23+ it ( 'does not add partition number to test name when `split` and `partition` are passed' , function ( ) {
24+ expect (
25+ TestemOutput . updateTestName (
26+ new Map ( )
27+ . set ( 'split' , 2 )
28+ . set ( 'partition' , 2 )
29+ . set ( 'preserveTestName' , true ) ,
30+ 'test_module | test_name'
31+ )
32+ ) . to . equal ( 'test_module | test_name' ) ;
33+ } ) ;
34+
35+ it ( 'does not add browser number to test name when `loadBalance` and `browser` are passed' , function ( ) {
36+ expect (
37+ TestemOutput . updateTestName (
38+ new Map ( )
39+ . set ( 'loadBalance' , 2 )
40+ . set ( 'browser' , 1 )
41+ . set ( 'preserveTestName' , true ) ,
42+ 'test_module | test_name'
43+ )
44+ ) . to . equal ( 'test_module | test_name' ) ;
45+ } ) ;
3046
31- it ( 'add browser number to test name when `loadBalance` and `browser` are passed' , function ( ) {
32- expect (
33- TestemOutput . updateTestName (
34- new Map ( ) . set ( 'loadBalance' , 2 ) . set ( 'browser' , 1 ) ,
35- 'test_module | test_name'
36- )
37- ) . to . equal ( 'Browser Id 1 - test_module | test_name' ) ;
47+ it ( 'does not add partition number, browser number to test name when `split`, `partition`, `browser`, and `loadBalance` are passed' , function ( ) {
48+ expect (
49+ TestemOutput . updateTestName (
50+ new Map ( )
51+ . set ( 'split' , 2 )
52+ . set ( 'partition' , 2 )
53+ . set ( 'browser' , 1 )
54+ . set ( 'loadBalance' , 2 )
55+ . set ( 'preserveTestName' , true ) ,
56+ 'test_module | test_name'
57+ )
58+ ) . to . equal ( 'test_module | test_name' ) ;
59+ } ) ;
3860 } ) ;
61+ describe ( '`preserveTestName` is not passed' , ( ) => {
62+ it ( 'adds partition number to test name when `split` is passed' , function ( ) {
63+ expect (
64+ TestemOutput . updateTestName (
65+ new Map ( ) . set ( 'split' , 2 ) ,
66+ 'test_module | test_name'
67+ )
68+ ) . to . equal ( 'Exam Partition 1 - test_module | test_name' ) ;
69+ } ) ;
70+
71+ it ( 'adds partition number to test name when `split` and `partition` are passed' , function ( ) {
72+ expect (
73+ TestemOutput . updateTestName (
74+ new Map ( ) . set ( 'split' , 2 ) . set ( 'partition' , 2 ) ,
75+ 'test_module | test_name'
76+ )
77+ ) . to . equal ( 'Exam Partition 2 - test_module | test_name' ) ;
78+ } ) ;
79+
80+ it ( 'adds browser number to test name when `loadBalance` and `browser` are passed' , function ( ) {
81+ expect (
82+ TestemOutput . updateTestName (
83+ new Map ( ) . set ( 'loadBalance' , 2 ) . set ( 'browser' , 1 ) ,
84+ 'test_module | test_name'
85+ )
86+ ) . to . equal ( 'Browser Id 1 - test_module | test_name' ) ;
87+ } ) ;
3988
40- it ( 'add partition number, browser number to test name when `split`, `partition`, `browser`, and `loadBalance` are passed' , function ( ) {
41- expect (
42- TestemOutput . updateTestName (
43- new Map ( )
44- . set ( 'split' , 2 )
45- . set ( 'partition' , 2 )
46- . set ( 'browser' , 1 )
47- . set ( 'loadBalance' , 2 ) ,
48- 'test_module | test_name'
49- )
50- ) . to . equal ( 'Exam Partition 2 - Browser Id 1 - test_module | test_name' ) ;
89+ it ( 'adds partition number, browser number to test name when `split`, `partition`, `browser`, and `loadBalance` are passed' , function ( ) {
90+ expect (
91+ TestemOutput . updateTestName (
92+ new Map ( )
93+ . set ( 'split' , 2 )
94+ . set ( 'partition' , 2 )
95+ . set ( 'browser' , 1 )
96+ . set ( 'loadBalance' , 2 ) ,
97+ 'test_module | test_name'
98+ )
99+ ) . to . equal ( 'Exam Partition 2 - Browser Id 1 - test_module | test_name' ) ;
100+ } ) ;
51101 } ) ;
52102 } ) ;
53103}
0 commit comments