when uncomment those code blocks - they need to run successfully: test('a', () => { expect(1).toBe(1); }) test('b', () => { expect(1).toBe(2); })
Sigiloso
function test(name, fn){ try { fn(); console.log(`test ${name} has passed!`) } catch (e) { console.log(`test ${name} has failed!`) } } function expect(val) { return { toBe: function(val2){ if(val === val2) return true; throw new Error() } } }