-
-
Notifications
You must be signed in to change notification settings - Fork 77
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to TypeScript #147
Conversation
Pull Request Test Coverage Report for Build 279
馃挍 - Coveralls |
Pull Request Test Coverage Report for Build 266
馃挍 - Coveralls |
|
||
const config = makeConfig(rows, userConfig); | ||
|
||
rows = truncateTableData(rows, config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old version is:
rows = truncateTableData(data, config);
But I think it is a suitable modification :)
const openRed = '\u001b[31m'; | ||
const closeRed = '\u001b[39m'; | ||
describe('subject is lesser than the chunk size', () => { | ||
it.skip('returns subject in a single chunk', () => { | ||
expect(wrapString(chalk.red('aaa'), 3)).to.deep.equal([ | ||
'\u001B[31m\u001B[31m\u001B[31m\u001B[31m\u001B[31maaa\u001B[39m', | ||
it('returns subject in a single chunk', () => { | ||
expect(wrapString(`${openRed}aa${closeRed}`, 3)).to.deep.equal([ | ||
`${openRed}aa${closeRed}`, | ||
]); | ||
}); | ||
}); | ||
describe('subject is larger than the chunk size', () => { | ||
it.skip('returns subject sliced into multiple chunks', () => { | ||
expect(wrapString(chalk.red('aaabbbc'), 3)).to.deep.equal([ | ||
'\u001B[31m\u001B[31m\u001B[31m\u001B[31m\u001B[31maaa\u001B[39m', | ||
'\u001B[31m\u001B[31m\u001B[31m\u001B[31m\u001B[31mbbb\u001B[39m', | ||
'\u001B[31m\u001B[31m\u001B[31m\u001B[31m\u001B[31mc\u001B[39m', | ||
it('returns subject sliced into multiple chunks', () => { | ||
expect(wrapString(`${openRed}aaabbbc${closeRed}`, 3)).to.deep.equal([ | ||
`${openRed}aaa${closeRed}`, | ||
`${openRed}bbb${closeRed}`, | ||
`${openRed}c${closeRed}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a workaround for the unexpected behaviors of chalk while testing.
馃コ |
馃帀 This PR is included in version 6.3.0 馃帀 The release is available on: Your semantic-release bot 馃摝馃殌 |
Awesome 馃ぉ |
This PR is for migrating the package to TypeScript (#146) with major changes (but should not contain breaking changes 馃檹):
Additionally, the schema definitions could generate from type definitions with third-party libraries like ts-json-schema-generator. By doing that, we can safely remove most of the checking code lines and maybe primitive type checking package like is-boolean, is-number,... But of course, we should do it later :D