quora-automation
Version:
Automate creating question and getting all answers
33 lines • 1.81 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const src_1 = require("../src");
const find_question_1 = require("./find-question");
describe('add a question', () => {
it('should fail', () => __awaiter(this, void 0, void 0, function* () {
const result = yield src_1.addQuestion('question', {
username: '',
password: ''
});
expect(result).toBe('This question needs more detail. Add more information to ask a clear question, written as a complete sentence. ');
}), 50000);
it('duplicate', () => __awaiter(this, void 0, void 0, function* () {
const result = yield src_1.addQuestion('is donald trump evil?', {
username: '',
password: ''
});
expect(result).toBe('The question Does Donald Trump lie? has already been asked');
}), 50000);
it('find', () => __awaiter(this, void 0, void 0, function* () {
const result = yield find_question_1.findQuestion('what are some unconventional ridiculously high paying job?');
expect(result).toBe('The question Does Donald Trump lie? has already been asked');
}), 50000);
});
//# sourceMappingURL=name.test.js.map