Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed May 8, 2024
1 parent 8500a40 commit 20f94c3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,22 @@ describe('strings', () => {
})

it('truncates strings involving surrogate pairs longer than truncate (7)', () => {
expect(inspect('🐱🐱🐱', { truncate: 7 })).to.equal("'πŸ±πŸ±β€¦'") // not '🐱🐱\ud83d…'
// not '🐱🐱\ud83d…' (length 7) but 'πŸ±πŸ±β€¦' (length 6)
expect(inspect('🐱🐱🐱', { truncate: 7 })).to.equal("'πŸ±πŸ±β€¦'")
})

it('truncates strings involving surrogate pairs longer than truncate (6)', () => {
expect(inspect('🐱🐱🐱', { truncate: 6 })).to.equal("'πŸ±β€¦'") // not '🐱\ud83d…'
expect(inspect('🐱🐱🐱', { truncate: 6 })).to.equal("'πŸ±β€¦'")
})

it('truncates strings involving surrogate pairs longer than truncate (5)', () => {
// not '🐱\ud83d…' (length 5) but 'πŸ±β€¦' (length 4)
expect(inspect('🐱🐱🐱', { truncate: 5 })).to.equal("'πŸ±β€¦'")
})

it('truncates strings involving graphemes than truncate (5)', () => {
expect(inspect('πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§', { truncate: 5 })).to.equal("'πŸ‘¨β€¦'") // partial support: valid string for unicode
// partial support: valid string for unicode
expect(inspect('πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§', { truncate: 5 })).to.equal("'πŸ‘¨β€¦'")
})

it('disregards truncate when it cannot truncate further (2)', () => {
Expand Down

0 comments on commit 20f94c3

Please sign in to comment.