File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ import ensureNotEmpty from '../library/ensure-not-empty';
2
2
3
3
export default ( parsed , when ) => {
4
4
const negated = when === 'never' ;
5
+ const notEmpty = ensureNotEmpty ( parsed . type ) ;
5
6
return [
6
- ensureNotEmpty ( parsed . type ) ,
7
+ negated ? notEmpty : ! notEmpty ,
7
8
[
8
9
'type' ,
9
10
negated ? 'may not' : 'must' ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const parsed = {
12
12
filled : parse ( messages . filled )
13
13
} ;
14
14
15
- test . failing ( 'without type should succeed for empty keyword' , t => {
15
+ test ( 'without type should succeed for empty keyword' , t => {
16
16
const [ actual ] = typeEmpty ( parsed . empty ) ;
17
17
const expected = true ;
18
18
t . is ( actual , expected ) ;
@@ -24,13 +24,13 @@ test('without type should fail for "never"', t => {
24
24
t . is ( actual , expected ) ;
25
25
} ) ;
26
26
27
- test . failing ( 'without type should succeed for "always"' , t => {
27
+ test ( 'without type should succeed for "always"' , t => {
28
28
const [ actual ] = typeEmpty ( parsed . empty , 'always' ) ;
29
29
const expected = true ;
30
30
t . is ( actual , expected ) ;
31
31
} ) ;
32
32
33
- test . failing ( 'with type fail for empty keyword' , t => {
33
+ test ( 'with type fail for empty keyword' , t => {
34
34
const [ actual ] = typeEmpty ( parsed . filled ) ;
35
35
const expected = false ;
36
36
t . is ( actual , expected ) ;
@@ -42,7 +42,7 @@ test('with type succeed for "never"', t => {
42
42
t . is ( actual , expected ) ;
43
43
} ) ;
44
44
45
- test . failing ( 'with type fail for "always"' , t => {
45
+ test ( 'with type fail for "always"' , t => {
46
46
const [ actual ] = typeEmpty ( parsed . filled , 'always' ) ;
47
47
const expected = false ;
48
48
t . is ( actual , expected ) ;
You can’t perform that action at this time.
0 commit comments