How to use the frisby.setup function in frisby

To help you get started, we’ve selected a few frisby examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github redhataccess / spandx / spec / spandx / spandxSpec.js View on Github external
}
                }
            };

            const reqs = [
                frisby
                    .setup(accept)
                    .get(`http://localhost:1337/foo`)
                    .expect("status", 200)
                    .expect("bodyContains", /FOO/),
                frisby
                    .setup(accept)
                    .get(`http://localhost:1337/foo/bar`)
                    .expect("status", 200)
                    .expect("bodyContains", /FOO/),
                frisby
                    .setup(accept)
                    .get(`http://localhost:1337/foo/bar/baz`)
                    .expect("status", 200)
                    .expect("bodyContains", /FOO/)
            ];

            // wait for all request promises to resolve, then close up shop
            await Promise.all(reqs.map(r => r._fetch));
            server.close(done);
        });
        it("should not rewrite requests for non-html assets", async done => {
github redhataccess / spandx / spec / spandx / spandxSpec.js View on Github external
dev: "localhost",
                        prod: "127.0.0.1"
                    },
                    port: 1337,
                    silent: true,
                    routes: {
                        "/": {
                            host: {
                                dev: "http://localhost:4014",
                                prod: "http://localhost:4015"
                            }
                        }
                    }
                });

                const devReq = frisby
                    .setup({
                        request: {
                            headers: {
                                Accept: "text/html,*/*"
                            }
                        }
                    })
                    .get("http://localhost:1337/")
                    .expect("status", 200)
                    .expect("bodyContains", /localhost/);

                const prodReq = frisby
                    .setup({
                        request: {
                            headers: {
                                Accept: "text/html,*/*"

frisby

Frisby.js v2.0: REST API Endpoint Testing built on Jasmine

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis