Const
Test that resource options handler indicate that method is allowed.
method
This is a test macro. It can be used to test if any method is indicated to be allowed.
Example use of this test in typescript:
import anyTest, { TestInterface } from "ava";import express from "express";import superTest from "supertest";import * as restHALTestTools from "@yeiniel/rest-hal-test-tools";const test = anyTest as TestInterface<restHALTestTools.IContext>;test.beforeEach((t) => { const app = express(); // provide an endpoint handler for the GET method app.get("/", (_, res) => { res.end(); }); t.context.agent = superTest(app); t.context.resource = "/";});// resource options allow gettest(restHALTestTools.optionsAllow, "get");// resource options do not allow posttest(restHALTestTools.optionsAllow, "post", false);
Test execution context
Http method
Whether it is expected or not that resource options handler allow method (true by default)
Generated using TypeDoc
Test that resource options handler indicate that
method
is allowed.This is a test macro. It can be used to test if any method is indicated to be allowed.
Example use of this test in typescript:
Param
Test execution context
Param
Http method
Param
Whether it is expected or not that resource options handler allow
method
(true by default)