Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
/types/alexa-voice-service/ @dolanmiu
/types/algebra.js/ @CaselIT
/types/ali-app/ @taoqf
/types/ali-oss/ @ptrdu @StarHeartHunt
/types/ali-oss/ @ptrdu @StarHeartHunt @cnjsstong
/types/alicloud__log/ @RuixeWolf
/types/align-text/ @claasahl
/types/alipayjssdk/ @shlyren
Expand Down Expand Up @@ -2008,7 +2008,7 @@
/types/ez-plus/ @AndersonFriaca
/types/ezuikit-js/ @daiwanxing
/types/f1/ @neolwc
/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira @BradleyHill @bmkrol823 @glenngartner @codertx @mike667 @nataliemarleny @oxwazz
/types/fabric/ @oklemencic @joewashear007 @NotWoods @bmartinson @RogerioTeixeira @BradleyHill @bmkrol823 @glenngartner @codertx @mike667 @nataliemarleny @oxwazz
/types/facebook-instant-games/ @menushka @oyvindjam @doterax
/types/facebook-js-sdk/ @amritk @mahmoudzohdi @fluidsonic @bengry
/types/facebook-locales/ @CvX
Expand All @@ -2035,7 +2035,6 @@
/types/fast-als/ @elias-fauser
/types/fast-astar/ @shezard
/types/fast-chunk-string/ @yoursunny
/types/fast-crc32c/ @naeemy
/types/fast-decode-uri-component/ @huseeiin
/types/fast-fifo/ @achingbrain
/types/fast-html-parser/ @rollercodester
Expand Down Expand Up @@ -3365,7 +3364,6 @@
/types/iniparser/ @chrootsu
/types/init-package-json/ @kfarnung
/types/initrc/ @Soldy
/types/injectpromise/ @naeemy
/types/ink-big-text/ @aaronleopold
/types/ink-box/ @omjadas
/types/ink-divider/ @omjadas
Expand Down Expand Up @@ -3968,7 +3966,7 @@
/types/karma-spec-reporter/ @peterblazejewicz
/types/karma-summary-reporter/ @peterblazejewicz @sth
/types/karma-webpack/ @mtraynham
/types/katex/ @mrand01 @knguyen0125 @dreamerblue @s-weigand @sapphi-red @Stefaans
/types/katex/ @knguyen0125 @dreamerblue @s-weigand @sapphi-red @Stefaans
/types/kavenegar/ @nimaebra
/types/kbm-robot/ @usama8800
/types/kcors/ @Xstoudi
Expand Down Expand Up @@ -5181,7 +5179,6 @@
/types/node-ipc/ @arvitaly @gjurgens
/types/node-isbn/ @peterblazejewicz
/types/node-jose/ @nadunindunil
/types/node-jsfl-runner/ @mrand01
/types/node-json-logger/ @from20020516
/types/node-json-transform/ @ymaheshwari1
/types/node-kmeans/ @aquine-kujaruk
Expand Down Expand Up @@ -5558,7 +5555,7 @@
/types/passport-deezer/ @nyo
/types/passport-discord/ @kzay @almeidx
/types/passport-facebook/ @staticfunction @lucasmacosta
/types/passport-facebook-token/ @rmartone @mrand01
/types/passport-facebook-token/ @rmartone
/types/passport-fido2-webauthn/ @benhchoi
/types/passport-github/ @yasupeke
/types/passport-github2/ @yasupeke @mthmulders @codepunkt @ivan94
Expand Down Expand Up @@ -6258,7 +6255,6 @@
/types/react-google-recaptcha/v0/ @KoalaHuman @tomsturge
/types/react-google-recaptcha-enterprise/ @KsAkira10
/types/react-gravatar/ @invliD
/types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway @manav-m @al-fyodorov
/types/react-gtm-module/ @marcveens
/types/react-hamburger-menu/ @grzesie2k
/types/react-hammerjs/ @jsonunger @cecchi
Expand Down Expand Up @@ -6445,7 +6441,6 @@
/types/react-native-referrer/ @christianchown
/types/react-native-responsive-image/ @dimameshcharakou
/types/react-native-rss-parser/ @emilianoLeite
/types/react-native-safari-view/ @mrand01
/types/react-native-scaled-image/ @Jaeger25
/types/react-native-scrollable-tab-view/ @egorshulga @ydostyle
/types/react-native-settings-list/ @MrLuje
Expand Down Expand Up @@ -7060,7 +7055,6 @@
/types/schwifty/ @ozum @timcosta
/types/scoped-http-client/ @mattvperry @rianadon
/types/scorm-browser/ @CookieCookson
/types/scrambo/ @padarom
/types/scratch-env/ @Richienb
/types/screenshot-desktop/ @usama8800
/types/screeps/ @NhanHo @bryanbecker @resir014 @Arcath @dmarcuse @pyrodogg @kotarou @DiamondMofeng
Expand Down Expand Up @@ -7453,7 +7447,6 @@
/types/ssdeep/ @atd-schubert
/types/ssdeep.js/ @JPBM135
/types/sse/ @yutak23
/types/sse4_crc32/ @naeemy
/types/ssh-key-decrypt/ @BendingBender
/types/ssh2/ @tkQubo @rbuckton @wrboyce @hengkx @bragle @LucianBuzzo @dhensby
/types/ssh2-sftp-client/ @igrayson @ascariandrea @kartik2406 @viamuli @gbhmt @builtbylane @loru88 @hengkx @candyapplecorn @tsop14
Expand Down Expand Up @@ -7730,7 +7723,6 @@
/types/tdigest/ @BendingBender
/types/teddy/ @lannonbr
/types/tedious-connection-pool/ @sandorfr
/types/teen_process/ @NotWoods
/types/telebot/ @mariotsi @martin-badin
/types/telegram-mini-app/ @dartweider2000
/types/telegram-web-app/ @KnorpelSenf @MKRhere @deptyped @sidorko
Expand Down
12 changes: 6 additions & 6 deletions types/d3-shape/d3-shape-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ defaultStack = defaultStack.offset(null);

overlyComplicatedStack = overlyComplicatedStack.offset(d3Shape.stackOffsetWiggle);

let offsetStackDatumSeries: (series: d3Shape.Series<StackDatum, StackKey>, order: number[]) => void;
let offsetStackDatumSeries: (series: d3Shape.Series<StackDatum, StackKey>[], order: number[]) => void;
offsetStackDatumSeries = overlyComplicatedStack.offset();

// Use stack generator ============================================================
Expand Down Expand Up @@ -1567,8 +1567,8 @@ order = d3Shape.stackOrderReverse(seriesAnyAny);

// Test stack offsets ===============================================================

d3Shape.stackOffsetExpand(seriesAnyAny, order);
d3Shape.stackOffsetDiverging(seriesAnyAny, order);
d3Shape.stackOffsetNone(seriesAnyAny, order);
d3Shape.stackOffsetSilhouette(seriesAnyAny, order);
d3Shape.stackOffsetWiggle(seriesAnyAny, order);
d3Shape.stackOffsetExpand(seriesArray, order);
d3Shape.stackOffsetDiverging(seriesArray, order);
d3Shape.stackOffsetNone(seriesArray, order);
d3Shape.stackOffsetSilhouette(seriesArray, order);
d3Shape.stackOffsetWiggle(seriesArray, order);
24 changes: 12 additions & 12 deletions types/d3-shape/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2539,7 +2539,7 @@ export interface Stack<This, Datum, Key> {
/**
* Returns the current offset accessor, which defaults to stackOffsetNone; this uses a zero baseline.
*/
offset(): (series: Series<Datum, Key>, order: number[]) => void;
offset(): (series: Series<Datum, Key>[], order: number[]) => void;
/**
* Reset the offset to use stackOffsetNone; this uses a zero baseline.
*
Expand All @@ -2552,7 +2552,7 @@ export interface Stack<This, Datum, Key> {
* @param offset A function which is passed the generated series array and the order index array;
* it is then responsible for updating the lower and upper values in the series array.
*/
offset(offset: (series: Series<Datum, Key>, order: number[]) => void): this;
offset(offset: (series: Series<Datum, Key>[], order: number[]) => void): this;
}

/**
Expand Down Expand Up @@ -2641,40 +2641,40 @@ export function stackOrderReverse(series: Series<any, any>): number[];
/**
* Applies a zero baseline and normalizes the values for each point such that the topline is always one.
*
* @param series A series generated by a stack generator.
* @param series A series array generated by a stack generator.
* @param order An array of numeric indexes representing the stack order.
*/
export function stackOffsetExpand(series: Series<any, any>, order: Iterable<number>): void;
export function stackOffsetExpand(series: Series<any, any>[], order: Iterable<number>): void;

/**
* Positive values are stacked above zero, while negative values are stacked below zero.
*
* @param series A series generated by a stack generator.
* @param series A series array generated by a stack generator.
* @param order An array of numeric indexes representing the stack order.
*/
export function stackOffsetDiverging(series: Series<any, any>, order: Iterable<number>): void;
export function stackOffsetDiverging(series: Series<any, any>[], order: Iterable<number>): void;

/**
* Applies a zero baseline.
*
* @param series A series generated by a stack generator.
* @param series A series array generated by a stack generator.
* @param order An array of numeric indexes representing the stack order.
*/
export function stackOffsetNone(series: Series<any, any>, order: Iterable<number>): void;
export function stackOffsetNone(series: Series<any, any>[], order: Iterable<number>): void;

/**
* Shifts the baseline down such that the center of the streamgraph is always at zero.
*
* @param series A series generated by a stack generator.
* @param series A series array generated by a stack generator.
* @param order An array of numeric indexes representing the stack order.
*/
export function stackOffsetSilhouette(series: Series<any, any>, order: Iterable<number>): void;
export function stackOffsetSilhouette(series: Series<any, any>[], order: Iterable<number>): void;

/**
* Shifts the baseline so as to minimize the weighted wiggle of layers. This offset is recommended for streamgraphs in conjunction with the inside-out order.
* See Stacked Graphs—Geometry & Aesthetics by Bryon & Wattenberg for more information.
*
* @param series A series generated by a stack generator.
* @param series A series array generated by a stack generator.
* @param order An array of numeric indexes representing the stack order.
*/
export function stackOffsetWiggle(series: Series<any, any>, order: Iterable<number>): void;
export function stackOffsetWiggle(series: Series<any, any>[], order: Iterable<number>): void;
7 changes: 5 additions & 2 deletions types/jest-image-snapshot/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ export interface MatchImageSnapshotOptions {
* import { toMatchImageSnapshot } from 'jest-image-snapshot';
* expect.extend({ toMatchImageSnapshot });
*/
export function toMatchImageSnapshot(options?: MatchImageSnapshotOptions): { message(): string; pass: boolean };
export function toMatchImageSnapshot(
received: Buffer,
options?: MatchImageSnapshotOptions,
): { message(): string; pass: boolean };

/**
* Configurable function that can be passed to jest's expect.extend.
Expand All @@ -145,7 +148,7 @@ export function toMatchImageSnapshot(options?: MatchImageSnapshotOptions): { mes
*/
export function configureToMatchImageSnapshot(
options: MatchImageSnapshotOptions,
): () => { message(): string; pass: boolean };
): (received: Buffer, options?: MatchImageSnapshotOptions) => { message(): string; pass: boolean };

/**
* Mutates original state with new state
Expand Down
103 changes: 93 additions & 10 deletions types/jest-image-snapshot/jest-image-snapshot-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,24 @@ import {
toMatchImageSnapshot,
updateSnapshotState,
} from "jest-image-snapshot";
import sharp from "sharp";

it("should be able to use toMatchImageSnapshot in a test", () => {
it("should be able to use toMatchImageSnapshot in a test", async () => {
expect.extend({ toMatchImageSnapshot });

expect(400).toMatchImageSnapshot();
expect(
await sharp({
create: {
background: { b: 0, g: 255, r: 0 },
channels: 3,
height: 48,
width: 48,
},
}).png().toBuffer(),
).toMatchImageSnapshot();
});

it("should be able to use configureToMatchImageSnapshot in a test", () => {
it("should be able to use configureToMatchImageSnapshot in a test", async () => {
const matchFn = configureToMatchImageSnapshot({
allowSizeMismatch: true,
noColors: true,
Expand All @@ -25,10 +35,19 @@ it("should be able to use configureToMatchImageSnapshot in a test", () => {
});
expect.extend({ toMatchImageSnapshot: matchFn });

expect("Me").toMatchImageSnapshot();
expect(
await sharp({
create: {
background: { b: 0, g: 255, r: 0 },
channels: 3,
height: 48,
width: 48,
},
}).png().toBuffer(),
).toMatchImageSnapshot();
});

it("Should be able to use configuration directly in toMatchImageSnapshot", () => {
it("Should be able to use configuration directly in toMatchImageSnapshot", async () => {
expect.extend({ toMatchImageSnapshot });

const options: MatchImageSnapshotOptions = {
Expand All @@ -52,27 +71,91 @@ it("Should be able to use configuration directly in toMatchImageSnapshot", () =>
failureThresholdType: "percent",
};

expect("Me").toMatchImageSnapshot(options);
expect(
await sharp({
create: {
background: { b: 0, g: 255, r: 0 },
channels: 3,
height: 48,
width: 48,
},
}).png().toBuffer(),
).toMatchImageSnapshot(options);
});

it("Should be able to use string as customSnapshotIdentifier", () => {
it("Should be able to use string as customSnapshotIdentifier", async () => {
const options: MatchImageSnapshotOptions = {
customSnapshotIdentifier: "string identifier",
};

expect("Me").toMatchImageSnapshot(options);
expect(
await sharp({
create: {
background: { b: 0, g: 255, r: 0 },
channels: 3,
height: 48,
width: 48,
},
}).png().toBuffer(),
).toMatchImageSnapshot(options);
});

it("Should be able to use callback as customSnapshotIdentifier", () => {
it("Should be able to use callback as customSnapshotIdentifier", async () => {
const options: MatchImageSnapshotOptions = {
customSnapshotIdentifier: () => "string identifier",
};

expect("Me").toMatchImageSnapshot(options);
expect(
await sharp({
create: {
background: { b: 0, g: 255, r: 0 },
channels: 3,
height: 48,
width: 48,
},
}).png().toBuffer(),
).toMatchImageSnapshot(options);
});

it("mutates original state", () => {
const originalState = { some: "value" };
updateSnapshotState(originalState, { another: "val" });
expect(originalState).toEqual({ some: "value", another: "val" });
});

it("should be able to use toMatchImageSnapshot without expect", async () => {
const result = toMatchImageSnapshot.call(
expect.getState(),
await sharp({
create: {
background: { b: 0, g: 255, r: 0 },
channels: 3,
height: 48,
width: 48,
},
}).png().toBuffer(),
{
allowSizeMismatch: true,
},
);
expect(result.pass).toEqual(true);
});

it("should be able to use configureToMatchImageSnapshot without expect", async () => {
const matchFn = configureToMatchImageSnapshot({
allowSizeMismatch: true,
});

const result = matchFn.call(
expect.getState(),
await sharp({
create: {
background: { b: 0, g: 255, r: 0 },
channels: 3,
height: 48,
width: 48,
},
}).png().toBuffer(),
);
expect(result.pass).toEqual(true);
});
3 changes: 2 additions & 1 deletion types/jest-image-snapshot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"ssim.js": "^3.1.1"
},
"devDependencies": {
"@types/jest-image-snapshot": "workspace:."
"@types/jest-image-snapshot": "workspace:.",
"sharp": "*"
},
"owners": [
{
Expand Down
Empty file.
Loading