
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Sleep function 😴. Convenient for unit testing and general purpose usage.
That's the Swedish translation of the Western and North European folklore character Sandman who puts people to sleep.
npm i blund --save
import sleep from 'blund';
class Service {
foo(promise) {
promise.then(() => this.bar());
}
bar(data) {
// do stuff
}
}
describe('async module', () => {
let service;
beforeEach(() => {
service = new Service();
});
it('should work', async () => {
const spy = spyOn(service, 'bar');
service.foo(new Promise(resolve => setTimeout(resolve, 3)));
await sleep(5);
expect(spy).toHaveBeenCalled();
});
});
MIT
FAQs
A sleep function. Main purpose is testing.
We found that blund demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.