Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test ci #1898

Closed
wants to merge 3 commits into from
Closed

Test ci #1898

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ http.createServer((req, res) => {
req.url = '/en'
}
mount(req, res, redirectToEnglishUrl(req, res))
}).listen(port, () => console.log(`\x1B[32mServer running at http://localhost:${port}/en/\x1B[39m`))
}).listen(port, () => console.log(`Server running at http://localhost:${port}/en/`))

// Start the initial build of static HTML pages
build.fullBuild()
21 changes: 17 additions & 4 deletions tests/scripts/anchor-mardown-headings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test('anchorMarkdownHeadings', (t) => {
const anchorMarkdownHeadings = require('../../scripts/plugins/anchor-markdown-headings')

t.plan(4)
t.test('correctly pharses markdown heading without links', (t) => {
t.test('Correctly pharses markdown heading without links', (t) => {
const text = 'Simple title'
const level = 1
const raw = 'Simple title'
Expand All @@ -19,7 +19,7 @@ test('anchorMarkdownHeadings', (t) => {
t.equal(output, expected)
})

t.test('correctly pharses markdown heading with a single link', (t) => {
t.test('Correctly pharses markdown heading with a single link', (t) => {
const text = 'Title with <a href="#">link</a>'
const level = 3
const raw = 'Title with [link](#)'
Expand All @@ -33,7 +33,7 @@ test('anchorMarkdownHeadings', (t) => {
t.equal(output, expected)
})

t.test('correctly pharses markdown heading with multiple links', (t) => {
t.test('Correctly pharses markdown heading with multiple links', (t) => {
const text = 'a <a href="b">b</a> c<a href="d">d</a>e'
const level = 2
const raw = 'a [b](b) c[d](d)e'
Expand All @@ -47,7 +47,7 @@ test('anchorMarkdownHeadings', (t) => {
t.equal(output, expected)
})

t.test('makes pretty slugs', (t) => {
t.test('Makes pretty slugs', (t) => {
const text = '$$$ WIN BIG! $$$'
const level = 4
const raw = '$$$ WIN BIG! $$$'
Expand All @@ -59,4 +59,17 @@ test('anchorMarkdownHeadings', (t) => {
t.plan(1)
t.equal(output, expected)
})

t.test('Makes pretty slugs', (t) => {
const text = '$$$ WIN BIG!! $$$'
const level = 4
const raw = '$$$ WIN BIG!! $$$'
const output = anchorMarkdownHeadings(text, level, raw)
const expected = '<h4 id="header-win-big">$$$ WIN BIG! $$$' +
'<a name="win-big" class="anchor" href="#win-big" ' +
'aria-labelledby="header-win-big"></a></h4>'

t.plan(1)
t.equal(output, expected)
})
})