@@ -24,8 +24,10 @@ describe('Unit | filter-test-modules', () => {
24
24
} ) ;
25
25
26
26
describe ( 'modulePath' , function ( ) {
27
+ let modules = [ ]
28
+
27
29
beforeEach ( function ( ) {
28
- this . modules = [
30
+ modules = [
29
31
'foo-test' ,
30
32
'foo-test.jshint' ,
31
33
'bar-test' ,
@@ -34,38 +36,38 @@ describe('Unit | filter-test-modules', () => {
34
36
} ) ;
35
37
36
38
afterEach ( function ( ) {
37
- this . modules = [ ] ;
39
+ modules = [ ] ;
38
40
} ) ;
39
41
40
42
it ( 'should return a list of jshint tests' , ( ) => {
41
- expect ( filterTestModules ( this . modules , 'jshint' ) ) . to . deep . equal ( [
43
+ expect ( filterTestModules ( modules , 'jshint' ) ) . to . deep . equal ( [
42
44
'foo-test.jshint' ,
43
45
'bar-test.jshint'
44
46
] ) ;
45
47
} ) ;
46
48
47
49
it ( 'should return an empty list when there is no match' , ( ) => {
48
50
expect ( ( ) => {
49
- filterTestModules ( this . modules , 'no-match' ) ;
51
+ filterTestModules ( modules , 'no-match' ) ;
50
52
} ) . to . throw ( / N o t e s t s m a t c h e d w i t h t h e f i l t e r : / ) ;
51
53
} ) ;
52
54
53
55
it ( 'should return a list of tests matched with a regular expression' , ( ) => {
54
- expect ( filterTestModules ( this . modules , '/jshint/' ) ) . to . deep . equal ( [
56
+ expect ( filterTestModules ( modules , '/jshint/' ) ) . to . deep . equal ( [
55
57
'foo-test.jshint' ,
56
58
'bar-test.jshint'
57
59
] ) ;
58
60
} ) ;
59
61
60
62
it ( 'should return a list of tests matched with a regular expression that excluses jshint' , ( ) => {
61
- expect ( filterTestModules ( this . modules , '!/jshint/' ) ) . to . deep . equal ( [
63
+ expect ( filterTestModules ( modules , '!/jshint/' ) ) . to . deep . equal ( [
62
64
'foo-test' ,
63
65
'bar-test'
64
66
] ) ;
65
67
} ) ;
66
68
67
69
it ( 'should return a list of tests matches with a list of string options' , ( ) => {
68
- expect ( filterTestModules ( this . modules , 'foo, bar' ) ) . to . deep . equal ( [
70
+ expect ( filterTestModules ( modules , 'foo, bar' ) ) . to . deep . equal ( [
69
71
'foo-test' ,
70
72
'foo-test.jshint' ,
71
73
'bar-test' ,
@@ -74,67 +76,68 @@ describe('Unit | filter-test-modules', () => {
74
76
} ) ;
75
77
76
78
it ( 'should return a list of unique tests matches when options are repeated' , ( ) => {
77
- expect ( filterTestModules ( this . modules , 'foo, foo' ) ) . to . deep . equal ( [
79
+ expect ( filterTestModules ( modules , 'foo, foo' ) ) . to . deep . equal ( [
78
80
'foo-test' ,
79
81
'foo-test.jshint'
80
82
] ) ;
81
83
} ) ;
82
84
} ) ;
83
85
84
86
describe ( 'filePath' , function ( ) {
87
+ let modules = [ ] ;
85
88
beforeEach ( function ( ) {
86
- this . modules = [
89
+ modules = [
87
90
'dummy/tests/integration/foo-test' ,
88
91
'dummy/tests/unit/foo-test' ,
89
92
'dummy/tests/unit/bar-test'
90
93
] ;
91
94
} ) ;
92
95
93
96
afterEach ( function ( ) {
94
- this . modules = [ ] ;
97
+ modules = [ ] ;
95
98
} ) ;
96
99
97
100
it ( 'should return a test module matches with full test file path' , ( ) => {
98
- expect ( filterTestModules ( this . modules , null , 'app/tests/integration/foo-test.js' ) ) . to . deep . equal ( [
101
+ expect ( filterTestModules ( modules , null , 'app/tests/integration/foo-test.js' ) ) . to . deep . equal ( [
99
102
'dummy/tests/integration/foo-test'
100
103
] ) ;
101
104
} ) ;
102
105
103
106
it ( 'should return a test module matches with relative test file path' , ( ) => {
104
- expect ( filterTestModules ( this . modules , null , '/tests/unit/foo-test' ) ) . to . deep . equal ( [
107
+ expect ( filterTestModules ( modules , null , '/tests/unit/foo-test' ) ) . to . deep . equal ( [
105
108
'dummy/tests/unit/foo-test'
106
109
] ) ;
107
110
} ) ;
108
111
109
112
it ( 'should return a test module matched with test file path with wildcard' , ( ) => {
110
- expect ( filterTestModules ( this . modules , null , '/unit/*' ) ) . to . deep . equal ( [
113
+ expect ( filterTestModules ( modules , null , '/unit/*' ) ) . to . deep . equal ( [
111
114
'dummy/tests/unit/foo-test' ,
112
115
'dummy/tests/unit/bar-test'
113
116
] ) ;
114
117
} ) ;
115
118
116
119
it ( 'should return a test module matched with test file path with wildcard' , ( ) => {
117
- expect ( filterTestModules ( this . modules , null , '/tests/*/foo*' ) ) . to . deep . equal ( [
120
+ expect ( filterTestModules ( modules , null , '/tests/*/foo*' ) ) . to . deep . equal ( [
118
121
'dummy/tests/integration/foo-test' ,
119
122
'dummy/tests/unit/foo-test'
120
123
] ) ;
121
124
} ) ;
122
125
123
126
it ( 'should return a list of tests matched with a regular expression' , ( ) => {
124
127
expect ( ( ) => {
125
- filterTestModules ( this . modules , null , 'no-match' ) ;
128
+ filterTestModules ( modules , null , 'no-match' ) ;
126
129
} ) . to . throw ( / N o t e s t s m a t c h e d w i t h t h e f i l t e r : / ) ;
127
130
} ) ;
128
131
129
132
it ( 'should return a list of tests matches with a list of string options' , ( ) => {
130
- expect ( filterTestModules ( this . modules , null , '/tests/integration/*, dummy/tests/unit/foo-test' ) ) . to . deep . equal ( [
133
+ expect ( filterTestModules ( modules , null , '/tests/integration/*, dummy/tests/unit/foo-test' ) ) . to . deep . equal ( [
131
134
'dummy/tests/integration/foo-test' ,
132
135
'dummy/tests/unit/foo-test'
133
136
] ) ;
134
137
} ) ;
135
138
136
139
it ( 'should return a list of unique tests matches when options are repeated' , ( ) => {
137
- expect ( filterTestModules ( this . modules , null , 'app/tests/unit/bar-test.js, /tests/unit/*' ) ) . to . deep . equal ( [
140
+ expect ( filterTestModules ( modules , null , 'app/tests/unit/bar-test.js, /tests/unit/*' ) ) . to . deep . equal ( [
138
141
'dummy/tests/unit/bar-test' ,
139
142
'dummy/tests/unit/foo-test'
140
143
] ) ;
0 commit comments