UNPKG

wechaty-puppet-padplus

Version:
37 lines 3.14 kB
#!/usr/bin/env ts-node "use strict"; 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 }); // tslint:disable:no-shadowed-variable const blue_tape_1 = __importDefault(require("blue-tape")); const friendship_event_message_parser_1 = require("./friendship-event-message-parser"); blue_tape_1.default('friendshipConfirmEventMessageParser()', (t) => __awaiter(void 0, void 0, void 0, function* () { t.equal(yield friendship_event_message_parser_1.friendshipConfirmEventMessageParser(undefined), null, 'should parse `undefined`'); t.equal(yield friendship_event_message_parser_1.friendshipConfirmEventMessageParser(null), null, 'should parse `null`'); t.equal(yield friendship_event_message_parser_1.friendshipConfirmEventMessageParser({}), null, 'should parse `{}`'); t.equal(yield friendship_event_message_parser_1.friendshipConfirmEventMessageParser({ content: 'fadsfsfasfs' }), null, 'should parse invalid content'); })); blue_tape_1.default('friendshipReceiveEventMessageParser()', (t) => __awaiter(void 0, void 0, void 0, function* () { t.equal(yield friendship_event_message_parser_1.friendshipReceiveEventMessageParser(undefined), null, 'should parse `undefined`'); t.equal(yield friendship_event_message_parser_1.friendshipReceiveEventMessageParser(null), null, 'should parse `null`'); t.equal(yield friendship_event_message_parser_1.friendshipReceiveEventMessageParser({}), null, 'should parse `{}`'); t.equal(yield friendship_event_message_parser_1.friendshipReceiveEventMessageParser({ content: 'fadsfsfasfs' }), null, 'should parse invalid content'); })); blue_tape_1.default('friendshipVerifyEventMessageParser()', (t) => __awaiter(void 0, void 0, void 0, function* () { t.equal(yield friendship_event_message_parser_1.friendshipVerifyEventMessageParser(undefined), null, 'should parse `undefined`'); t.equal(yield friendship_event_message_parser_1.friendshipVerifyEventMessageParser(null), null, 'should parse `null`'); t.equal(yield friendship_event_message_parser_1.friendshipVerifyEventMessageParser({}), null, 'should parse `{}`'); t.equal(yield friendship_event_message_parser_1.friendshipVerifyEventMessageParser({ content: 'fadsfsfasfs' }), null, 'should parse invalid content'); })); //# sourceMappingURL=friendship-event-message-parser.spec.js.map