Skip to content

Commit

Permalink
Update tests/snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed May 11, 2023
1 parent a5d954e commit 90c4812
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/utils/__tests__/get-code-from-ast.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import a from 'a';
expect(format(formatted, { parser: 'babel' })).toEqual(
`// first comment
// second comment
import a from "a";
import c from "c";
import g from "g";
Expand Down Expand Up @@ -65,6 +66,7 @@ import type {See} from 'c';
expect(format(formatted, { parser: 'babel' })).toEqual(
`// first comment
// second comment
import a, { b, type Bee } from "a";
import c, { type C, type See } from "c";
import g from "g";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import { Junk } from "junk-group-1";
import "./side-effects1";
// C, E and D will be separated from A, B because side-effects in-between
import { D, type C, type E } from "a";
// prettier-ignore
Expand Down
1 change: 1 addition & 0 deletions tests/Angular/__snapshots__/ppsi.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export class TemplateController {
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment in this file.
import thirdDisco0 from "third-disco0";
import thirdParty0 from "third-party0";
import otherthing3 from "@core/otherthing3";
Expand Down
2 changes: 2 additions & 0 deletions tests/Babel/__snapshots__/ppsi.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function add(a,b) {
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment in this file.
import thirdParty from "third-party";
import z from "z";
import abc from "@core/abc";
Expand Down Expand Up @@ -87,6 +88,7 @@ function add(a,b) {
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment in this file.
import thirdDisco0 from "third-disco0";
import thirdParty0 from "third-party0";
import otherthing3 from "@core/otherthing3";
Expand Down
7 changes: 5 additions & 2 deletions tests/Flow/__snapshots__/ppsi.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export function givesAFoo3Obj(): AliasFoo3 {
/**
* @flow
*/
// I am top level comment in this file.
import thirdParty from "third-party";
import abc from "@core/abc";
import otherthing from "@core/otherthing";
Expand Down Expand Up @@ -127,7 +129,9 @@ export function givesAFoo3Obj(): AliasFoo3 {
/**
* @flow
*/
// I am top level comment in this file.
import thirdDisco0 from "third-disco0";
import thirdParty0 from "third-party0";
import otherthing3 from "@core/otherthing3";
Expand Down Expand Up @@ -192,7 +196,6 @@ import {fooValue} from './foo';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* @flow
*/
import { fooValue, type Foo } from "./foo";
*/ import { fooValue, type Foo } from "./foo";
`;
4 changes: 4 additions & 0 deletions tests/ImportsNotSeparated/__snapshots__/ppsi.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function add(a:number,b:number) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment in this file.
// I am second line of top level comment in this file.
import thirdParty from "third-party";
import z from "z";
import abc from "@core/abc";
Expand Down Expand Up @@ -188,6 +189,7 @@ function add(a:number,b:number) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//@ts-ignore
// I am file top level comments
import a from "a";
import c from "c";
// I am stick to third party comment
Expand Down Expand Up @@ -266,6 +268,7 @@ import fourLevelRelativePath from "../../../../fourLevelRelativePath";
import something from "@server/something";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment
import abc from "@core/abc";
import otherthing from "@core/otherthing";
import something from "@server/something";
Expand Down Expand Up @@ -321,6 +324,7 @@ import './commands';
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import "./commands";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ function add(a:number,b:number) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment in this file.
// I am second line of top level comment in this file.
import thirdParty from "third-party";
import z from "z";
Expand Down Expand Up @@ -245,6 +246,7 @@ function add(a:number,b:number) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//@ts-ignore
// I am file top level comments
import a from "a";
import c from "c";
// I am stick to third party comment
Expand Down Expand Up @@ -372,6 +374,7 @@ export function givesAFoo3Obj(): AliasFoo3 {
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment in this file.
import thirdDisco0 from "third-disco0";
import thirdParty0 from "third-party0";
Expand Down Expand Up @@ -449,6 +452,7 @@ import fourLevelRelativePath from "../../../../fourLevelRelativePath";
import something from "@server/something";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment
import abc from "@core/abc";
import otherthing from "@core/otherthing";
import something from "@server/something";
Expand Down Expand Up @@ -505,6 +509,7 @@ import './commands';
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import "./commands";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import thirdDisco2 from "third-disco2";
import thirdParty2 from "third-party2";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment in this file.
import thirdDisco0 from "third-disco0";
import thirdParty0 from "third-party0";
import otherthing3 from "@core/otherthing3";
Expand Down
4 changes: 4 additions & 0 deletions tests/ImportsThirdParty/__snapshots__/ppsi.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function add(a:number,b:number) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment in this file.
// I am second line of top level comment in this file.
import abc from "@core/abc";
import otherthing from "@core/otherthing";
import qwerty from "@server/qwerty";
Expand Down Expand Up @@ -188,6 +189,7 @@ function add(a:number,b:number) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//@ts-ignore
// I am file top level comments
import otherthing from "@core/otherthing";
import something from "@server/something";
import component from "@ui/hello";
Expand Down Expand Up @@ -266,6 +268,7 @@ import fourLevelRelativePath from "../../../../fourLevelRelativePath";
import something from "@server/something";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// I am top level comment
import abc from "@core/abc";
import otherthing from "@core/otherthing";
import something from "@server/something";
Expand Down Expand Up @@ -321,6 +324,7 @@ import './commands';
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import "./commands";
Expand Down
7 changes: 3 additions & 4 deletions tests/PreserveStrict/__snapshots__/ppsi.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ import type { Period } from './Period'
function foo() {
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Comment above
/* foo
bar */
"use strict"; // Comment below
bar */ "use strict";
// Comment below
"another directive";
import "./SetupEnvironment";
Expand Down Expand Up @@ -68,8 +67,8 @@ function foo() {
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// below is a directive prologue
"use custom";
/* more directives... */
/* more directives... */
"enable typecheck";
"forbid IE";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { bar } from "a";
function baz() {
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* foo */
import { bar } from "a";
import { foo } from "c";
Expand Down
4 changes: 4 additions & 0 deletions tests/Vue/__snapshots__/ppsi.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function add(a,b) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<script setup>
// I am top level comment in this file.
import thirdParty from "third-party";
import { defineComponent } from "vue";
import z from "z";
Expand Down Expand Up @@ -81,6 +82,7 @@ export default defineComponent({
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<script>
// I am top level comment in this file.
import thirdParty from "third-party";
import { defineComponent } from "vue";
import z from "z";
Expand Down Expand Up @@ -132,6 +134,7 @@ export default defineComponent({
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<script lang="ts">
// I am top level comment in this file.
import thirdParty from "third-party";
import { defineComponent } from "vue";
import z from "z";
Expand Down Expand Up @@ -186,6 +189,7 @@ export default defineComponent({
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<script lang="tsx">
// I am top level comment in this file.
import thirdParty from "third-party";
import { defineComponent } from "vue";
import z from "z";
Expand Down

0 comments on commit 90c4812

Please sign in to comment.