Socket
Socket
Sign inDemoInstall

@gojob/wait-for-assertion

Package Overview
Dependencies
2
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "@gojob/wait-for-assertion",
"version": "1.0.1",
"version": "1.0.2",
"description": "Wait for asynchronous testing assertions",

@@ -5,0 +5,0 @@ "repository": "https://github.com/gojob-1337/wait-for-assertion.git",

@@ -12,1 +12,22 @@ # Wait for Assertion

```
## Example
```typescript
import { waitForAssertion } from '@gojob/wait-for-assertion';
// [...]
it('should asynchronously update the value in Elasticsearch', async () => {
await request(server)
.put(endpointURL)
.send(input)
.expect(HttpStatus.NO_CONTENT);
// this would fail directly, if not awaited, as the document is not immediatly available in Elasticsearch
await waitForAssertion(async () => {
const { document } = await elasticsearchService.get(UserIndex, userId);
return expect(document.firstName).toBe(updatedUser.firstName);
});
});
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc