-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Sindre Sorhus <[email protected]>
- Loading branch information
1 parent
a3bfac7
commit d6b4b32
Showing
11 changed files
with
356 additions
and
20 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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import test from 'ava'; | ||
import boxen from '../index.js'; | ||
|
||
test('fullscreen option', t => { | ||
const box = boxen('foo', { | ||
fullscreen: true, | ||
}); | ||
|
||
t.snapshot(box); | ||
}); | ||
|
||
test('fullscreen option + width', t => { | ||
const box = boxen('foo', { | ||
fullscreen: true, | ||
width: 10, | ||
}); | ||
|
||
t.snapshot(box); | ||
}); | ||
|
||
test('fullscreen option + height', t => { | ||
const box = boxen('foo', { | ||
fullscreen: true, | ||
height: 10, | ||
}); | ||
|
||
t.snapshot(box); | ||
}); | ||
|
||
test('fullscreen option with callback', t => { | ||
const box = boxen('foo', { | ||
fullscreen: (width, height) => [width - 2, height - 2], | ||
}); | ||
|
||
t.snapshot(box); | ||
}); |
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,51 @@ | ||
import test from 'ava'; | ||
import boxen from '../index.js'; | ||
|
||
test('height option works', t => { | ||
// Creates a tall box with empty rows | ||
t.snapshot( | ||
boxen('foo', { | ||
height: 5, | ||
}), | ||
); | ||
|
||
// Creates a 1 line box, cropping the other lines | ||
t.snapshot( | ||
boxen('foo bar\nfoo bar', { | ||
height: 3, | ||
}), | ||
); | ||
}); | ||
|
||
test('height option with padding + margin', t => { | ||
// Creates a wide box for little text | ||
const box = boxen('foo', { | ||
height: 20, | ||
margin: 2, | ||
padding: 1, | ||
}); | ||
|
||
t.snapshot(box); | ||
}); | ||
|
||
test('height option with width', t => { | ||
// Creates a wide box for little text | ||
const box = boxen('foo', { | ||
height: 5, | ||
width: 20, | ||
}); | ||
|
||
t.snapshot(box); | ||
}); | ||
|
||
test('height option with width + padding + margin', t => { | ||
// Creates a wide box for little text | ||
const box = boxen('foo', { | ||
height: 5, | ||
width: 20, | ||
margin: 2, | ||
padding: 1, | ||
}); | ||
|
||
t.snapshot(box); | ||
}); |
Oops, something went wrong.