@@ -13,7 +13,7 @@ const {
13
13
} = require ( '../index.js' )
14
14
15
15
chai . use ( chaiAsPromised )
16
- chai . should ( )
16
+ const should = chai . should ( )
17
17
18
18
/** @type {import('../index.js').SocketYml } */
19
19
const defaults = {
@@ -27,7 +27,7 @@ describe('parseSocketConfig()', () => {
27
27
it ( 'should read and parse socket.yml' , async ( ) => {
28
28
const fileContent = await readFile ( path . resolve ( __dirname , 'sample.yml' ) , 'utf8' )
29
29
30
- await parseSocketConfig ( fileContent ) . should . eventually . become ( {
30
+ parseSocketConfig ( fileContent ) . should . deep . equal ( {
31
31
'githubApp' : {
32
32
'enabled' : true ,
33
33
'projectReportsEnabled' : true ,
@@ -47,7 +47,7 @@ describe('parseSocketConfig()', () => {
47
47
it ( 'should read and parse socket.yml v1' , async ( ) => {
48
48
const fileContent = await readFile ( path . resolve ( __dirname , 'sample-v1.yml' ) , 'utf8' )
49
49
50
- await parseSocketConfig ( fileContent ) . should . eventually . become ( {
50
+ parseSocketConfig ( fileContent ) . should . deep . equal ( {
51
51
'githubApp' : {
52
52
'enabled' : true ,
53
53
'projectReportsEnabled' : false ,
@@ -62,34 +62,37 @@ describe('parseSocketConfig()', () => {
62
62
} )
63
63
} )
64
64
65
- it ( 'should throw on invalid document structure' , async ( ) => {
66
- await parseSocketConfig ( `
65
+ it ( 'should throw on invalid document structure' , ( ) => {
66
+ should . Throw ( ( ) => {
67
+ parseSocketConfig ( `
67
68
projectIgnorePaths: true
68
69
` )
69
- . should . be . rejectedWith ( SocketValidationError , / I n v a l i d c o n f i g d e f i n i t i o n / )
70
+ } , SocketValidationError , / I n v a l i d c o n f i g d e f i n i t i o n / )
70
71
} )
71
72
72
- it ( 'should throw error when not parseable' , async ( ) => {
73
- await parseSocketConfig ( `
73
+ it ( 'should throw error when not parseable' , ( ) => {
74
+ should . Throw ( ( ) => {
75
+ parseSocketConfig ( `
74
76
foo: abc, {{ bcd }} {{ cde }}
75
77
bar: {{ def }} {{ efg }}
76
- ` ) . should . be . rejectedWith ( / E r r o r w h e n p a r s i n g s o c k e t \. y m l c o n f i g / )
78
+ ` )
79
+ } , / E r r o r w h e n p a r s i n g s o c k e t \. y m l c o n f i g / )
77
80
} )
78
81
79
- it ( 'should not return unknown properties' , async ( ) => {
80
- await parseSocketConfig ( `
82
+ it ( 'should not return unknown properties' , ( ) => {
83
+ parseSocketConfig ( `
81
84
version: 2
82
85
foo: true
83
86
` )
84
- . should . eventually . become ( defaults )
87
+ . should . deep . equal ( defaults )
85
88
} )
86
89
87
- it ( 'should coerce types' , async ( ) => {
88
- await parseSocketConfig ( `
90
+ it ( 'should coerce types' , ( ) => {
91
+ parseSocketConfig ( `
89
92
version: 2
90
93
projectIgnorePaths: foobar
91
94
` )
92
- . should . eventually . become ( {
95
+ . should . deep . equal ( {
93
96
...defaults ,
94
97
projectIgnorePaths : [ 'foobar' ] ,
95
98
} )
0 commit comments