Skip to content

Commit 5591263

Browse files
ilessiiviilessiivi
and
ilessiivi
authored
Validate the firing order of hooks and catch-all (#369)
Co-authored-by: ilessiivi <[email protected]>
1 parent b0d603f commit 5591263

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/fileAddSpec.js

+12
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@ describe('fileAdd event', function() {
118118
expect(customFunction).toHaveBeenCalledTimes(3);
119119
});
120120

121+
it('should validate catch-all emitting after hooks', async function() {
122+
let valid = false;
123+
flow.on('catch-all', () => {
124+
valid = true;
125+
});
126+
flow.on('files-submitted', () => {
127+
valid = false;
128+
});
129+
await flow.addFile(new Blob(['file part']));
130+
expect(valid).toBeTruthy();
131+
});
132+
121133
describe('async/sync hooks', function () {
122134
beforeAll(function() {
123135
jasmine.getEnv().addReporter({

0 commit comments

Comments
 (0)