Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 7, 2021
1 parent ae7d1ba commit b25cbfb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
"@types/tape": "^4.0.0",
"c8": "^7.0.0",
"prettier": "^2.0.0",
"remark-cli": "^9.0.0",
"remark-preset-wooorm": "^8.0.0",
"remark-cli": "^10.0.0",
"remark-preset-wooorm": "^9.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"xo": "^0.38.0"
"xo": "^0.46.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
Expand Down
20 changes: 12 additions & 8 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ test('.clean', function (t) {

test('.trigrams', function (t) {
t.ok(Array.isArray(trigrams('test')), 'should return an array')
t.equal(trigrams('test').join(), ' te,tes,est,st ', 'should return trigrams')
t.equal(
trigrams('te@st').join(),
trigrams('test').join(','),
' te,tes,est,st ',
'should return trigrams'
)
t.equal(
trigrams('te@st').join(','),
' te,te ,e s, st,st ',
'should return cleaned trigrams (1)'
)
t.equal(
trigrams('\nte\tst ').join(),
trigrams('\nte\tst ').join(','),
' te,te ,e s, st,st ',
'should return cleaned trigrams (2)'
)
Expand Down Expand Up @@ -95,37 +99,37 @@ test('.asTuples', function (t) {
t.equal(
asTuples('test')
.map((d) => d.join(';'))
.join(),
.join(','),
' te;1,tes;1,est;1,st ;1',
'should return tuples'
)
t.equal(
asTuples('te@st')
.map((d) => d.join(';'))
.join(),
.join(','),
' te;1,te ;1,e s;1, st;1,st ;1',
'should return cleaned trigrams (1)'
)
t.equal(
asTuples('\nte\tst ')
.map((d) => d.join(';'))
.join(),
.join(','),
' te;1,te ;1,e s;1, st;1,st ;1',
'should return cleaned trigrams (2)'
)

t.equal(
asTuples('testtest')
.map((d) => d.join(';'))
.join(),
.join(','),
' te;1,stt;1,tte;1,st ;1,tes;2,est;2',
'should count duplicate trigrams'
)

t.equal(
asTuples('testtest')
.map((d) => d.join(';'))
.join(),
.join(','),
' te;1,stt;1,tte;1,st ;1,tes;2,est;2',
'should sort trigrams'
)
Expand Down

0 comments on commit b25cbfb

Please sign in to comment.