whodis-sdk
Version:
A simple sdk for easy, secure authentication with the whodis platform. Setup secure authentication for your app in seconds.
33 lines • 1.41 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const dotenv_1 = __importDefault(require("dotenv"));
const domain_1 = require("../../domain");
const createUser_1 = require("./createUser");
dotenv_1.default.config();
if (!process.env.API_PUBLIC_KEY)
throw new Error('public key not defined');
if (!process.env.API_PRIVATE_KEY)
throw new Error('private key not defined');
describe('createUser', () => {
it('should be able to add a contact method', async () => {
const user = await (0, createUser_1.createUser)({
externalId: 'whodis-sdk:bde659d8-edbc-4103-9699-c8d6e9fee8b9',
contactMethod: {
type: domain_1.WhodisContactMethodType.EMAIL,
address: 'tedoramustacomsu@gmail.com',
},
}, {
credentials: {
publicKey: process.env.API_PUBLIC_KEY,
privateKey: process.env.API_PRIVATE_KEY,
},
});
expect(user).toHaveProperty('contactMethods');
expect(user?.contactMethods.length).toBeGreaterThan(0);
expect(user?.contactMethods.map((method) => method.address)).toContain('tedoramustacomsu@gmail.com');
});
});
//# sourceMappingURL=createUser.integration.test.js.map