Comments (4)
For simple header value match, you can do the following:
.then(res => {
expect(res.headers.get('link')).toBe('</api/resources?currentPage=1&perPage=10>; rel="first",</api/resources?currentPage=1&perPage=10>; rel="prev",</api/resources?currentPage=1&perPage=10>; rel="self"');
})
ref. :
https://github.com/vlucas/frisby#using-jasmine-matchers-directly
Or you can define Custom Expect Handlers.
from frisby.
Well okay my bad ... I was stuck on the fact that I had to use expect('header', 'link', ...)
.
Sorry for the inconvenience.
from frisby.
For comma-separated list, the following will be helpful.
This specification continues from old version frisby.
#477 is change on node-fetch(http-client) side.
from frisby.
It is exactly what I am doing but the only way for me to test each part is to do something like this:
.expect(
'header',
'link',
'</api/resources?currentPage=1&perPage=10>; rel="first"'
)
.expect(
'header',
'link',
'</api/resources?currentPage=1&perPage=10>; rel="prev"'
)
.expect(
'header',
'link',
'</api/resources?currentPage=1&perPage=10>; rel="self"'
)
.expect(
'header',
'link',
'</api/resources?currentPage=1&perPage=10>; rel="next"'
)
.expect(
'header',
'link',
'</api/resources?currentPage=1&perPage=10>; rel="last"'
)
Which is not convenient...
from frisby.
Related Issues (20)
- Iterate through multiple get calls. HOT 3
- Could not generate token using frisby v2 HOT 10
- could not run test sequentially HOT 21
- frsiby method call returns _fetch: Promise { <pending> }
- could not run test
- unexpected response when posting request with content type x-www-form-urlencoded HOT 9
- Does not show the line where code is failing. Its always points the frisby code.
- Upgrade Joi dependency to v17 HOT 1
- Missing logo HOT 3
- What's the appropriate way to trigger CI/CD? Using a web server? HOT 1
- Is there a function similar to bodyContains but for headers? HOT 2
- Loop through JSON object in Expect()? HOT 12
- Using query parameters in API calls HOT 1
- PUT Call Double Encoding URL HOT 3
- Remove Joi export and move it from peer dependencies to dependencies
- Latest joi version does not work HOT 3
- Unhandled promise rejection: TypeError: response.textConverted is not a function while using Jasmine with Frisby HOT 1
- Update npm package.
- Socket hang up / ECONNRESET errors with Node.js 20.x HOT 4
- CVE on frisby dependency (joi)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frisby.