Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
17 lines
614 B
Plaintext
17 lines
614 B
Plaintext
'use strict'
|
|
|
|
const { test } = require('node:test')
|
|
const joinLinesWithIndentation = require('./join-lines-with-indentation')
|
|
|
|
test('joinLinesWithIndentation adds indentation to beginning of subsequent lines', t => {
|
|
const input = 'foo\nbar\nbaz'
|
|
const result = joinLinesWithIndentation({ input })
|
|
t.assert.strictEqual(result, 'foo\n bar\n baz')
|
|
})
|
|
|
|
test('joinLinesWithIndentation accepts custom indentation, line breaks, and eol', t => {
|
|
const input = 'foo\nbar\r\nbaz'
|
|
const result = joinLinesWithIndentation({ input, ident: ' ', eol: '^' })
|
|
t.assert.strictEqual(result, 'foo^ bar^ baz')
|
|
})
|