Open NeilRiver opened 1 month ago
I found out what the matter was, the problem was in my global handler of basic checks.
I really don't like duplicating code, inserting these usual checks and I found a way to check. Question... why does the extension crash from this?
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
setupFilesAfterEnv: ['./jest.setup.js']
};
// ./jest.setup.js
const originalTest = global.test;
global.test = (name, fn, timeout) => {
return originalTest(
name,
async () => {
const result = await fn();
if (result && typeof result === 'object' && 'status' in result) {
const isSuccessStatus = (status) => status >= 200 && status < 300;
expect(isSuccessStatus(result.status)).toBeTruthy();
expect(result.duration).toBeLessThan(1000);
expect(result.headers['content-type']).toMatch(/application\/json/);
expect(result.headers['connection']).toBe('keep-alive');
expect(() => JSON.parse(JSON.stringify(result.data))).not.toThrow();
}
return result;
},
timeout
);
};
Hmm... It is not clear to me why the global setup will trigger this behavior... Do you have a sample repo that we can try to repro your issue?
Hmm... It is not clear to me why the global setup will trigger this behavior... Do you have a sample repo that we can try to repro your issue?
Sorry, this is a working project i already abandoned this solution because there is duplication here... i call the async request 2 times... before the test and in the test itself
Describe the bug It's simple, I develop tests, and finally decided to check them, an error occurred, I click on the icon 2 times and on the 3rd time all the icons in the tests disappear.
Screenshots 1) all ok 2) one more click and everyone reload the page if you want the icon to appear 3) and it is not clear why he started to consider import as a test?
Environment (please complete the following information):
node -v
: v20.18.0at the moment i run tests by clicking on the icon