-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardise build system, fixing TS build
- Loading branch information
1 parent
9dd47eb
commit 7d86db7
Showing
14 changed files
with
702 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/node_modules | ||
/build | ||
/build/es5 | ||
/build/es6 | ||
/.nyc_output | ||
/coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import multiline from './es5/index'; | ||
export = multiline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const multiline = require('./es5/index.cjs').default; | ||
|
||
module.exports = multiline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
const assert = require('assert'); | ||
|
||
const multiline = require('../build/wrapper'); | ||
|
||
describe('utils/multiline', () => { | ||
it('Returns a string indented correctly without leading/trailing newline', (() => { | ||
const expectedString = [ | ||
'foo', | ||
' bar', | ||
' zim', | ||
].join('\n'); | ||
|
||
assert.strictEqual(multiline` | ||
foo | ||
bar | ||
zim | ||
`, expectedString); | ||
})); | ||
|
||
it('Returns a string without adjusting indentation', (() => { | ||
const expectedString = [ | ||
'foo', | ||
' bar', | ||
' zim', | ||
].join('\n'); | ||
|
||
assert.strictEqual(multiline` | ||
foo | ||
bar | ||
zim | ||
`, expectedString); | ||
})); | ||
|
||
it('Returns a string indented correctly with tabs', (() => { | ||
const expectedString = [ | ||
'foo', | ||
'\tbar', | ||
'', | ||
'\t\tzim', | ||
].join('\n'); | ||
|
||
assert.strictEqual(multiline` | ||
\t\t\tfoo | ||
\t\t\t\tbar | ||
\t\t\t\t\tzim | ||
`, expectedString); | ||
})); | ||
|
||
it('Returns a string indented correctly with mixed tabs and spaces, you monster', (() => { | ||
const expectedString = [ | ||
'foo', | ||
'', | ||
'\tbar', | ||
'\t\tzim', | ||
].join('\n'); | ||
|
||
assert.strictEqual(multiline` | ||
\tfoo | ||
\t | ||
\t\tbar | ||
\t\t\tzim | ||
`, expectedString); | ||
})); | ||
|
||
it('Returns a string with extra trailing newlines', (() => { | ||
const expectedString = [ | ||
'foo', | ||
' bar', | ||
' zim', | ||
'', | ||
'', | ||
].join('\n'); | ||
|
||
assert.strictEqual(multiline` | ||
foo | ||
bar | ||
zim | ||
`, expectedString); | ||
})); | ||
|
||
it('Returns a string with extra leading newlines', (() => { | ||
const expectedString = [ | ||
'', | ||
'foo', | ||
' bar', | ||
' zim', | ||
'', | ||
'', | ||
].join('\n'); | ||
|
||
assert.strictEqual(multiline` | ||
foo | ||
bar | ||
zim | ||
`, expectedString); | ||
})); | ||
|
||
it('Returns a string with placeholders indented correctly', (() => { | ||
const expectedString = [ | ||
'foo', | ||
' zim', | ||
' bar', | ||
' zig', | ||
].join('\n'); | ||
|
||
const zim = 'zim'; | ||
const zig = 'zig'; | ||
assert.strictEqual(multiline` | ||
foo | ||
${zim} | ||
bar | ||
${zig} | ||
`, expectedString); | ||
})); | ||
|
||
it('Returns a string with multiline placeholders indented correctly', (() => { | ||
const expectedString = [ | ||
'foo', | ||
' zim', | ||
' zip', | ||
' zig', | ||
].join('\n'); | ||
|
||
const list = ['zim', 'zip', 'zig'].join('\n'); | ||
assert.strictEqual(multiline` | ||
foo | ||
${list} | ||
`, expectedString); | ||
})); | ||
|
||
it('Returns a string with consecutive placeholders indented correctly', (() => { | ||
const expectedString = [ | ||
'foo', | ||
' zim: zig', | ||
].join('\n'); | ||
|
||
const zim = 'zim'; | ||
const zig = 'zig'; | ||
assert.strictEqual(multiline` | ||
foo | ||
${zim}: ${zig} | ||
`, expectedString); | ||
})); | ||
|
||
it('Returns a string indented correctly when called as a function', (() => { | ||
const expectedString = [ | ||
'foo', | ||
' bar', | ||
' zim', | ||
].join('\n'); | ||
|
||
assert.strictEqual(multiline(` | ||
foo | ||
bar | ||
zim | ||
`), expectedString); | ||
})); | ||
}); |
Oops, something went wrong.