-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TS - add contains, csv, csvparse, date, digest & entries
- Loading branch information
Showing
51 changed files
with
1,969 additions
and
928 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,5 @@ | ||
import {ParameterResolver} from "./ParameterResolver"; | ||
|
||
export interface JsonTransformerFunction { | ||
transform(definition: any, resolver: ParameterResolver, allowReturningStreams?: boolean): any; | ||
transform(definition: any, resolver: ParameterResolver, allowReturningStreams?: boolean): Promise<any>; | ||
} |
23 changes: 14 additions & 9 deletions
23
javascript/json-transform/src/__tests__/BaseTransformationTest.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 |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import JsonTransformer from "../JsonTransformer"; | ||
import {expect} from "vitest"; | ||
import { expect } from "vitest"; | ||
|
||
export const assertTransformation = (payload: any, definition: any, output: any, additionalContext: any = {}) => { | ||
const x = new JsonTransformer(definition) | ||
expect(x.transform(payload, additionalContext)).toEqual(output); | ||
} | ||
export const assertTransformation = async (payload: any, definition: any, output: any, additionalContext: any = {}) => { | ||
const x = new JsonTransformer(definition); | ||
expect(await x.transform(payload, additionalContext)).toEqual(output); | ||
}; | ||
|
||
export const assertFailTransformation = (payload: any, definition: any, output: any, additionalContext: any = {}) => { | ||
const x = new JsonTransformer(definition) | ||
expect(x.transform(payload, additionalContext)).not.toEqual(output); | ||
} | ||
export const assertFailTransformation = async ( | ||
payload: any, | ||
definition: any, | ||
output: any, | ||
additionalContext: any = {}, | ||
) => { | ||
const x = new JsonTransformer(definition); | ||
expect(await x.transform(payload, additionalContext)).not.toEqual(output); | ||
}; |
Oops, something went wrong.