This comes from a project I downloaded to learn from:
;['delete', 'get', 'post', 'put', 'patch'].forEach((method) => {
test(method, async () => {
expect(global.fetch).not.toBeCalled()
await api[method]('/foo')
expect(global.fetch).toHaveBeenCalledWith(
'https://api.foo.com/foo',
expect.objectContaining({ method })
)
})
})
I've yet to see a line in js that starts with a semi-colon.
Can anyone explain this?