@@ -25,9 +25,9 @@ describe('boot process', () => {
25
25
it ( 'should return server status by root.js' , ( done ) => {
26
26
const conn = server . listen ( 8000 , ( ) => {
27
27
request ( server ) . get ( '/api' ) . then ( ( res ) => {
28
- expect ( res ) . to . have . status ( 200 ) ;
29
- expect ( res . body ) . to . have . property ( 'started' ) ;
30
- expect ( res . body ) . to . have . property ( 'uptime' ) ;
28
+ expect ( res ) . to . status ( 200 ) ;
29
+ expect ( res . body ) . toHavePropertyOfType ( 'started' ) ;
30
+ expect ( res . body ) . toHavePropertyOfType ( 'uptime' ) ;
31
31
conn . close ( done ) ;
32
32
} ) ;
33
33
} ) ;
@@ -36,13 +36,13 @@ describe('boot process', () => {
36
36
{ { #extended} }
37
37
describe ( 'authentication.js' , ( ) => {
38
38
it ( 'should enable authentication by authentication.js' , ( ) => {
39
- expect ( server . isAuthEnabled ) . to . equal ( true ) ;
39
+ expect ( server . isAuthEnabled ) . toEqual ( true ) ;
40
40
} ) ;
41
41
} ) ;
42
42
43
43
describe ( 'email configuration' , ( ) => {
44
44
it ( 'should have Email model' , ( ) => {
45
- expect ( server . models ) . has . property ( 'Email' ) ;
45
+ expect ( server . models ) . toHavePropertyOfType ( 'Email' ) ;
46
46
} ) ;
47
47
48
48
it ( 'Email model should send email' , ( done ) => {
@@ -58,38 +58,38 @@ describe('boot process', () => {
58
58
59
59
describe ( 'create-admin.js' , ( ) => {
60
60
it ( 'should have Account model' , ( ) => {
61
- expect ( server . models ) . has . property ( 'Account' ) ;
61
+ expect ( server . models ) . toHavePropertyOfType ( 'Account' ) ;
62
62
} ) ;
63
63
64
64
it ( 'should create a default admin user' , ( ) => {
65
65
return server . models . Account . find ( ) . then ( ( res ) => {
66
- expect ( res ) . to . have . lengthOf ( 1 ) ;
67
- expect ( res [ 0 ] ) . to . have . property ( 'createdAt' ) ;
68
- expect ( res [ 0 ] ) . to . have . property ( 'updatedAt' ) ;
69
- expect ( res [ 0 ] . id ) . to . equal ( 1 ) ;
70
- expect ( res [ 0 ] . email ) . to . equal ( initialAccount . email ) ;
71
- expect ( res [ 0 ] . password ) . to . be . an ( 'string' ) ;
66
+ expect ( res ) . to . lengthOf ( 1 ) ;
67
+ expect ( res [ 0 ] ) . toHavePropertyOfType ( 'createdAt' ) ;
68
+ expect ( res [ 0 ] ) . toHavePropertyOfType ( 'updatedAt' ) ;
69
+ expect ( res [ 0 ] . id ) . toEqual ( 1 ) ;
70
+ expect ( res [ 0 ] . email ) . toEqual ( initialAccount . email ) ;
71
+ expect ( res [ 0 ] . password ) . toEqual ( 'string' ) ;
72
72
} ) ;
73
73
} ) ;
74
74
75
75
it ( 'should create a default admin role' , ( ) => {
76
76
return server . models . Role . find ( ) . then ( ( res ) => {
77
- expect ( res ) . to . have . lengthOf ( 1 ) ;
78
- expect ( res [ 0 ] ) . to . have . property ( 'created' ) ;
79
- expect ( res [ 0 ] ) . to . have . property ( 'modified' ) ;
80
- expect ( res [ 0 ] . id ) . to . equal ( 1 ) ;
81
- expect ( res [ 0 ] . name ) . to . equal ( 'admin' ) ;
77
+ expect ( res ) . to . lengthOf ( 1 ) ;
78
+ expect ( res [ 0 ] ) . toHavePropertyOfType ( 'created' ) ;
79
+ expect ( res [ 0 ] ) . toHavePropertyOfType ( 'modified' ) ;
80
+ expect ( res [ 0 ] . id ) . toEqual ( 1 ) ;
81
+ expect ( res [ 0 ] . name ) . toEqual ( 'admin' ) ;
82
82
} ) ;
83
83
} ) ;
84
84
85
85
it ( 'should create RoleMapping entry for admin' , ( ) => {
86
86
const RoleMapping = server . models . RoleMapping ;
87
87
return RoleMapping . find ( ) . then ( ( res ) => {
88
- expect ( res ) . to . have . lengthOf ( 1 ) ;
89
- expect ( res [ 0 ] . id ) . to . equal ( 1 ) ;
90
- expect ( res [ 0 ] . roleId ) . to . equal ( 1 ) ;
91
- expect ( res [ 0 ] . principalId ) . to . equal ( 1 ) ;
92
- expect ( res [ 0 ] . principalType ) . to . equal ( RoleMapping . USER ) ;
88
+ expect ( res ) . to . lengthOf ( 1 ) ;
89
+ expect ( res [ 0 ] . id ) . toEqual ( 1 ) ;
90
+ expect ( res [ 0 ] . roleId ) . toEqual ( 1 ) ;
91
+ expect ( res [ 0 ] . principalId ) . toEqual ( 1 ) ;
92
+ expect ( res [ 0 ] . principalType ) . toEqual ( RoleMapping . USER ) ;
93
93
} ) ;
94
94
} ) ;
95
95
} ) ;
0 commit comments