@@ -83,7 +83,7 @@ if (!linguistBasename) {
8383}
8484
8585const version = linguistBasename . slice ( prefix . length )
86- assert ( version , 'expected version to be found for `linguist`' )
86+ assert . ok ( version , 'expected version to be found for `linguist`' )
8787
8888console . log ( 'generating from linguist %s' , version )
8989
@@ -125,7 +125,7 @@ for (const [name, language] of Object.entries(languages)) {
125125 const existing = uniqueIdentifiers . get ( alias )
126126
127127 if ( existing ) {
128- assert (
128+ assert . ok (
129129 existing === scope ,
130130 'expected duplicate names to refer to same language'
131131 )
@@ -169,7 +169,7 @@ for (name in languages) {
169169 const rawInfo = languages [ name ]
170170 const scope = rawInfo . tm_scope
171171
172- assert (
172+ assert . ok (
173173 // This one actually turns into two classes on GH, which must be a bug.
174174 scope === 'source.pov-ray sdl' ||
175175 // https://github.com/github-linguist/linguist/pull/6862#issuecomment-2157822516
@@ -239,7 +239,7 @@ const scopes = grammarBasenames.flatMap(function (d) {
239239 return path . basename ( d , extension )
240240 }
241241
242- assert ( d === 'version' , d )
242+ assert . ok ( d === 'version' , d )
243243 return [ ]
244244} )
245245
@@ -257,7 +257,7 @@ await Promise.all(
257257 ( JSON . parse ( String ( await fs . readFile ( inputUrl ) ) ) ) ,
258258 scope
259259 )
260- assert ( grammar . scopeName === scope , 'expected scopes to match' )
260+ assert . ok ( grammar . scopeName === scope , 'expected scopes to match' )
261261
262262 const result = analyze ( grammar )
263263 dependencyInfo . set ( scope , result )
@@ -266,8 +266,8 @@ await Promise.all(
266266
267267 for ( const name of info . names ) {
268268 const mappedScope = uniqueIdentifiers . get ( name )
269- assert ( mappedScope , 'expected mapping' )
270- assert ( mappedScope === scope , 'expected names to be unique' )
269+ assert . ok ( mappedScope , 'expected mapping' )
270+ assert . ok ( mappedScope === scope , 'expected names to be unique' )
271271 }
272272
273273 /**
@@ -292,7 +292,7 @@ await Promise.all(
292292 for ( const name of info . extensions ) {
293293 const mappedScopeDot = uniqueIdentifiers . get ( name )
294294 const short = name . slice ( 1 )
295- assert ( mappedScopeDot , 'expected mapping' )
295+ assert . ok ( mappedScopeDot , 'expected mapping' )
296296 const mappedScopeDotless = uniqueIdentifiers . get ( short ) || mappedScopeDot
297297
298298 if ( mappedScopeDot === scope ) {
@@ -306,7 +306,7 @@ await Promise.all(
306306 // something else (`.html` weirdly maps to `ecmarkup`).
307307 // That means, the short form must be in names.
308308 // It might not currently be though, because we’re still looping!
309- assert (
309+ assert . ok (
310310 info . names . includes ( short ) ,
311311 'expected extension (w/o dot) in names'
312312 )
@@ -436,7 +436,7 @@ function add(scope) {
436436 if ( used . has ( scope ) ) return
437437 used . add ( scope )
438438 const deps = dependencies . get ( scope )
439- assert ( deps , scope )
439+ assert . ok ( deps , scope )
440440 for ( const dep of deps ) {
441441 add ( dep )
442442 }
@@ -458,7 +458,7 @@ const usedScopes = [...used].sort()
458458
459459for ( const scope of usedScopes ) {
460460 const deps = dependencies . get ( scope )
461- assert ( deps , scope )
461+ assert . ok ( deps , scope )
462462
463463 if ( deps . size > 0 ) {
464464 const manifest = Object . hasOwn ( graph , scope ) ? graph [ scope ] : undefined
@@ -757,14 +757,14 @@ function clean(value, schema, path) {
757757 const allAllowed = new Set ( [ ...allow , ...need ] )
758758
759759 for ( const d of need ) {
760- assert (
760+ assert . ok (
761761 keys . includes ( d ) ,
762762 'expected field `' + d + '` in `' + value + '` at `' + path + '`'
763763 )
764764 }
765765
766766 for ( const d of keys ) {
767- assert (
767+ assert . ok (
768768 allAllowed . has ( d ) ,
769769 'unexpected field `' + d + '` in `' + value + '` at `' + path + '`'
770770 )
@@ -893,7 +893,7 @@ function scopeToId(value) {
893893 . replace ( / [ . - _ ] ( [ a - z \d ] ) / g, function ( _ , /** @type {string } */ $1 ) {
894894 return $1 . toUpperCase ( )
895895 } )
896- assert ( / ^ [ A - Z a - z \d . ] + $ / . test ( id ) , value )
896+ assert . ok ( / ^ [ A - Z a - z \d . ] + $ / . test ( id ) , value )
897897 return id
898898}
899899
@@ -912,7 +912,7 @@ function normalizeLinguistName(d) {
912912 // For example `DNS zone` can be used as `dns-zone`, not as `dns`, `dns_zone`,
913913 // or `dnszone`.
914914 const normal = d . toLowerCase ( ) . replace ( / / g, '-' )
915- assert ( / ^ [ - _ a - z \d . # + ' * ( ) / ] + $ / . test ( normal ) , normal )
915+ assert . ok ( / ^ [ - _ a - z \d . # + ' * ( ) / ] + $ / . test ( normal ) , normal )
916916 return normal
917917}
918918
@@ -926,6 +926,6 @@ function normalizeLinguistExtension(d) {
926926 // Extensions are case-insensitive (example: for `.OutJob`, `.outjob` also works).
927927 // They can also contain dots, dashes, plusses, etc.
928928 const normal = d . toLowerCase ( )
929- assert ( / ^ \. [ \w + . - ] + $ / . test ( normal ) , normal )
929+ assert . ok ( / ^ \. [ \w + . - ] + $ / . test ( normal ) , normal )
930930 return normal
931931}
0 commit comments