-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(apidom-parser-adapter-openapi-yaml3-1): run tests in ESM mode
- Loading branch information
Showing
15 changed files
with
136 additions
and
116 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
packages/apidom-parser-adapter-openapi-yaml-3-1/.eslintignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/**/*.js | ||
/**/*.mjs | ||
/**/*.cjs | ||
/dist | ||
/es | ||
/cjs | ||
/types | ||
/config | ||
/.nyc_output | ||
/node_modules | ||
/**/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/src/**/*.mjs | ||
/src/**/*.cjs | ||
/test/**/*.mjs | ||
/dist | ||
/es | ||
/cjs | ||
/types | ||
/NOTICE | ||
/swagger-api-apidom-parser-adapter-openapi-yaml-3-1-*.tgz |
5 changes: 3 additions & 2 deletions
5
packages/apidom-parser-adapter-openapi-yaml-3-1/.mocharc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"recursive": true, | ||
"spec": "test/**/*.ts", | ||
"file": ["test/mocha-bootstrap.cjs"] | ||
"spec": "test/**/*.mjs", | ||
"file": ["test/mocha-bootstrap.mjs"], | ||
"ignore": ["test/perf/**/*.mjs"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
packages/apidom-parser-adapter-openapi-yaml-3-1/test/adapter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
packages/apidom-parser-adapter-openapi-yaml-3-1/test/mocha-bootstrap.cjs
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
packages/apidom-parser-adapter-openapi-yaml-3-1/test/mocha-bootstrap.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as chai from 'chai'; | ||
import { jestSnapshotPlugin, addSerializer } from 'mocha-chai-jest-snapshot'; | ||
|
||
// @ts-ignore | ||
import * as jestApiDOMSerializer from '../../../scripts/jest-serializer-apidom'; | ||
// @ts-ignore | ||
import * as jestStringSerializer from '../../../scripts/jest-serializer-string'; | ||
|
||
chai.use(jestSnapshotPlugin()); | ||
addSerializer(jestApiDOMSerializer); | ||
addSerializer(jestStringSerializer); |
25 changes: 0 additions & 25 deletions
25
packages/apidom-parser-adapter-openapi-yaml-3-1/test/perf/index.cjs
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
packages/apidom-parser-adapter-openapi-yaml-3-1/test/perf/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Benchmark from 'benchmark'; | ||
import type { Event } from 'benchmark'; | ||
|
||
import lexicalAnalysisBench from './lexical-analysis'; | ||
import syntacticAnalysisBench from './syntactic-analysis'; | ||
import refractBench from './refract'; | ||
import parseBench from './parse'; | ||
|
||
const suite = new Benchmark.Suite(); | ||
|
||
suite | ||
.add(lexicalAnalysisBench) | ||
.add(syntacticAnalysisBench) | ||
.add(refractBench) | ||
.add(parseBench) | ||
// add listeners | ||
.on('cycle', function (event: Event) { | ||
console.info(String(event.target)); | ||
}) | ||
.on('complete', function () { | ||
console.info('\nAll benchmarks have completed'); | ||
}) | ||
// run | ||
.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.