yoda-seo-tips
Version:
SEO tips from Yoda
33 lines • 1.75 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 assert = require("assert");
const index_1 = require("./index");
const validatorTest_1 = require("./validatorTest");
describe('index test', () => {
it('default rules', () => __awaiter(this, void 0, void 0, function* () {
let out = validatorTest_1.outputStub();
yield index_1.default('sample1.html', out);
assert.equal(out.get(), '');
}));
it('default rules with settings', () => __awaiter(this, void 0, void 0, function* () {
let out = validatorTest_1.outputStub();
yield index_1.default('sample1.html', out, { maxStrongTags: 2 });
assert.equal(out.get(), '3 <strong> tags I count. More than 2 should be not.\n');
}));
it('custom rules', () => __awaiter(this, void 0, void 0, function* () {
let out = validatorTest_1.outputStub();
yield index_1.default('sample1.html', out, [
index_1.mustHaveElement('section', () => 'error1')
]);
assert.equal(out.get(), 'error1\n');
}));
});
//# sourceMappingURL=indexTest.js.map