Adds test skeleton.

This commit is contained in:
Henning Dieterichs
2020-03-24 17:17:47 +01:00
parent 6a71c23fdb
commit 9f94cc7dee
7 changed files with 977 additions and 34 deletions

View File

@@ -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"]
}

View File

@@ -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",

View File

@@ -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;

View File

@@ -1,2 +1,3 @@
export * from "./DataExtractorApi";
export * from "./injection";
export { DataExtractorApiImpl } from "./DataExtractorApiImpl";

View 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
);
});
});

View File

@@ -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/**/*"]
}

970
yarn.lock

File diff suppressed because it is too large Load Diff