mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
test(core): enable no-floating-promises rule for tests (#11915)
Sometimes, missing `await` in the test code can cause timing issues, leading to test failures. This PR enables the `no-floating-promises` rule for the test code to ensure that such errors do not occur.
This commit is contained in:
@@ -82,7 +82,7 @@ const AudioWrapper = () => {
|
||||
e.preventDefault();
|
||||
const file = e.dataTransfer.files[0];
|
||||
if (file && file.type.startsWith('audio/')) {
|
||||
handleFileChange(file);
|
||||
handleFileChange(file).catch(console.error);
|
||||
}
|
||||
},
|
||||
[handleFileChange]
|
||||
@@ -92,7 +92,7 @@ const AudioWrapper = () => {
|
||||
(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const file = e.target.files?.[0];
|
||||
if (file) {
|
||||
handleFileChange(file);
|
||||
handleFileChange(file).catch(console.error);
|
||||
}
|
||||
},
|
||||
[handleFileChange]
|
||||
|
||||
Reference in New Issue
Block a user