File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed
Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 5353 "./highlight/ruby" : " ./code-view/highlight/ruby.js" ,
5454 "./highlight/rust" : " ./code-view/highlight/rust.js" ,
5555 "./highlight/sh" : " ./code-view/highlight/sh.js" ,
56- "./highlight/swift" : " ./code-view/highlight/swift.js" ,
5756 "./highlight/typescript" : " ./code-view/highlight/typescript.js" ,
5857 "./highlight/xml" : " ./code-view/highlight/xml.js" ,
5958 "./highlight/yaml" : " ./code-view/highlight/yaml.js" ,
Original file line number Diff line number Diff line change 1+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ // SPDX-License-Identifier: Apache-2.0
3+ import fs from "node:fs" ;
4+ import path from "node:path" ;
5+ import url from "node:url" ;
6+ import { describe , expect , test } from "vitest" ;
7+
8+ const dirname = path . dirname ( url . fileURLToPath ( import . meta. url ) ) ;
9+ const rulesDir = path . resolve ( dirname , "../highlight" ) ;
10+ const rules = fs . readdirSync ( rulesDir ) . filter ( ( file ) => file !== "index.tsx" ) ;
11+
12+ describe ( "highlight rules can be loaded" , ( ) => {
13+ test . each ( rules ) ( "%s" , async ( rule ) => {
14+ // eslint-disable-next-line no-unsanitized/method
15+ const { default : highlight } = await import ( path . join ( rulesDir , rule ) ) ;
16+ expect ( highlight ( "" ) ) . toBeDefined ( ) ;
17+ } ) ;
18+ } ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments