From 63ba70d292f89bdfbfae78c4ed475dcfa0331606 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 11 Mar 2020 14:50:20 +0200 Subject: [PATCH] update snapshots --- .../__snapshots__/jsfmt.spec.js.snap | 54 +++++++++++++++++++ .../__snapshots__/jsfmt.spec.js.snap | 16 ++++++ .../__snapshots__/jsfmt.spec.js.snap | 45 ++++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 tests/typescript_import_export/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/typescript_class/__snapshots__/jsfmt.spec.js.snap b/tests/typescript_class/__snapshots__/jsfmt.spec.js.snap index e7fe7830a603..8ff7e937a879 100644 --- a/tests/typescript_class/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript_class/__snapshots__/jsfmt.spec.js.snap @@ -253,3 +253,57 @@ class User { ================================================================================ `; + +exports[`standard_private_fields.ts 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Square { + #sideLength: number; + readonly #area: number; + #unit?: string; + + constructor(sideLength: number, unit?: string) { + this.#sideLength = sideLength; + this.#area = this.#sideLength ** 2; + if (unit) { + this.#unit = unit; + } + } + + equals(other: any) { + return this.#sideLength === other.#sideLength; + } + + getArea() { + return this.#area + (this.#unit ?? 'px') + '²'; + } +} + +=====================================output===================================== +class Square { + #sideLength: number; + readonly #area: number; + #unit?: string; + + constructor(sideLength: number, unit?: string) { + this.#sideLength = sideLength; + this.#area = this.#sideLength ** 2; + if (unit) { + this.#unit = unit; + } + } + + equals(other: any) { + return this.#sideLength === other.#sideLength; + } + + getArea() { + return this.#area + (this.#unit ?? "px") + "²"; + } +} + +================================================================================ +`; diff --git a/tests/typescript_export/__snapshots__/jsfmt.spec.js.snap b/tests/typescript_export/__snapshots__/jsfmt.spec.js.snap index b70c4f989347..e12dad1d3bfd 100644 --- a/tests/typescript_export/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript_export/__snapshots__/jsfmt.spec.js.snap @@ -60,6 +60,22 @@ declare module "hello" { ================================================================================ `; +exports[`export-as-ns.ts 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +// TODO: uncomment when typescript-estree gets support for this syntax +// export * as utilities from "./utilities.js"; + +=====================================output===================================== +// TODO: uncomment when typescript-estree gets support for this syntax +// export * as utilities from "./utilities.js"; + +================================================================================ +`; + exports[`export-class.js 1`] = ` ====================================options===================================== parsers: ["typescript"] diff --git a/tests/typescript_import_export/__snapshots__/jsfmt.spec.js.snap b/tests/typescript_import_export/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000000..47d3492b9b50 --- /dev/null +++ b/tests/typescript_import_export/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,45 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type-modifier.ts 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +export type { SomeThing }; +export type { A as B }; +export type { B as C } from './a'; +export type { foo } from 'bar'; +export type * from 'bar'; +export type { foo }; + +// this should be treated as a normal import statement +import type from './foo'; + +import type { SomeThing } from "./some-module.js"; +import type { foo, bar } from 'baz'; +import type { foo as bar } from 'baz'; +import type * as foo from './bar'; +import type foo from 'bar'; +import type foo, { bar } from 'bar'; + +=====================================output===================================== +export type { SomeThing }; +export type { A as B }; +export type { B as C } from "./a"; +export type { foo } from "bar"; +export type * from "bar"; +export type { foo }; + +// this should be treated as a normal import statement +import type from "./foo"; + +import type { SomeThing } from "./some-module.js"; +import type { foo, bar } from "baz"; +import type { foo as bar } from "baz"; +import type * as foo from "./bar"; +import type foo from "bar"; +import type foo, { bar } from "bar"; + +================================================================================ +`;