@kilterset/auth0-actions-testing
Version:
Test and develop Auth0 Actions or Okta CIC Actions locally.
34 lines • 2.12 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const node_test_1 = __importDefault(require("node:test"));
const node_assert_1 = require("node:assert");
const api_1 = require("../../mock/api");
(0, node_test_1.default)("Post User Registration API", (t) => __awaiter(void 0, void 0, void 0, function* () {
yield t.test("cache", (t) => __awaiter(void 0, void 0, void 0, function* () {
yield t.test("can set cache", (t) => __awaiter(void 0, void 0, void 0, function* () {
const { implementation: api, state } = (0, api_1.postUserRegistration)();
(0, node_assert_1.strictEqual)(api.cache.set("location", "Ōtautahi").type, "success");
(0, node_assert_1.deepStrictEqual)(state.cache.get("location"), "Ōtautahi");
}));
yield t.test("can get cache", (t) => __awaiter(void 0, void 0, void 0, function* () {
const { implementation: api, state } = (0, api_1.postUserRegistration)({
cache: { location: "Ōtautahi" },
});
(0, node_assert_1.strictEqual)(state.cache.get("location"), "Ōtautahi");
(0, node_assert_1.strictEqual)(state.cache.get("nonexistent"), undefined);
}));
}));
}));
//# sourceMappingURL=post-user-registration.test.js.map