Adds test skeleton.
This commit is contained in:
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -5,5 +5,7 @@
|
||||
"plantuml.diagramsRoot": "docs",
|
||||
"plantuml.exportFormat": "png",
|
||||
"plantuml.exportOutDir": "docs/exported",
|
||||
"typescript.updateImportsOnFileMove.enabled": "prompt"
|
||||
"typescript.updateImportsOnFileMove.enabled": "prompt",
|
||||
"mochaExplorer.files": "./data-extraction/test/**/*.test.ts",
|
||||
"mochaExplorer.require": ["ts-node/register", "source-map-support/register"]
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "A library that helps implementing data extractors for the Debug Visualizer VS Code extension.",
|
||||
"version": "0.12.0",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"author": {
|
||||
"name": "Henning Dieterichs",
|
||||
"email": "henning.dieterichs@live.de"
|
||||
@@ -23,10 +23,17 @@
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "webpack --watch --mode development",
|
||||
"build": "webpack --mode production"
|
||||
"build": "webpack --mode production",
|
||||
"test": "mocha --require source-map-support/register --require ts-node/register ./test/**/*.test.ts"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^7.0.2",
|
||||
"coveralls": "^3.0.11",
|
||||
"mocha": "^7.1.1",
|
||||
"mocha-lcov-reporter": "^1.3.0",
|
||||
"nyc": "^15.0.0",
|
||||
"source-map-support": "^0.5.16",
|
||||
"typescript": "^3.8.2",
|
||||
"@types/plotly.js": "1.44.28",
|
||||
"@types/node": "^13.7.4",
|
||||
|
||||
@@ -9,6 +9,9 @@ import {
|
||||
import { ExtractedData, DataExtractorInfo } from "../../DataExtractionResult";
|
||||
import { registerDefaultExtractors } from "./default-extractors";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export class DataExtractorApiImpl implements DataExtractorApi {
|
||||
public static lastEvalFn: (<T>(expression: string) => T) | undefined;
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from "./DataExtractorApi";
|
||||
export * from "./injection";
|
||||
export { DataExtractorApiImpl } from "./DataExtractorApiImpl";
|
||||
|
||||
16
data-extraction/test/main.test.ts
Normal file
16
data-extraction/test/main.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import {
|
||||
getDataExtractorApi,
|
||||
DataExtractorApiImpl,
|
||||
} from "@hediet/debug-visualizer-data-extraction";
|
||||
|
||||
describe("extractor", () => {
|
||||
it("should not crash", () => {
|
||||
const dataExtractor = new DataExtractorApiImpl();
|
||||
dataExtractor.registerDefaultExtractors();
|
||||
const result = dataExtractor.getData(
|
||||
() => [1, 2, 3],
|
||||
() => null!,
|
||||
undefined
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -3,14 +3,14 @@
|
||||
"target": "esnext",
|
||||
"module": "commonjs",
|
||||
"strict": true,
|
||||
"outDir": "dist",
|
||||
"outDir": "./dist",
|
||||
"skipLibCheck": true,
|
||||
"rootDir": "./src",
|
||||
"rootDir": ".",
|
||||
"resolveJsonModule": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"newLine": "LF",
|
||||
"sourceMap": true
|
||||
},
|
||||
"include": ["./src/**/*"]
|
||||
"include": ["./src/**/*", "./test/**/*"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user