diff options
Diffstat (limited to 'packages/main/src/controllers/__tests__/initConfig.spec.ts')
-rw-r--r-- | packages/main/src/controllers/__tests__/initConfig.spec.ts | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/packages/main/src/controllers/__tests__/initConfig.spec.ts b/packages/main/src/controllers/__tests__/initConfig.spec.ts index e386a07..7b6d6ab 100644 --- a/packages/main/src/controllers/__tests__/initConfig.spec.ts +++ b/packages/main/src/controllers/__tests__/initConfig.spec.ts | |||
@@ -60,8 +60,12 @@ describe('when initializing', () => { | |||
60 | }); | 60 | }); |
61 | 61 | ||
62 | it('should bail if there is an an error creating the config file', async () => { | 62 | it('should bail if there is an an error creating the config file', async () => { |
63 | mocked(persistenceService.writeConfig).mockRejectedValue(new Error('boo')); | 63 | mocked(persistenceService.writeConfig).mockRejectedValue( |
64 | await expect(() => initConfig(config, persistenceService)).rejects.toBeInstanceOf(Error); | 64 | new Error('boo'), |
65 | ); | ||
66 | await expect(() => | ||
67 | initConfig(config, persistenceService), | ||
68 | ).rejects.toBeInstanceOf(Error); | ||
65 | }); | 69 | }); |
66 | }); | 70 | }); |
67 | 71 | ||
@@ -85,7 +89,9 @@ describe('when initializing', () => { | |||
85 | mocked(persistenceService.watchConfig).mockImplementationOnce(() => { | 89 | mocked(persistenceService.watchConfig).mockImplementationOnce(() => { |
86 | throw new Error('boo'); | 90 | throw new Error('boo'); |
87 | }); | 91 | }); |
88 | await expect(() => initConfig(config, persistenceService)).rejects.toBeInstanceOf(Error); | 92 | await expect(() => |
93 | initConfig(config, persistenceService), | ||
94 | ).rejects.toBeInstanceOf(Error); | ||
89 | }); | 95 | }); |
90 | }); | 96 | }); |
91 | 97 | ||
@@ -102,7 +108,9 @@ describe('when initializing', () => { | |||
102 | 108 | ||
103 | it('should bail if it cannot determine whether there is a config file', async () => { | 109 | it('should bail if it cannot determine whether there is a config file', async () => { |
104 | mocked(persistenceService.readConfig).mockRejectedValue(new Error('boo')); | 110 | mocked(persistenceService.readConfig).mockRejectedValue(new Error('boo')); |
105 | await expect(() => initConfig(config, persistenceService)).rejects.toBeInstanceOf(Error); | 111 | await expect(() => |
112 | initConfig(config, persistenceService), | ||
113 | ).rejects.toBeInstanceOf(Error); | ||
106 | }); | 114 | }); |
107 | }); | 115 | }); |
108 | 116 | ||
@@ -118,7 +126,9 @@ describe('when it has loaded the config', () => { | |||
118 | }); | 126 | }); |
119 | mocked(persistenceService.watchConfig).mockReturnValueOnce(watcherDisposer); | 127 | mocked(persistenceService.watchConfig).mockReturnValueOnce(watcherDisposer); |
120 | sutDisposer = await initConfig(config, persistenceService, throttleMs); | 128 | sutDisposer = await initConfig(config, persistenceService, throttleMs); |
121 | [[configChangedCallback]] = mocked(persistenceService.watchConfig).mock.calls; | 129 | [[configChangedCallback]] = mocked( |
130 | persistenceService.watchConfig, | ||
131 | ).mock.calls; | ||
122 | jest.resetAllMocks(); | 132 | jest.resetAllMocks(); |
123 | }); | 133 | }); |
124 | 134 | ||