Skip to content

Commit

Permalink
Removed chai from dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ryu1kn committed Apr 17, 2020
1 parent fe51951 commit 91ed794
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 54 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
},
"homepage": "https://github.com/ryu1kn/multiline-string#readme",
"devDependencies": {
"chai": "^4.2.0",
"coveralls": "^3.0.11",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.1",
Expand Down
22 changes: 11 additions & 11 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
const expect = require('chai').expect
const { strictEqual } = require('assert')
const createMultiline = require('../index')
const defaultMultiline = createMultiline()

describe('multiline', () => {
it('ignores the first empty line', () => {
const str = defaultMultiline(`
LINE1`)
expect(str).to.eql('LINE1')
strictEqual(str, 'LINE1')
})

it('does nothing if given string does not begin with newline', () => {
const str = defaultMultiline('LINE1')
expect(str).to.eql('LINE1')
strictEqual(str, 'LINE1')
})

it('uses the indent size of the first non-empty line', () => {
const str = defaultMultiline(`
LINE1
LINE2`)
expect(str).to.eql('\nLINE1\nLINE2')
strictEqual(str, '\nLINE1\nLINE2')
})

it('removes all leading space characters', () => {
const str = defaultMultiline(`
LINE1`)
expect(str).to.eql('LINE1')
strictEqual(str, 'LINE1')
})

it('sets the indent of the 2nd line as the indent for all lines', () => {
Expand All @@ -34,7 +34,7 @@ LINE1`)
- LINE2
- LINE3
`)
expect(str).to.eql('- LINE1\n - LINE2\n- LINE3\n')
strictEqual(str, '- LINE1\n - LINE2\n- LINE3\n')
})

it('recognises tabs as an indent', () => {
Expand All @@ -43,21 +43,21 @@ LINE1`)
- LINE1
- LINE2`)
/* eslint-enable no-tabs */
expect(str).to.eql('- LINE1\n- LINE2')
strictEqual(str, '- LINE1\n- LINE2')
})

it('removes indents only if it is the same with the first indent', () => {
const str = defaultMultiline(`
- LINE1
x - LINE2`)
expect(str).to.eql('- LINE1\n x - LINE2')
strictEqual(str, '- LINE1\n x - LINE2')
})

it('does not remove matching spaces if they appear in the middle of a line', () => {
const str = defaultMultiline(`
- LINE1
- LINE2 x`)
expect(str).to.eql('- LINE1\n - LINE2 x')
strictEqual(str, '- LINE1\n - LINE2 x')
})

it('drops all characters until it encounters the first margin character', () => {
Expand All @@ -66,14 +66,14 @@ LINE1`)
| *
| ***
|*****`)
expect(str).to.eql(' *\n ***\n*****')
strictEqual(str, ' *\n ***\n*****')
})

it('does nothing if it encounters non-margin-mark or non-spaces first', () => {
const multiline = createMultiline({ marginMark: '|' })
const str = multiline(`
x | *
| ***`)
expect(str).to.eql(' x | *\n | ***')
strictEqual(str, ' x | *\n | ***')
})
})
42 changes: 0 additions & 42 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,6 @@ assert-plus@1.0.0, assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"

assertion-error@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b"
integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==

astral-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
Expand Down Expand Up @@ -495,18 +490,6 @@ caseless@~0.12.0:
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=

chai@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5"
integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==
dependencies:
assertion-error "^1.1.0"
check-error "^1.0.2"
deep-eql "^3.0.1"
get-func-name "^2.0.0"
pathval "^1.1.0"
type-detect "^4.0.5"

chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
Expand Down Expand Up @@ -547,11 +530,6 @@ chardet@^0.7.0:
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==

check-error@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=

chokidar@3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6"
Expand Down Expand Up @@ -747,13 +725,6 @@ decamelize@^1.2.0:
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=

deep-eql@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df"
integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==
dependencies:
type-detect "^4.0.0"

deep-is@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
Expand Down Expand Up @@ -1284,10 +1255,6 @@ get-caller-file@^2.0.1:
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==

get-func-name@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41"

get-stdin@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6"
Expand Down Expand Up @@ -2261,11 +2228,6 @@ path-type@^2.0.0:
dependencies:
pify "^2.0.0"

pathval@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0"
integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA=

performance-now@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
Expand Down Expand Up @@ -2864,10 +2826,6 @@ type-check@~0.3.2:
dependencies:
prelude-ls "~1.1.2"

type-detect@^4.0.0, type-detect@^4.0.5:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"

type-fest@^0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1"
Expand Down

0 comments on commit 91ed794

Please sign in to comment.