@@ -13,7 +13,7 @@ const {
1313} = require ( '../index.js' )
1414
1515chai . use ( chaiAsPromised )
16- chai . should ( )
16+ const should = chai . should ( )
1717
1818/** @type {import('../index.js').SocketYml } */
1919const defaults = {
@@ -27,7 +27,7 @@ describe('parseSocketConfig()', () => {
2727 it ( 'should read and parse socket.yml' , async ( ) => {
2828 const fileContent = await readFile ( path . resolve ( __dirname , 'sample.yml' ) , 'utf8' )
2929
30- await parseSocketConfig ( fileContent ) . should . eventually . become ( {
30+ parseSocketConfig ( fileContent ) . should . deep . equal ( {
3131 'githubApp' : {
3232 'enabled' : true ,
3333 'projectReportsEnabled' : true ,
@@ -47,7 +47,7 @@ describe('parseSocketConfig()', () => {
4747 it ( 'should read and parse socket.yml v1' , async ( ) => {
4848 const fileContent = await readFile ( path . resolve ( __dirname , 'sample-v1.yml' ) , 'utf8' )
4949
50- await parseSocketConfig ( fileContent ) . should . eventually . become ( {
50+ parseSocketConfig ( fileContent ) . should . deep . equal ( {
5151 'githubApp' : {
5252 'enabled' : true ,
5353 'projectReportsEnabled' : false ,
@@ -62,34 +62,37 @@ describe('parseSocketConfig()', () => {
6262 } )
6363 } )
6464
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 ( `
6768projectIgnorePaths: true
6869` )
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 / )
7071 } )
7172
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 ( `
7476foo: abc, {{ bcd }} {{ cde }}
7577bar: {{ 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 / )
7780 } )
7881
79- it ( 'should not return unknown properties' , async ( ) => {
80- await parseSocketConfig ( `
82+ it ( 'should not return unknown properties' , ( ) => {
83+ parseSocketConfig ( `
8184version: 2
8285foo: true
8386` )
84- . should . eventually . become ( defaults )
87+ . should . deep . equal ( defaults )
8588 } )
8689
87- it ( 'should coerce types' , async ( ) => {
88- await parseSocketConfig ( `
90+ it ( 'should coerce types' , ( ) => {
91+ parseSocketConfig ( `
8992version: 2
9093projectIgnorePaths: foobar
9194` )
92- . should . eventually . become ( {
95+ . should . deep . equal ( {
9396 ...defaults ,
9497 projectIgnorePaths : [ 'foobar' ] ,
9598 } )
0 commit comments