Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable max-len */
import TextlintTester from 'textlint-tester';
import fs from 'fs';
import path from 'path';
import rule from '../src/no-dead-link';
const tester = new TextlintTester();
tester.run('no-dead-link', rule, {
valid: [
'should ignore non-http url [email address](mailto:mail.example.com) by default',
'should ignore non-http url [ftp](ftp://example.com) by default',
'should ignore non-http url [websockets](ws://example.com) by default',
'should be able to check a link in Markdown: [example](https://example.com/)',
'should be able to check a link in Markdown: [example](https://dev.mysql.com/downloads/mysql/)',
'should be able to check a URL in Markdown: https://example.com/',
'should success with retrying on error: [npm results for textlint](https://www.npmjs.com/search?q=textlint)',
'should treat 200 OK as alive: https://httpstat.us/200',
'should treat 200 OK. It require User-Agent: Navigate to [MySQL distribution](https://dev.mysql.com/downloads/mysql/) to install MySQL `5.7`.',
'should treat 200 OK. It require User-Agent: https://tools.ietf.org/html/rfc6749',
{
text:
'should be able to check a URL in a plain text: https://example.com/',
import TextlintTester from 'textlint-tester';
import rule from '../src/write-good';
const tester = new TextlintTester();
tester.run('write-good', rule, {
valid: [
'Hello, world!',
'This sentence contains no mistakes.',
{
text: 'The cat was stolen.',
options: {
passive: false,
},
},
],
invalid: [
{
text: 'So the cat was stolen.',
errors: [