@@ -25,9 +25,9 @@ describe('boot process', () => {
2525 it ( 'should return server status by root.js' , ( done ) => {
2626 const conn = server . listen ( 8000 , ( ) => {
2727 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' ) ;
3131 conn . close ( done ) ;
3232 } ) ;
3333 } ) ;
@@ -36,13 +36,13 @@ describe('boot process', () => {
3636 { { #extended} }
3737 describe ( 'authentication.js' , ( ) => {
3838 it ( 'should enable authentication by authentication.js' , ( ) => {
39- expect ( server . isAuthEnabled ) . to . equal ( true ) ;
39+ expect ( server . isAuthEnabled ) . toEqual ( true ) ;
4040 } ) ;
4141 } ) ;
4242
4343 describe ( 'email configuration' , ( ) => {
4444 it ( 'should have Email model' , ( ) => {
45- expect ( server . models ) . has . property ( 'Email' ) ;
45+ expect ( server . models ) . toHavePropertyOfType ( 'Email' ) ;
4646 } ) ;
4747
4848 it ( 'Email model should send email' , ( done ) => {
@@ -58,38 +58,38 @@ describe('boot process', () => {
5858
5959 describe ( 'create-admin.js' , ( ) => {
6060 it ( 'should have Account model' , ( ) => {
61- expect ( server . models ) . has . property ( 'Account' ) ;
61+ expect ( server . models ) . toHavePropertyOfType ( 'Account' ) ;
6262 } ) ;
6363
6464 it ( 'should create a default admin user' , ( ) => {
6565 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' ) ;
7272 } ) ;
7373 } ) ;
7474
7575 it ( 'should create a default admin role' , ( ) => {
7676 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' ) ;
8282 } ) ;
8383 } ) ;
8484
8585 it ( 'should create RoleMapping entry for admin' , ( ) => {
8686 const RoleMapping = server . models . RoleMapping ;
8787 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 ) ;
9393 } ) ;
9494 } ) ;
9595 } ) ;
0 commit comments