From d45e157563d016d408e647df9f8f03842f6199d9 Mon Sep 17 00:00:00 2001 From: Rogelio Guzman Date: Tue, 21 Feb 2017 13:59:19 -0800 Subject: [PATCH] Upgrade to Jest 19 (#762) * Upgrade to Jest 19 * Use exact versions for Jest --- package.json | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- tests/arrays/__snapshots__/jsfmt.spec.js.snap | 6 +- tests/arrows/__snapshots__/jsfmt.spec.js.snap | 20 +- tests/async/__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 26 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 72 +- .../classes/__snapshots__/jsfmt.spec.js.snap | 14 +- .../comments/__snapshots__/jsfmt.spec.js.snap | 226 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 28 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 90 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 20 +- tests/export/__snapshots__/jsfmt.spec.js.snap | 18 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../exports/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../abnormal/__snapshots__/jsfmt.spec.js.snap | 6 +- .../annot/__snapshots__/jsfmt.spec.js.snap | 58 +- .../any/__snapshots__/jsfmt.spec.js.snap | 10 +- .../annot2/__snapshots__/jsfmt.spec.js.snap | 16 +- .../flow/any/__snapshots__/jsfmt.spec.js.snap | 24 +- .../arith/__snapshots__/jsfmt.spec.js.snap | 84 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../arraylib/__snapshots__/jsfmt.spec.js.snap | 36 +- .../arrays/__snapshots__/jsfmt.spec.js.snap | 22 +- .../arrows/__snapshots__/jsfmt.spec.js.snap | 14 +- .../async/__snapshots__/jsfmt.spec.js.snap | 58 +- .../__snapshots__/jsfmt.spec.js.snap | 38 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 4 +- .../binary/__snapshots__/jsfmt.spec.js.snap | 70 +- .../binding/__snapshots__/jsfmt.spec.js.snap | 114 +- .../flow/bom/__snapshots__/jsfmt.spec.js.snap | 150 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../break/__snapshots__/jsfmt.spec.js.snap | 36 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../builtins/__snapshots__/jsfmt.spec.js.snap | 22 +- .../__snapshots__/jsfmt.spec.js.snap | 86 +- .../callable/__snapshots__/jsfmt.spec.js.snap | 6 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 6 +- .../classes/__snapshots__/jsfmt.spec.js.snap | 50 +- .../closure/__snapshots__/jsfmt.spec.js.snap | 72 +- .../commonjs/__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 92 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../dir/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../src/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 26 +- .../__snapshots__/jsfmt.spec.js.snap | 30 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../testproj/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../subdir/__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 28 +- .../__snapshots__/jsfmt.spec.js.snap | 20 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 22 +- .../ignore/__snapshots__/jsfmt.spec.js.snap | 10 +- .../no_flow/__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 98 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../coverage/__snapshots__/jsfmt.spec.js.snap | 18 +- .../cycle/__snapshots__/jsfmt.spec.js.snap | 14 +- .../date/__snapshots__/jsfmt.spec.js.snap | 40 +- .../__snapshots__/jsfmt.spec.js.snap | 36 +- .../_d3/__snapshots__/jsfmt.spec.js.snap | 8 +- .../foo/bar/__snapshots__/jsfmt.spec.js.snap | 24 +- .../ws/__snapshots__/jsfmt.spec.js.snap | 4 +- .../ws/test/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 26 +- .../_d3/__snapshots__/jsfmt.spec.js.snap | 4 +- .../foo/bar/__snapshots__/jsfmt.spec.js.snap | 16 +- .../ws/__snapshots__/jsfmt.spec.js.snap | 4 +- .../ws/test/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 60 +- .../__snapshots__/jsfmt.spec.js.snap | 50 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 316 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 32 +- .../__snapshots__/jsfmt.spec.js.snap | 24 +- .../__snapshots__/jsfmt.spec.js.snap | 32 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../demo/1/__snapshots__/jsfmt.spec.js.snap | 4 +- .../demo/2/__snapshots__/jsfmt.spec.js.snap | 14 +- .../deps/__snapshots__/jsfmt.spec.js.snap | 60 +- .../__snapshots__/jsfmt.spec.js.snap | 122 +- .../__snapshots__/jsfmt.spec.js.snap | 92 +- .../__snapshots__/jsfmt.spec.js.snap | 494 +- .../__snapshots__/jsfmt.spec.js.snap | 40 +- .../flow/dom/__snapshots__/jsfmt.spec.js.snap | 178 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../encaps/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 32 +- .../equals/__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 398 +- .../__snapshots__/jsfmt.spec.js.snap | 64 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 26 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 58 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 70 +- .../fetch/__snapshots__/jsfmt.spec.js.snap | 276 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../fixpoint/__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../flow/for/__snapshots__/jsfmt.spec.js.snap | 80 +- .../forof/__snapshots__/jsfmt.spec.js.snap | 4 +- .../function/__snapshots__/jsfmt.spec.js.snap | 188 +- .../funrec/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 174 +- .../generics/__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../get-def/__snapshots__/jsfmt.spec.js.snap | 24 +- .../helpers/__snapshots__/jsfmt.spec.js.snap | 18 +- .../get-def2/__snapshots__/jsfmt.spec.js.snap | 44 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 20 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 42 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../models/__snapshots__/jsfmt.spec.js.snap | 20 +- .../__snapshots__/jsfmt.spec.js.snap | 20 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 92 +- .../__snapshots__/jsfmt.spec.js.snap | 112 +- .../batman/__snapshots__/jsfmt.spec.js.snap | 8 +- .../included/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../tmp1/__snapshots__/jsfmt.spec.js.snap | 8 +- .../tmp2/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp3/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 24 +- .../tmp1/__snapshots__/jsfmt.spec.js.snap | 22 +- .../tmp2/__snapshots__/jsfmt.spec.js.snap | 12 +- .../tmp3/__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 46 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 60 +- .../tmp1/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../dir/__snapshots__/jsfmt.spec.js.snap | 8 +- .../indexer/__snapshots__/jsfmt.spec.js.snap | 38 +- .../init/__snapshots__/jsfmt.spec.js.snap | 22 +- .../__snapshots__/jsfmt.spec.js.snap | 36 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 28 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../iter/__snapshots__/jsfmt.spec.js.snap | 20 +- .../iterable/__snapshots__/jsfmt.spec.js.snap | 74 +- .../__snapshots__/jsfmt.spec.js.snap | 58 +- .../__snapshots__/jsfmt.spec.js.snap | 58 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 8 +- .../keys/__snapshots__/jsfmt.spec.js.snap | 44 +- .../keyvalue/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 32 +- .../flow/lib/__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 4 +- .../liberr/__snapshots__/jsfmt.spec.js.snap | 4 +- .../libs/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../librec/__snapshots__/jsfmt.spec.js.snap | 4 +- .../lib/A/__snapshots__/jsfmt.spec.js.snap | 4 +- .../lib/B/__snapshots__/jsfmt.spec.js.snap | 4 +- .../literal/__snapshots__/jsfmt.spec.js.snap | 56 +- .../locals/__snapshots__/jsfmt.spec.js.snap | 70 +- .../logical/__snapshots__/jsfmt.spec.js.snap | 168 +- .../loners/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../misc/__snapshots__/jsfmt.spec.js.snap | 56 +- .../__snapshots__/jsfmt.spec.js.snap | 32 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 8 +- .../src/__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 30 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../modules/__snapshots__/jsfmt.spec.js.snap | 20 +- .../__snapshots__/jsfmt.spec.js.snap | 18 +- .../__snapshots__/jsfmt.spec.js.snap | 28 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 50 +- .../__snapshots__/jsfmt.spec.js.snap | 48 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 22 +- .../__snapshots__/jsfmt.spec.js.snap | 26 +- .../__snapshots__/jsfmt.spec.js.snap | 210 +- .../fakelib/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../_d3/__snapshots__/jsfmt.spec.js.snap | 4 +- .../foo/bar/__snapshots__/jsfmt.spec.js.snap | 24 +- .../ws/__snapshots__/jsfmt.spec.js.snap | 4 +- .../ws/test/__snapshots__/jsfmt.spec.js.snap | 8 +- .../root/__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../assert/__snapshots__/jsfmt.spec.js.snap | 8 +- .../basic/__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../bar_lib/__snapshots__/jsfmt.spec.js.snap | 8 +- .../buffer/__snapshots__/jsfmt.spec.js.snap | 32 +- .../__snapshots__/jsfmt.spec.js.snap | 118 +- .../crypto/__snapshots__/jsfmt.spec.js.snap | 56 +- .../fs/__snapshots__/jsfmt.spec.js.snap | 56 +- .../__snapshots__/jsfmt.spec.js.snap | 44 +- .../package2/__snapshots__/jsfmt.spec.js.snap | 4 +- .../os/__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../bar_lib/__snapshots__/jsfmt.spec.js.snap | 4 +- .../foo/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../stream/__snapshots__/jsfmt.spec.js.snap | 44 +- .../timers/__snapshots__/jsfmt.spec.js.snap | 4 +- .../url/__snapshots__/jsfmt.spec.js.snap | 12 +- .../nullable/__snapshots__/jsfmt.spec.js.snap | 24 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 20 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 120 +- .../__snapshots__/jsfmt.spec.js.snap | 64 +- .../__snapshots__/jsfmt.spec.js.snap | 28 +- .../__snapshots__/jsfmt.spec.js.snap | 20 +- .../objects/__snapshots__/jsfmt.spec.js.snap | 96 +- .../objmap/__snapshots__/jsfmt.spec.js.snap | 20 +- .../optional/__snapshots__/jsfmt.spec.js.snap | 70 +- .../__snapshots__/jsfmt.spec.js.snap | 50 +- .../overload/__snapshots__/jsfmt.spec.js.snap | 56 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 4 +- .../parse/__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../path/__snapshots__/jsfmt.spec.js.snap | 12 +- .../plsummit/__snapshots__/jsfmt.spec.js.snap | 34 +- .../poly/__snapshots__/jsfmt.spec.js.snap | 20 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../decls/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 110 +- .../__snapshots__/jsfmt.spec.js.snap | 114 +- .../__snapshots__/jsfmt.spec.js.snap | 74 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../private/__snapshots__/jsfmt.spec.js.snap | 8 +- .../promises/__snapshots__/jsfmt.spec.js.snap | 64 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../react/__snapshots__/jsfmt.spec.js.snap | 140 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 34 +- .../flow/rec/__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../tmp1A/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp2A/__snapshots__/jsfmt.spec.js.snap | 8 +- .../recheck/__snapshots__/jsfmt.spec.js.snap | 118 +- .../tmp1a/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp1b/__snapshots__/jsfmt.spec.js.snap | 8 +- .../tmp1c/__snapshots__/jsfmt.spec.js.snap | 8 +- .../tmp1d/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp1e/__snapshots__/jsfmt.spec.js.snap | 16 +- .../tmp1f/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp1g/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp1h/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp2a/__snapshots__/jsfmt.spec.js.snap | 8 +- .../tmp2b/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp2c/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp2e/__snapshots__/jsfmt.spec.js.snap | 10 +- .../tmp2f/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp3e/__snapshots__/jsfmt.spec.js.snap | 24 +- .../tmp3f/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tmp4f/__snapshots__/jsfmt.spec.js.snap | 4 +- .../record/__snapshots__/jsfmt.spec.js.snap | 16 +- .../refi/__snapshots__/jsfmt.spec.js.snap | 596 +-- .../__snapshots__/jsfmt.spec.js.snap | 788 ++-- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../regexp/__snapshots__/jsfmt.spec.js.snap | 8 +- .../replace/__snapshots__/jsfmt.spec.js.snap | 8 +- .../require/__snapshots__/jsfmt.spec.js.snap | 66 +- .../__snapshots__/jsfmt.spec.js.snap | 24 +- .../return/__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../seal/__snapshots__/jsfmt.spec.js.snap | 18 +- .../sealed/__snapshots__/jsfmt.spec.js.snap | 24 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../shape/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 24 +- .../spread/__snapshots__/jsfmt.spec.js.snap | 48 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 4 +- .../statics/__snapshots__/jsfmt.spec.js.snap | 6 +- .../strict/__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 26 +- .../__snapshots__/jsfmt.spec.js.snap | 34 +- .../suggest/__snapshots__/jsfmt.spec.js.snap | 14 +- .../super/__snapshots__/jsfmt.spec.js.snap | 34 +- .../suppress/__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../switch/__snapshots__/jsfmt.spec.js.snap | 94 +- .../symbol/__snapshots__/jsfmt.spec.js.snap | 12 +- .../symlink/__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 128 +- .../taint/__snapshots__/jsfmt.spec.js.snap | 38 +- .../template/__snapshots__/jsfmt.spec.js.snap | 28 +- .../this/__snapshots__/jsfmt.spec.js.snap | 30 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 50 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 8 +- .../throw/__snapshots__/jsfmt.spec.js.snap | 8 +- .../traces/__snapshots__/jsfmt.spec.js.snap | 22 +- .../traits/__snapshots__/jsfmt.spec.js.snap | 6 +- .../flow/try/__snapshots__/jsfmt.spec.js.snap | 82 +- .../tuples/__snapshots__/jsfmt.spec.js.snap | 22 +- .../__snapshots__/jsfmt.spec.js.snap | 56 +- .../__snapshots__/jsfmt.spec.js.snap | 24 +- .../__snapshots__/jsfmt.spec.js.snap | 1522 +++---- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 68 +- .../__snapshots__/jsfmt.spec.js.snap | 44 +- .../__snapshots__/jsfmt.spec.js.snap | 20 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../libs/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 6 +- .../typecast/__snapshots__/jsfmt.spec.js.snap | 24 +- .../typeof/__snapshots__/jsfmt.spec.js.snap | 32 +- .../unary/__snapshots__/jsfmt.spec.js.snap | 42 +- .../__snapshots__/jsfmt.spec.js.snap | 22 +- .../__snapshots__/jsfmt.spec.js.snap | 32 +- .../__snapshots__/jsfmt.spec.js.snap | 28 +- .../unicode/__snapshots__/jsfmt.spec.js.snap | 30 +- .../__snapshots__/jsfmt.spec.js.snap | 4006 +++++++++-------- .../union/__snapshots__/jsfmt.spec.js.snap | 138 +- .../__snapshots__/jsfmt.spec.js.snap | 354 +- .../lib/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../value/__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../weakmode/__snapshots__/jsfmt.spec.js.snap | 14 +- .../while/__snapshots__/jsfmt.spec.js.snap | 14 +- .../window/__snapshots__/jsfmt.spec.js.snap | 6 +- tests/flow/x/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 6 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- tests/for/__snapshots__/jsfmt.spec.js.snap | 8 +- .../function/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- tests/ignore/__snapshots__/jsfmt.spec.js.snap | 88 +- tests/import/__snapshots__/jsfmt.spec.js.snap | 46 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 24 +- .../__snapshots__/jsfmt.spec.js.snap | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 34 +- .../__snapshots__/jsfmt.spec.js.snap | 176 +- .../__snapshots__/jsfmt.spec.js.snap | 130 +- tests/jsx/__snapshots__/jsfmt.spec.js.snap | 78 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 6 +- tests/label/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 42 +- tests/line/__snapshots__/jsfmt.spec.js.snap | 12 +- .../literal/__snapshots__/jsfmt.spec.js.snap | 4 +- tests/member/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 162 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 34 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../objects/__snapshots__/jsfmt.spec.js.snap | 24 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- tests/quotes/__snapshots__/jsfmt.spec.js.snap | 274 +- tests/rest/__snapshots__/jsfmt.spec.js.snap | 4 +- .../shebang/__snapshots__/jsfmt.spec.js.snap | 6 +- .../strings/__snapshots__/jsfmt.spec.js.snap | 68 +- tests/switch/__snapshots__/jsfmt.spec.js.snap | 4 +- .../tabWith/__snapshots__/jsfmt.spec.js.snap | 26 +- .../template/__snapshots__/jsfmt.spec.js.snap | 74 +- .../__snapshots__/jsfmt.spec.js.snap | 74 +- .../__snapshots__/jsfmt.spec.js.snap | 188 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- tests/unary/__snapshots__/jsfmt.spec.js.snap | 6 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../unicode/__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 78 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- tests/while/__snapshots__/jsfmt.spec.js.snap | 4 +- .../windows/__snapshots__/jsfmt.spec.js.snap | 4 +- tests/yield/__snapshots__/jsfmt.spec.js.snap | 4 +- yarn.lock | 631 ++- 435 files changed, 11036 insertions(+), 10223 deletions(-) diff --git a/package.json b/package.json index cd7004122..83058e635 100644 --- a/package.json +++ b/package.json @@ -24,19 +24,19 @@ "flow-parser": "0.38.0", "get-stdin": "5.0.1", "glob": "7.1.1", - "jest-validate": "18.2.0", + "jest-validate": "19.0.0", "minimist": "1.2.0" }, "devDependencies": { - "jest": "18.0.0", + "diff": "3.2.0", + "jest": "19.0.0", "rollup": "0.41.1", "rollup-plugin-commonjs": "7.0.0", "rollup-plugin-json": "2.1.0", "rollup-plugin-node-builtins": "2.0.0", "rollup-plugin-node-globals": "1.1.0", "rollup-plugin-node-resolve": "2.0.0", - "rollup-plugin-real-babili": "1.0.0-alpha3", - "diff": "3.2.0" + "rollup-plugin-real-babili": "1.0.0-alpha3" }, "scripts": { "test": "jest", diff --git a/tests/array_spread/__snapshots__/jsfmt.spec.js.snap b/tests/array_spread/__snapshots__/jsfmt.spec.js.snap index e455b2c8e..40037c63f 100644 --- a/tests/array_spread/__snapshots__/jsfmt.spec.js.snap +++ b/tests/array_spread/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test multiple.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`multiple.js 1`] = ` "[...a, ...b,]; [...a, ...b]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/arrays/__snapshots__/jsfmt.spec.js.snap b/tests/arrays/__snapshots__/jsfmt.spec.js.snap index 2e38900ec..a999aea07 100644 --- a/tests/arrays/__snapshots__/jsfmt.spec.js.snap +++ b/tests/arrays/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test last.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`last.js 1`] = ` "[,]; [,,]; [,,1,]; @@ -11,7 +13,7 @@ exports[`test last.js 1`] = ` " `; -exports[`test preserve_empty_lines.js 1`] = ` +exports[`preserve_empty_lines.js 1`] = ` "a = [ 1, diff --git a/tests/arrows/__snapshots__/jsfmt.spec.js.snap b/tests/arrows/__snapshots__/jsfmt.spec.js.snap index 2e626000b..86e369872 100644 --- a/tests/arrows/__snapshots__/jsfmt.spec.js.snap +++ b/tests/arrows/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test arrow_function_expression.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`arrow_function_expression.js 1`] = ` "(a => {}).length typeof (() => {}); export default (() => {})(); @@ -18,14 +20,14 @@ if ((() => {}) ? 1 : 0) { " `; -exports[`test block_like.js 1`] = ` +exports[`block_like.js 1`] = ` "a = () => ({} = this); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a = () => ({} = this); " `; -exports[`test long-call-no-args.js 1`] = ` +exports[`long-call-no-args.js 1`] = ` "veryLongCall(VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_LONG_CONSTANT, () => {}) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ veryLongCall( @@ -35,17 +37,17 @@ veryLongCall( " `; -exports[`test long-contents.js 1`] = ` +exports[`long-contents.js 1`] = ` "const foo = () => { - expect(arg1, arg2, arg3).toEqual({message: \'test\', messageType: \'SMS\', status: \'Unknown\', created: \'11/01/2017 13:36\'}); + expect(arg1, arg2, arg3).toEqual({message: 'test', messageType: 'SMS', status: 'Unknown', created: '11/01/2017 13:36'}); }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const foo = () => { expect(arg1, arg2, arg3).toEqual({ - message: \"test\", - messageType: \"SMS\", - status: \"Unknown\", - created: \"11/01/2017 13:36\" + message: \\"test\\", + messageType: \\"SMS\\", + status: \\"Unknown\\", + created: \\"11/01/2017 13:36\\" }); }; " diff --git a/tests/async/__snapshots__/jsfmt.spec.js.snap b/tests/async/__snapshots__/jsfmt.spec.js.snap index 5f48fac00..4ec14ed9e 100644 --- a/tests/async/__snapshots__/jsfmt.spec.js.snap +++ b/tests/async/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test await_parse.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`await_parse.js 1`] = ` "async function f() { (await f()).length } async function g() { invariant( @@ -27,23 +29,23 @@ async function f() { " `; -exports[`test conditional-expression.js 1`] = ` +exports[`conditional-expression.js 1`] = ` "async function f() { - const result = typeof fn === \'function\' ? await fn() : null; + const result = typeof fn === 'function' ? await fn() : null; } (async function() { console.log( - await (true ? Promise.resolve(\"A\") : Promise.resolve(\"B\")) + await (true ? Promise.resolve(\\"A\\") : Promise.resolve(\\"B\\")) ); })() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ async function f() { - const result = typeof fn === \"function\" ? await fn() : null; + const result = typeof fn === \\"function\\" ? await fn() : null; } (async function() { - console.log(await (true ? Promise.resolve(\"A\") : Promise.resolve(\"B\"))); + console.log(await (true ? Promise.resolve(\\"A\\") : Promise.resolve(\\"B\\"))); })(); " `; diff --git a/tests/binary-expressions/__snapshots__/jsfmt.spec.js.snap b/tests/binary-expressions/__snapshots__/jsfmt.spec.js.snap index a836415ff..bd3c05ffd 100644 --- a/tests/binary-expressions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/binary-expressions/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test arrow.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`arrow.js 1`] = ` "function f() { const appEntitys = getAppEntitys(loadObject).filter( entity => entity && entity.isInstallAvailable() && !entity.isQueue() && entity.isDisabled() @@ -17,19 +19,19 @@ function f() { " `; -exports[`test inline-object-array.js 1`] = ` +exports[`inline-object-array.js 1`] = ` "prevState = prevState || { catalogs: [], loadState: LOADED, opened: false, - searchQuery: \'\', + searchQuery: '', selectedCatalog: null, }; this.steps = steps || [ { - name: \'mock-module\', - path: \'/nux/mock-module\', + name: 'mock-module', + path: '/nux/mock-module', }, ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -37,20 +39,20 @@ prevState = prevState || { catalogs: [], loadState: LOADED, opened: false, - searchQuery: \"\", + searchQuery: \\"\\", selectedCatalog: null }; this.steps = steps || [ { - name: \"mock-module\", - path: \"/nux/mock-module\" + name: \\"mock-module\\", + path: \\"/nux/mock-module\\" } ]; " `; -exports[`test short-right.js 1`] = ` +exports[`short-right.js 1`] = ` "this._cumulativeHeights && Math.abs( this._cachedItemHeight(this._firstVisibleIndex + i) - @@ -64,7 +66,7 @@ foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo( a; const isPartOfPackageJSON = dependenciesArray.indexOf( - dependencyWithOutRelativePath.split(\'/\')[0], + dependencyWithOutRelativePath.split('/')[0], ) !== -1; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ this._cumulativeHeights && @@ -78,12 +80,12 @@ foooooooooooooooooooooooooooooooooooooooooooooooooooooooooo( ) + a; const isPartOfPackageJSON = dependenciesArray.indexOf( - dependencyWithOutRelativePath.split(\"/\")[0] + dependencyWithOutRelativePath.split(\\"/\\")[0] ) !== -1; " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "// It should always break the highest precedence operators first, and // break them all at the same time. diff --git a/tests/bracketSpacing/__snapshots__/jsfmt.spec.js.snap b/tests/bracketSpacing/__snapshots__/jsfmt.spec.js.snap index 12dda2761..be1f1b9e5 100644 --- a/tests/bracketSpacing/__snapshots__/jsfmt.spec.js.snap +++ b/tests/bracketSpacing/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test array.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`array.js 1`] = ` "const arr1 = [1,2,3,4]; const arr2 = [1, 2, 3, 4]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -7,7 +9,7 @@ const arr2 = [1, 2, 3, 4]; " `; -exports[`test array.js 2`] = ` +exports[`array.js 2`] = ` "const arr1 = [1,2,3,4]; const arr2 = [1, 2, 3, 4]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -16,7 +18,7 @@ const arr2 = [1, 2, 3, 4]; " `; -exports[`test object.js 1`] = ` +exports[`object.js 1`] = ` "const obj1 = {a:1, b:2, c:3} const obj2 = { a:1, b:2, c:3 }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -25,7 +27,7 @@ const obj2 = { a: 1, b: 2, c: 3 }; " `; -exports[`test object.js 2`] = ` +exports[`object.js 2`] = ` "const obj1 = {a:1, b:2, c:3} const obj2 = { a:1, b:2, c:3 }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/break-calls/__snapshots__/jsfmt.spec.js.snap b/tests/break-calls/__snapshots__/jsfmt.spec.js.snap index f60f0bc14..bcaf5bf49 100644 --- a/tests/break-calls/__snapshots__/jsfmt.spec.js.snap +++ b/tests/break-calls/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test break.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`break.js 1`] = ` "h(f(g(() => { a }))) diff --git a/tests/class_extends/__snapshots__/jsfmt.spec.js.snap b/tests/class_extends/__snapshots__/jsfmt.spec.js.snap index ec36d123e..5e48be6d2 100644 --- a/tests/class_extends/__snapshots__/jsfmt.spec.js.snap +++ b/tests/class_extends/__snapshots__/jsfmt.spec.js.snap @@ -1,55 +1,57 @@ -exports[`test extends.js 1`] = ` -"// \"ArrowFunctionExpression\" +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`extends.js 1`] = ` +"// \\"ArrowFunctionExpression\\" class a extends (() => {}) {} -// \"AssignmentExpression\" +// \\"AssignmentExpression\\" class a extends (b = c) {} -// \"AwaitExpression\" +// \\"AwaitExpression\\" async function f() { class a extends (await b) {} } -// \"BinaryExpression\" +// \\"BinaryExpression\\" class a extends (b + c) {} -// \"CallExpression\" +// \\"CallExpression\\" class a extends b() {} -// \"ClassExpression\" +// \\"ClassExpression\\" class a extends class {} {} -// \"ConditionalExpression\" +// \\"ConditionalExpression\\" class a extends (b ? c : d) {} -// \"FunctionExpression\" +// \\"FunctionExpression\\" class a extends (function() {}) {} -// \"LogicalExpression\" +// \\"LogicalExpression\\" class a extends (b || c) {} -// \"MemberExpression\" +// \\"MemberExpression\\" class a extends b.c {} -// \"NewExpression\" +// \\"NewExpression\\" class a extends (new B()) {} -// \"ObjectExpression\" +// \\"ObjectExpression\\" class a extends ({}) {} -// \"SequenceExpression\" +// \\"SequenceExpression\\" class a extends (b, c) {} -// \"TaggedTemplateExpression\" +// \\"TaggedTemplateExpression\\" class a extends \`\` {} -// \"UnaryExpression\" +// \\"UnaryExpression\\" class a extends (void b) {} -// \"UpdateExpression\" +// \\"UpdateExpression\\" class a extends (++b) {} -// \"YieldExpression\" +// \\"YieldExpression\\" function* f() { // Flow has a bug parsing it. // class a extends (yield 1) {} @@ -57,57 +59,57 @@ function* f() { x = class extends (++b) {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// \"ArrowFunctionExpression\" +// \\"ArrowFunctionExpression\\" class a extends (() => {}) {} -// \"AssignmentExpression\" +// \\"AssignmentExpression\\" class a extends (b = c) {} -// \"AwaitExpression\" +// \\"AwaitExpression\\" async function f() { class a extends (await b) {} } -// \"BinaryExpression\" +// \\"BinaryExpression\\" class a extends (b + c) {} -// \"CallExpression\" +// \\"CallExpression\\" class a extends b() {} -// \"ClassExpression\" +// \\"ClassExpression\\" class a extends class {} {} -// \"ConditionalExpression\" +// \\"ConditionalExpression\\" class a extends (b ? c : d) {} -// \"FunctionExpression\" +// \\"FunctionExpression\\" class a extends function() {} {} -// \"LogicalExpression\" +// \\"LogicalExpression\\" class a extends (b || c) {} -// \"MemberExpression\" +// \\"MemberExpression\\" class a extends b.c {} -// \"NewExpression\" +// \\"NewExpression\\" class a extends (new B()) {} -// \"ObjectExpression\" +// \\"ObjectExpression\\" class a extends ({}) {} -// \"SequenceExpression\" +// \\"SequenceExpression\\" class a extends (b, c) {} -// \"TaggedTemplateExpression\" +// \\"TaggedTemplateExpression\\" class a extends \`\` {} -// \"UnaryExpression\" +// \\"UnaryExpression\\" class a extends (void b) {} -// \"UpdateExpression\" +// \\"UpdateExpression\\" class a extends (++b) {} -// \"YieldExpression\" +// \\"YieldExpression\\" function* f() { // Flow has a bug parsing it. // class a extends (yield 1) {} diff --git a/tests/classes/__snapshots__/jsfmt.spec.js.snap b/tests/classes/__snapshots__/jsfmt.spec.js.snap index a941f1163..444bf63b8 100644 --- a/tests/classes/__snapshots__/jsfmt.spec.js.snap +++ b/tests/classes/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test binary.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`binary.js 1`] = ` "(class {}) + 1; (class a {}) + 1; (class extends b {}) + 1; @@ -11,7 +13,7 @@ exports[`test binary.js 1`] = ` " `; -exports[`test break.js 1`] = ` +exports[`break.js 1`] = ` "class MyContractSelectionWidget extends React.Component implements SomethingLarge { method() {} } @@ -24,14 +26,14 @@ class MyContractSelectionWidget " `; -exports[`test call.js 1`] = ` +exports[`call.js 1`] = ` "(class {})(class {}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (class {})(class {}); " `; -exports[`test empty.js 1`] = ` +exports[`empty.js 1`] = ` "class A { // comment } @@ -62,7 +64,7 @@ class A { " `; -exports[`test member.js 1`] = ` +exports[`member.js 1`] = ` "(class {})[1]; (class {}).a; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -71,7 +73,7 @@ exports[`test member.js 1`] = ` " `; -exports[`test ternary.js 1`] = ` +exports[`ternary.js 1`] = ` "if (1) (class {}) ? 1 : 2; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (1) (class {}) ? 1 : 2; diff --git a/tests/comments/__snapshots__/jsfmt.spec.js.snap b/tests/comments/__snapshots__/jsfmt.spec.js.snap index e300d1965..54d00a485 100644 --- a/tests/comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/comments/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,28 @@ -exports[`test blank.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`assignment-pattern.js 1`] = ` +"const { a /* comment */ = 1 } = b; + +const { c = 1 /* comment */ } = d; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +const { a /* comment */ = 1 } = b; + +const { c = 1 /* comment */ } = d; +" +`; + +exports[`assignment-pattern.js 2`] = ` +"const { a /* comment */ = 1 } = b; + +const { c = 1 /* comment */ } = d; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +const { a /* comment */ = 1 } = b; + +const { c = 1 /* comment */ } = d; +" +`; + +exports[`blank.js 1`] = ` "// This file only // has comments. This comment // should still exist @@ -13,7 +37,7 @@ exports[`test blank.js 1`] = ` " `; -exports[`test blank.js 2`] = ` +exports[`blank.js 2`] = ` "// This file only // has comments. This comment // should still exist @@ -28,7 +52,7 @@ exports[`test blank.js 2`] = ` " `; -exports[`test dangling.js 1`] = ` +exports[`dangling.js 1`] = ` "var x = {/* dangling */}; var x = { // dangling @@ -59,7 +83,7 @@ export /* dangling */{}; " `; -exports[`test dangling.js 2`] = ` +exports[`dangling.js 2`] = ` "var x = {/* dangling */}; var x = { // dangling @@ -90,7 +114,7 @@ export /* dangling */{}; " `; -exports[`test dangling_array.js 1`] = ` +exports[`dangling_array.js 1`] = ` "expect(() => {}).toTriggerReadyStateChanges([ // Nothing. ]); @@ -107,7 +131,7 @@ expect(() => {}).toTriggerReadyStateChanges( " `; -exports[`test dangling_array.js 2`] = ` +exports[`dangling_array.js 2`] = ` "expect(() => {}).toTriggerReadyStateChanges([ // Nothing. ]); @@ -124,7 +148,7 @@ expect(() => {}).toTriggerReadyStateChanges( " `; -exports[`test dangling_for.js 1`] = ` +exports[`dangling_for.js 1`] = ` "for // comment (;;); @@ -138,7 +162,7 @@ for (;;); " `; -exports[`test dangling_for.js 2`] = ` +exports[`dangling_for.js 2`] = ` "for // comment (;;); @@ -152,7 +176,7 @@ for (;;); " `; -exports[`test first-line.js 1`] = ` +exports[`first-line.js 1`] = ` "a // comment b ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -161,7 +185,7 @@ b; " `; -exports[`test first-line.js 2`] = ` +exports[`first-line.js 2`] = ` "a // comment b ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -170,7 +194,7 @@ b; " `; -exports[`test if.js 1`] = ` +exports[`if.js 1`] = ` "if (1) // comment { @@ -214,7 +238,7 @@ else if (4) { " `; -exports[`test if.js 2`] = ` +exports[`if.js 2`] = ` "if (1) // comment { @@ -258,7 +282,7 @@ else if (4) { " `; -exports[`test issues.js 1`] = ` +exports[`issues.js 1`] = ` "// Does not need to break as it fits in 80 columns this.call(a, /* comment */ b); @@ -279,23 +303,23 @@ throw new ProcessSystemError({ // squished in a single line afterward export type BuckWebSocketMessage = { // Not actually from Buck - this is to let the receiver know that the socket is connected. - type: \'SocketConnected\', + type: 'SocketConnected', } | { - type: \'BuildProgressUpdated\', + type: 'BuildProgressUpdated', progressValue: number, } | { - type: \'BuildFinished\', + type: 'BuildFinished', exitCode: number, } | { - type: \'BuildStarted\', + type: 'BuildStarted', } | { - type: \'ParseStarted\', + type: 'ParseStarted', } | { - type: \'ParseFinished\', + type: 'ParseFinished', } | { - type: \'RunStarted\', + type: 'RunStarted', } | { - type: \'RunComplete\', + type: 'RunComplete', }; // Missing one level of indentation because of the comment @@ -317,20 +341,20 @@ export type AsyncExecuteOptions = child_process$execFileOpts & { // optional trailing comma gets moved all the way to the beginning const regex = new RegExp( - \'^\\\\s*\' + // beginning of the line - \'name\\\\s*=\\\\s*\' + // name = - \'[\\\'\"]\' + // opening quotation mark + '^\\\\\\\\s*' + // beginning of the line + 'name\\\\\\\\s*=\\\\\\\\s*' + // name = + '[\\\\'\\"]' + // opening quotation mark escapeStringRegExp(target.name) + // target name - \'[\\\'\"]\' + // closing quotation mark - \',?$\', // optional trailing comma + '[\\\\'\\"]' + // closing quotation mark + ',?$', // optional trailing comma ); -// The comment is moved and doesn\'t trigger the eslint rule anymore -import path from \'path\'; // eslint-disable-line nuclide-internal/prefer-nuclide-uri +// The comment is moved and doesn't trigger the eslint rule anymore +import path from 'path'; // eslint-disable-line nuclide-internal/prefer-nuclide-uri // Comments disappear in-between MemberExpressions Observable.of(process) - // Don\'t complete until we say so! + // Don't complete until we say so! .merge(Observable.never()) // Get the errors. .takeUntil(throwOnError ? errors.flatMap(Observable.throw) : errors) @@ -360,7 +384,7 @@ else { } // The comment makes the line break in a weird way -const result = asyncExecute(\'non_existing_command\', /* args */ []); +const result = asyncExecute('non_existing_command', /* args */ []); // The closing paren is printed on the same line as the comment foo({} @@ -389,30 +413,30 @@ throw new ProcessSystemError({ export type BuckWebSocketMessage = | { // Not actually from Buck - this is to let the receiver know that the socket is connected. - type: \"SocketConnected\" + type: \\"SocketConnected\\" } | { - type: \"BuildProgressUpdated\", + type: \\"BuildProgressUpdated\\", progressValue: number } | { - type: \"BuildFinished\", + type: \\"BuildFinished\\", exitCode: number } | { - type: \"BuildStarted\" + type: \\"BuildStarted\\" } | { - type: \"ParseStarted\" + type: \\"ParseStarted\\" } | { - type: \"ParseFinished\" + type: \\"ParseFinished\\" } | { - type: \"RunStarted\" + type: \\"RunStarted\\" } | { - type: \"RunComplete\" + type: \\"RunComplete\\" }; // Missing one level of indentation because of the comment @@ -432,20 +456,20 @@ export type AsyncExecuteOptions = child_process$execFileOpts & { // optional trailing comma gets moved all the way to the beginning const regex = new RegExp( - \"^\\\\s*\" + // beginning of the line - \"name\\\\s*=\\\\s*\" + // name = - \"[\'\\\"]\" + // opening quotation mark + \\"^\\\\\\\\s*\\" + // beginning of the line + \\"name\\\\\\\\s*=\\\\\\\\s*\\" + // name = + \\"['\\\\\\"]\\" + // opening quotation mark escapeStringRegExp(target.name) + // target name - \"[\'\\\"]\" + // closing quotation mark - \",?$\" // optional trailing comma + \\"['\\\\\\"]\\" + // closing quotation mark + \\",?$\\" // optional trailing comma ); -// The comment is moved and doesn\'t trigger the eslint rule anymore -import path from \"path\"; // eslint-disable-line nuclide-internal/prefer-nuclide-uri +// The comment is moved and doesn't trigger the eslint rule anymore +import path from \\"path\\"; // eslint-disable-line nuclide-internal/prefer-nuclide-uri // Comments disappear in-between MemberExpressions Observable.of(process) - // Don\'t complete until we say so! + // Don't complete until we say so! .merge(Observable.never()) // Get the errors. .takeUntil(throwOnError ? errors.flatMap(Observable.throw) : errors) @@ -473,7 +497,7 @@ if (1) { } // The comment makes the line break in a weird way -const result = asyncExecute(\"non_existing_command\", /* args */ []); +const result = asyncExecute(\\"non_existing_command\\", /* args */ []); // The closing paren is printed on the same line as the comment foo( @@ -483,7 +507,7 @@ foo( " `; -exports[`test issues.js 2`] = ` +exports[`issues.js 2`] = ` "// Does not need to break as it fits in 80 columns this.call(a, /* comment */ b); @@ -504,23 +528,23 @@ throw new ProcessSystemError({ // squished in a single line afterward export type BuckWebSocketMessage = { // Not actually from Buck - this is to let the receiver know that the socket is connected. - type: \'SocketConnected\', + type: 'SocketConnected', } | { - type: \'BuildProgressUpdated\', + type: 'BuildProgressUpdated', progressValue: number, } | { - type: \'BuildFinished\', + type: 'BuildFinished', exitCode: number, } | { - type: \'BuildStarted\', + type: 'BuildStarted', } | { - type: \'ParseStarted\', + type: 'ParseStarted', } | { - type: \'ParseFinished\', + type: 'ParseFinished', } | { - type: \'RunStarted\', + type: 'RunStarted', } | { - type: \'RunComplete\', + type: 'RunComplete', }; // Missing one level of indentation because of the comment @@ -542,20 +566,20 @@ export type AsyncExecuteOptions = child_process$execFileOpts & { // optional trailing comma gets moved all the way to the beginning const regex = new RegExp( - \'^\\\\s*\' + // beginning of the line - \'name\\\\s*=\\\\s*\' + // name = - \'[\\\'\"]\' + // opening quotation mark + '^\\\\\\\\s*' + // beginning of the line + 'name\\\\\\\\s*=\\\\\\\\s*' + // name = + '[\\\\'\\"]' + // opening quotation mark escapeStringRegExp(target.name) + // target name - \'[\\\'\"]\' + // closing quotation mark - \',?$\', // optional trailing comma + '[\\\\'\\"]' + // closing quotation mark + ',?$', // optional trailing comma ); -// The comment is moved and doesn\'t trigger the eslint rule anymore -import path from \'path\'; // eslint-disable-line nuclide-internal/prefer-nuclide-uri +// The comment is moved and doesn't trigger the eslint rule anymore +import path from 'path'; // eslint-disable-line nuclide-internal/prefer-nuclide-uri // Comments disappear in-between MemberExpressions Observable.of(process) - // Don\'t complete until we say so! + // Don't complete until we say so! .merge(Observable.never()) // Get the errors. .takeUntil(throwOnError ? errors.flatMap(Observable.throw) : errors) @@ -585,7 +609,7 @@ else { } // The comment makes the line break in a weird way -const result = asyncExecute(\'non_existing_command\', /* args */ []); +const result = asyncExecute('non_existing_command', /* args */ []); // The closing paren is printed on the same line as the comment foo({} @@ -614,30 +638,30 @@ throw new ProcessSystemError({ export type BuckWebSocketMessage = | { // Not actually from Buck - this is to let the receiver know that the socket is connected. - type: \"SocketConnected\" + type: \\"SocketConnected\\" } | { - type: \"BuildProgressUpdated\", + type: \\"BuildProgressUpdated\\", progressValue: number } | { - type: \"BuildFinished\", + type: \\"BuildFinished\\", exitCode: number } | { - type: \"BuildStarted\" + type: \\"BuildStarted\\" } | { - type: \"ParseStarted\" + type: \\"ParseStarted\\" } | { - type: \"ParseFinished\" + type: \\"ParseFinished\\" } | { - type: \"RunStarted\" + type: \\"RunStarted\\" } | { - type: \"RunComplete\" + type: \\"RunComplete\\" }; // Missing one level of indentation because of the comment @@ -657,20 +681,20 @@ export type AsyncExecuteOptions = child_process$execFileOpts & { // optional trailing comma gets moved all the way to the beginning const regex = new RegExp( - \"^\\\\s*\" + // beginning of the line - \"name\\\\s*=\\\\s*\" + // name = - \"[\'\\\"]\" + // opening quotation mark + \\"^\\\\\\\\s*\\" + // beginning of the line + \\"name\\\\\\\\s*=\\\\\\\\s*\\" + // name = + \\"['\\\\\\"]\\" + // opening quotation mark escapeStringRegExp(target.name) + // target name - \"[\'\\\"]\" + // closing quotation mark - \",?$\" // optional trailing comma + \\"['\\\\\\"]\\" + // closing quotation mark + \\",?$\\" // optional trailing comma ); -// The comment is moved and doesn\'t trigger the eslint rule anymore -import path from \"path\"; // eslint-disable-line nuclide-internal/prefer-nuclide-uri +// The comment is moved and doesn't trigger the eslint rule anymore +import path from \\"path\\"; // eslint-disable-line nuclide-internal/prefer-nuclide-uri // Comments disappear in-between MemberExpressions Observable.of(process) - // Don\'t complete until we say so! + // Don't complete until we say so! .merge(Observable.never()) // Get the errors. .takeUntil(throwOnError ? errors.flatMap(Observable.throw) : errors) @@ -698,7 +722,7 @@ if (1) { } // The comment makes the line break in a weird way -const result = asyncExecute(\"non_existing_command\", /* args */ []); +const result = asyncExecute(\\"non_existing_command\\", /* args */ []); // The closing paren is printed on the same line as the comment foo( @@ -708,7 +732,7 @@ foo( " `; -exports[`test jsx.js 1`] = ` +exports[`jsx.js 1`] = ` "
{ /* comment */ @@ -784,7 +808,7 @@ exports[`test jsx.js 1`] = ` " `; -exports[`test jsx.js 2`] = ` +exports[`jsx.js 2`] = ` "
{ /* comment */ @@ -860,7 +884,7 @@ exports[`test jsx.js 2`] = ` " `; -exports[`test preserve-new-line-last.js 1`] = ` +exports[`preserve-new-line-last.js 1`] = ` "function f() { a /* eslint-disable */ @@ -907,7 +931,7 @@ function name() { " `; -exports[`test preserve-new-line-last.js 2`] = ` +exports[`preserve-new-line-last.js 2`] = ` "function f() { a /* eslint-disable */ @@ -954,7 +978,7 @@ function name() { " `; -exports[`test return-statement.js 1`] = ` +exports[`return-statement.js 1`] = ` "function a() { return ( // Comment @@ -993,7 +1017,7 @@ function c() { " `; -exports[`test return-statement.js 2`] = ` +exports[`return-statement.js 2`] = ` "function a() { return ( // Comment @@ -1032,7 +1056,7 @@ function c() { " `; -exports[`test try.js 1`] = ` +exports[`try.js 1`] = ` "// comment 1 try { // comment 2 @@ -1060,7 +1084,7 @@ try { " `; -exports[`test try.js 2`] = ` +exports[`try.js 2`] = ` "// comment 1 try { // comment 2 @@ -1087,25 +1111,3 @@ try { } " `; - -exports[`test assignment-pattern.js 1`] = ` -"const { a /* comment */ = 1 } = b; - -const { c = 1 /* comment */ } = d; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -const { a /* comment */ = 1 } = b; - -const { c = 1 /* comment */ } = d; -" -`; - -exports[`test assignment-pattern.js 2`] = ` -"const { a /* comment */ = 1 } = b; - -const { c = 1 /* comment */ } = d; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -const { a /* comment */ = 1 } = b; - -const { c = 1 /* comment */ } = d; -" -`; diff --git a/tests/computed_props/__snapshots__/jsfmt.spec.js.snap b/tests/computed_props/__snapshots__/jsfmt.spec.js.snap index 371fdcdd2..fafd502e9 100644 --- a/tests/computed_props/__snapshots__/jsfmt.spec.js.snap +++ b/tests/computed_props/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test classes.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`classes.js 1`] = ` "class c { - [\"i\"]() {} + [\\"i\\"]() {} } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class c { - [\"i\"]() {} + [\\"i\\"]() {} } " `; diff --git a/tests/conditional/__snapshots__/jsfmt.spec.js.snap b/tests/conditional/__snapshots__/jsfmt.spec.js.snap index 3885c2a79..88cf5040d 100644 --- a/tests/conditional/__snapshots__/jsfmt.spec.js.snap +++ b/tests/conditional/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test comments.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`comments.js 1`] = ` "var inspect = 4 === util.inspect.length ? // node <= 0.8.x (function(v, colors) { @@ -21,21 +23,21 @@ var inspect = 4 === util.inspect.length const extractTextPluginOptions = shouldUseRelativeAssetPaths // Making sure that the publicPath goes back to to build folder. - ? { publicPath: Array(cssFilename.split(\'/\').length).join(\'../\') } : + ? { publicPath: Array(cssFilename.split('/').length).join('../') } : {}; const extractTextPluginOptions = shouldUseRelativeAssetPaths ? // Making sure that the publicPath goes back to to build folder. - { publicPath: Array(cssFilename.split(\"/\").length).join(\"../\") } + { publicPath: Array(cssFilename.split(\\"/\\").length).join(\\"../\\") } : {}; const extractTextPluginOptions = shouldUseRelativeAssetPaths // Making sure that the publicPath goes back to to build folder. - ? { publicPath: Array(cssFilename.split(\"/\").length).join(\"../\") } + ? { publicPath: Array(cssFilename.split(\\"/\\").length).join(\\"../\\") } : {}; -const { configureStore } = process.env.NODE_ENV === \"production\" - ? require(\"./configureProdStore\") // a - : require(\"./configureDevStore\"); // b +const { configureStore } = process.env.NODE_ENV === \\"production\\" + ? require(\\"./configureProdStore\\") // a + : require(\\"./configureDevStore\\"); // b ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var inspect = 4 === util.inspect.length ? // node <= 0.8.x @@ -59,20 +61,20 @@ var inspect = 4 === util.inspect.length const extractTextPluginOptions = shouldUseRelativeAssetPaths ? // Making sure that the publicPath goes back to to build folder. - { publicPath: Array(cssFilename.split(\"/\").length).join(\"../\") } + { publicPath: Array(cssFilename.split(\\"/\\").length).join(\\"../\\") } : {}; const extractTextPluginOptions = shouldUseRelativeAssetPaths ? // Making sure that the publicPath goes back to to build folder. - { publicPath: Array(cssFilename.split(\"/\").length).join(\"../\") } + { publicPath: Array(cssFilename.split(\\"/\\").length).join(\\"../\\") } : {}; const extractTextPluginOptions = shouldUseRelativeAssetPaths // Making sure that the publicPath goes back to to build folder. - ? { publicPath: Array(cssFilename.split(\"/\").length).join(\"../\") } + ? { publicPath: Array(cssFilename.split(\\"/\\").length).join(\\"../\\") } : {}; -const { configureStore } = process.env.NODE_ENV === \"production\" - ? require(\"./configureProdStore\") // a - : require(\"./configureDevStore\"); // b +const { configureStore } = process.env.NODE_ENV === \\"production\\" + ? require(\\"./configureProdStore\\") // a + : require(\\"./configureDevStore\\"); // b " `; diff --git a/tests/decorators/__snapshots__/jsfmt.spec.js.snap b/tests/decorators/__snapshots__/jsfmt.spec.js.snap index 7f0de6828..6263d7991 100644 --- a/tests/decorators/__snapshots__/jsfmt.spec.js.snap +++ b/tests/decorators/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,7 @@ -exports[`test mobx.js 1`] = ` -"import {observable} from \"mobx\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`mobx.js 1`] = ` +"import {observable} from \\"mobx\\"; @observer class OrderLine { @observable price:number = 0; @@ -14,7 +16,7 @@ exports[`test mobx.js 1`] = ` } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import { observable } from \"mobx\"; +import { observable } from \\"mobx\\"; @observer class OrderLine { @observable price: number = 0; @@ -31,7 +33,7 @@ import { observable } from \"mobx\"; " `; -exports[`test multiple.js 1`] = ` +exports[`multiple.js 1`] = ` "const dog = { @readonly @nonenumerable @@ -48,7 +50,7 @@ const dog = { " `; -exports[`test redux.js 1`] = ` +exports[`redux.js 1`] = ` "@connect(mapStateToProps, mapDispatchToProps) export class MyApp extends React.Component {} diff --git a/tests/directives/__snapshots__/jsfmt.spec.js.snap b/tests/directives/__snapshots__/jsfmt.spec.js.snap index cb1c2b34f..a64602510 100644 --- a/tests/directives/__snapshots__/jsfmt.spec.js.snap +++ b/tests/directives/__snapshots__/jsfmt.spec.js.snap @@ -1,127 +1,129 @@ -exports[`test last-line-0.js 1`] = ` -"\'use strict\';~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`last-line-0.js 1`] = ` +"'use strict';~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\\"use strict\\"; " `; -exports[`test last-line-0.js 2`] = ` -"\'use strict\';~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +exports[`last-line-0.js 2`] = ` +"'use strict';~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +\\"use strict\\"; " `; -exports[`test last-line-1.js 1`] = ` -"\'use strict\'; +exports[`last-line-1.js 1`] = ` +"'use strict'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +\\"use strict\\"; " `; -exports[`test last-line-1.js 2`] = ` -"\'use strict\'; +exports[`last-line-1.js 2`] = ` +"'use strict'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +\\"use strict\\"; " `; -exports[`test last-line-2.js 1`] = ` -"\'use strict\'; +exports[`last-line-2.js 1`] = ` +"'use strict'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +\\"use strict\\"; " `; -exports[`test last-line-2.js 2`] = ` -"\'use strict\'; +exports[`last-line-2.js 2`] = ` +"'use strict'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +\\"use strict\\"; " `; -exports[`test newline.js 1`] = ` +exports[`newline.js 1`] = ` "/* @flow */ -\"use strict\"; +\\"use strict\\"; -import a from \"a\"; +import a from \\"a\\"; a(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -\"use strict\"; +\\"use strict\\"; -import a from \"a\"; +import a from \\"a\\"; a(); " `; -exports[`test newline.js 2`] = ` +exports[`newline.js 2`] = ` "/* @flow */ -\"use strict\"; +\\"use strict\\"; -import a from \"a\"; +import a from \\"a\\"; a(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -\"use strict\"; +\\"use strict\\"; -import a from \"a\"; +import a from \\"a\\"; a(); " `; -exports[`test no-newline.js 1`] = ` -"\"use strict\"; +exports[`no-newline.js 1`] = ` +"\\"use strict\\"; a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +\\"use strict\\"; a; " `; -exports[`test no-newline.js 2`] = ` -"\"use strict\"; +exports[`no-newline.js 2`] = ` +"\\"use strict\\"; a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +\\"use strict\\"; a; " `; -exports[`test test.js 1`] = ` -"\"use strict\"; +exports[`test.js 1`] = ` +"\\"use strict\\"; function fn() { - \"use strict\"; + \\"use strict\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +\\"use strict\\"; function fn() { - \"use strict\"; + \\"use strict\\"; } " `; -exports[`test test.js 2`] = ` -"\"use strict\"; +exports[`test.js 2`] = ` +"\\"use strict\\"; function fn() { - \"use strict\"; + \\"use strict\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +\\"use strict\\"; function fn() { - \"use strict\"; + \\"use strict\\"; } " `; diff --git a/tests/dynamic_import/__snapshots__/jsfmt.spec.js.snap b/tests/dynamic_import/__snapshots__/jsfmt.spec.js.snap index 84ca69b4c..be41fd386 100644 --- a/tests/dynamic_import/__snapshots__/jsfmt.spec.js.snap +++ b/tests/dynamic_import/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test test.js 1`] = ` -"import(\"module.js\"); -import(\"module.js\").then((a) => a); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` +"import(\\"module.js\\"); +import(\\"module.js\\").then((a) => a); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import(\"module.js\"); -import(\"module.js\").then(a => a); +import(\\"module.js\\"); +import(\\"module.js\\").then(a => a); " `; diff --git a/tests/empty_statement/__snapshots__/jsfmt.spec.js.snap b/tests/empty_statement/__snapshots__/jsfmt.spec.js.snap index db47c9da6..42e607bca 100644 --- a/tests/empty_statement/__snapshots__/jsfmt.spec.js.snap +++ b/tests/empty_statement/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test body.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`body.js 1`] = ` "with (a); if (1); else if (2); else; for (;;); diff --git a/tests/es6modules/__snapshots__/jsfmt.spec.js.snap b/tests/es6modules/__snapshots__/jsfmt.spec.js.snap index 794a45e42..be5a789ce 100644 --- a/tests/es6modules/__snapshots__/jsfmt.spec.js.snap +++ b/tests/es6modules/__snapshots__/jsfmt.spec.js.snap @@ -1,60 +1,62 @@ -exports[`test export_default_arrow_expression.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`export_default_arrow_expression.js 1`] = ` "export default () => {}; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default () => {}; " `; -exports[`test export_default_call_expression.js 1`] = ` +exports[`export_default_call_expression.js 1`] = ` "export default foo() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default foo(); " `; -exports[`test export_default_class_declaration.js 1`] = ` +exports[`export_default_class_declaration.js 1`] = ` "export default class Foo {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default class Foo {} " `; -exports[`test export_default_class_expression.js 1`] = ` +exports[`export_default_class_expression.js 1`] = ` "export default (class foobar {}) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default (class foobar {}); " `; -exports[`test export_default_function_declaration.js 1`] = ` +exports[`export_default_function_declaration.js 1`] = ` "export default function() {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default function() {} " `; -exports[`test export_default_function_declaration_named.js 1`] = ` +exports[`export_default_function_declaration_named.js 1`] = ` "export default function f(){} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default function f() {} " `; -exports[`test export_default_function_expression.js 1`] = ` +exports[`export_default_function_expression.js 1`] = ` "export default (function() {}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default (function() {}); " `; -exports[`test export_default_function_expression_named.js 1`] = ` +exports[`export_default_function_expression_named.js 1`] = ` "export default (function f(){}) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default (function f() {}); " `; -exports[`test export_default_new_expression.js 1`] = ` +exports[`export_default_new_expression.js 1`] = ` "export default new Foo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default new Foo(); diff --git a/tests/export/__snapshots__/jsfmt.spec.js.snap b/tests/export/__snapshots__/jsfmt.spec.js.snap index b353903ca..560bd6874 100644 --- a/tests/export/__snapshots__/jsfmt.spec.js.snap +++ b/tests/export/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test bracket.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bracket.js 1`] = ` "export { runTaskForChanged, description, @@ -25,7 +27,7 @@ export { fitsIn, oneLine }; " `; -exports[`test bracket.js 2`] = ` +exports[`bracket.js 2`] = ` "export { runTaskForChanged, description, @@ -52,20 +54,20 @@ export {fitsIn, oneLine}; " `; -exports[`test empty.js 1`] = ` +exports[`empty.js 1`] = ` "export {}; -export {} from \".\"; +export {} from \\".\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export {}; -export {} from \".\"; +export {} from \\".\\"; " `; -exports[`test empty.js 2`] = ` +exports[`empty.js 2`] = ` "export {}; -export {} from \".\"; +export {} from \\".\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export {}; -export {} from \".\"; +export {} from \\".\\"; " `; diff --git a/tests/export_default/__snapshots__/jsfmt.spec.js.snap b/tests/export_default/__snapshots__/jsfmt.spec.js.snap index ed909e14b..a9938eaac 100644 --- a/tests/export_default/__snapshots__/jsfmt.spec.js.snap +++ b/tests/export_default/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test body.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`body.js 1`] = ` "export default (class {}[1] = 1); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export default ((class {})[1] = 1); diff --git a/tests/export_extension/__snapshots__/jsfmt.spec.js.snap b/tests/export_extension/__snapshots__/jsfmt.spec.js.snap index 93c8b8099..460e2bfc2 100644 --- a/tests/export_extension/__snapshots__/jsfmt.spec.js.snap +++ b/tests/export_extension/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test export.js 1`] = ` -"export * as ns from \'mod\'; -export v from \'mod\'; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`export.js 1`] = ` +"export * as ns from 'mod'; +export v from 'mod'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -export * as ns from \"mod\"; -export v from \"mod\"; +export * as ns from \\"mod\\"; +export v from \\"mod\\"; " `; diff --git a/tests/exports/__snapshots__/jsfmt.spec.js.snap b/tests/exports/__snapshots__/jsfmt.spec.js.snap index 502807fa5..5f7830c60 100644 --- a/tests/exports/__snapshots__/jsfmt.spec.js.snap +++ b/tests/exports/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,7 @@ -exports[`test test.js 1`] = ` -"export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \"exports\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` +"export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \\"exports\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export { value1, @@ -7,6 +9,6 @@ export { value3, value4 as value4_renamed, value5 -} from \"exports\"; +} from \\"exports\\"; " `; diff --git a/tests/expression_statement/__snapshots__/jsfmt.spec.js.snap b/tests/expression_statement/__snapshots__/jsfmt.spec.js.snap index 9b69df737..c6b6fd305 100644 --- a/tests/expression_statement/__snapshots__/jsfmt.spec.js.snap +++ b/tests/expression_statement/__snapshots__/jsfmt.spec.js.snap @@ -1,17 +1,19 @@ -exports[`test no_regression.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`no_regression.js 1`] = ` "// Ensure no regression. -\"use strict\"; +\\"use strict\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Ensure no regression. -\"use strict\"; +\\"use strict\\"; " `; -exports[`test use_strict.js 1`] = ` +exports[`use_strict.js 1`] = ` "// Parentheses around expression statement should be preserved in this case. -(\"use strict\"); +(\\"use strict\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Parentheses around expression statement should be preserved in this case. -(\"use strict\"); +(\\"use strict\\"); " `; diff --git a/tests/flow/abnormal/__snapshots__/jsfmt.spec.js.snap b/tests/flow/abnormal/__snapshots__/jsfmt.spec.js.snap index d8cbcd17d..575c925dd 100644 --- a/tests/flow/abnormal/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/abnormal/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test break-continue.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`break-continue.js 1`] = ` "function foo() { while(true) { break; } } @@ -22,7 +24,7 @@ function bar() { " `; -exports[`test return.js 1`] = ` +exports[`return.js 1`] = ` "function bar(x:number) { } function foo() { var x = null; diff --git a/tests/flow/annot/__snapshots__/jsfmt.spec.js.snap b/tests/flow/annot/__snapshots__/jsfmt.spec.js.snap index 194b4f92a..d215387d2 100644 --- a/tests/flow/annot/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/annot/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test annot.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`annot.js 1`] = ` "function foo(str:string, i:number):string { return str; } @@ -6,12 +8,12 @@ var bar: (str:number, i:number)=> string = foo; var qux = function(str:string, i:number):number { return foo(str,i); } -var obj: {str:string; i:number; j:boolean} = {str: \"...\", i: \"...\", k: false}; +var obj: {str:string; i:number; j:boolean} = {str: \\"...\\", i: \\"...\\", k: false}; -var arr: Array = [1,2,\"...\"]; +var arr: Array = [1,2,\\"...\\"]; // array sugar -var array: number[] = [1,2,\"...\"]; +var array: number[] = [1,2,\\"...\\"]; var matrix: number[][] = [[1,2],[3,4]]; var matrix_parens: (number[])[] = matrix; @@ -21,15 +23,15 @@ var nullable_array_parens: ?(number[]) = nullable_array; var array_of_nullable: (?number)[] = [null, 3]; -var array_of_tuple: [number, string][] = [[0, \"foo\"], [1, \"bar\"]]; +var array_of_tuple: [number, string][] = [[0, \\"foo\\"], [1, \\"bar\\"]]; var array_of_tuple_parens: ([number, string])[] = array_of_tuple; -type ObjType = { \'bar-foo\': string; \'foo-bar\': number; }; -var test_obj: ObjType = { \'bar-foo\': \'23\' }; +type ObjType = { 'bar-foo': string; 'foo-bar': number; }; +var test_obj: ObjType = { 'bar-foo': '23' }; // param type annos are strict UBs like var type annos function param_anno(n:number):void { - n = \"hey\"; // error + n = \\"hey\\"; // error } // another error on param UB, more typical of www (mis)use-cases @@ -38,7 +40,7 @@ function param_anno2( batchRequests: Array<{method: string; path: string; params: ?Object}>, ): void { - // error below, since we\'re assigning elements to batchRequests + // error below, since we're assigning elements to batchRequests // which lack a path property. // just assign result to new var instead of reassigning to param. @@ -70,15 +72,15 @@ var qux = function(str: string, i: number): number { }; var obj: { str: string, i: number, j: boolean } = { - str: \"...\", - i: \"...\", + str: \\"...\\", + i: \\"...\\", k: false }; -var arr: Array = [1, 2, \"...\"]; +var arr: Array = [1, 2, \\"...\\"]; // array sugar -var array: number[] = [1, 2, \"...\"]; +var array: number[] = [1, 2, \\"...\\"]; var matrix: number[][] = [[1, 2], [3, 4]]; var matrix_parens: number[][] = matrix; @@ -88,15 +90,15 @@ var nullable_array_parens: ?(number[]) = nullable_array; var array_of_nullable: (?number)[] = [null, 3]; -var array_of_tuple: [number, string][] = [[0, \"foo\"], [1, \"bar\"]]; +var array_of_tuple: [number, string][] = [[0, \\"foo\\"], [1, \\"bar\\"]]; var array_of_tuple_parens: [number, string][] = array_of_tuple; -type ObjType = { \"bar-foo\": string, \"foo-bar\": number }; -var test_obj: ObjType = { \"bar-foo\": \"23\" }; +type ObjType = { \\"bar-foo\\": string, \\"foo-bar\\": number }; +var test_obj: ObjType = { \\"bar-foo\\": \\"23\\" }; // param type annos are strict UBs like var type annos function param_anno(n: number): void { - n = \"hey\"; // error + n = \\"hey\\"; // error } // another error on param UB, more typical of www (mis)use-cases @@ -104,7 +106,7 @@ function param_anno(n: number): void { function param_anno2( batchRequests: Array<{ method: string, path: string, params: ?Object }> ): void { - // error below, since we\'re assigning elements to batchRequests + // error below, since we're assigning elements to batchRequests // which lack a path property. // just assign result to new var instead of reassigning to param. @@ -132,7 +134,7 @@ function barfoo(n: number | null | void): ?number { " `; -exports[`test forward_ref.js 1`] = ` +exports[`forward_ref.js 1`] = ` "let myClassInstance: MyClass = null; // forward ref ok, null ~> class error function bar(): MyClass { @@ -167,7 +169,7 @@ function foo() { " `; -exports[`test issue-530.js 1`] = ` +exports[`issue-530.js 1`] = ` "function foo(...args: any) { } module.exports = foo; @@ -178,7 +180,7 @@ module.exports = foo; " `; -exports[`test leak.js 1`] = ` +exports[`leak.js 1`] = ` "/** @flow */ /* This test documents an example we ran into of a type annotation leaking. @@ -187,7 +189,7 @@ exports[`test leak.js 1`] = ` * annotation for y and stop. We should type the body of bar() with the type * annotation of y. * - * However, the leaky type annotation meant that we were flowing x\'s type to y + * However, the leaky type annotation meant that we were flowing x's type to y * and type checking the body of bar() using the stricter dictionary type, * leading to an error. */ @@ -210,7 +212,7 @@ function bar(y: MyObj): string { * annotation for y and stop. We should type the body of bar() with the type * annotation of y. * - * However, the leaky type annotation meant that we were flowing x\'s type to y + * However, the leaky type annotation meant that we were flowing x's type to y * and type checking the body of bar() using the stricter dictionary type, * leading to an error. */ @@ -227,7 +229,7 @@ function bar(y: MyObj): string { " `; -exports[`test other.js 1`] = ` +exports[`other.js 1`] = ` "class C { } module.exports = (C: any); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -236,7 +238,7 @@ module.exports = (C: any); " `; -exports[`test scope.js 1`] = ` +exports[`scope.js 1`] = ` "type Merge = (a: T, b: T) => T; // hypothetical immutable map @@ -293,11 +295,11 @@ class Foo { " `; -exports[`test test.js 1`] = ` -"var C = require(\'./other\'); +exports[`test.js 1`] = ` +"var C = require('./other'); ((0: C): string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var C = require(\"./other\"); +var C = require(\\"./other\\"); ((0: C): string); " `; diff --git a/tests/flow/annot/any/__snapshots__/jsfmt.spec.js.snap b/tests/flow/annot/any/__snapshots__/jsfmt.spec.js.snap index 615ab79ed..2232cb0e0 100644 --- a/tests/flow/annot/any/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/annot/any/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "type T = any; export default class { @@ -21,14 +23,14 @@ export default class { " `; -exports[`test B.js 1`] = ` -"import A from \"./A\" +exports[`B.js 1`] = ` +"import A from \\"./A\\" class B extends A { p: string; // OK, string ~> any } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import A from \"./A\"; +import A from \\"./A\\"; class B extends A { p: string; // OK, string ~> any diff --git a/tests/flow/annot2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/annot2/__snapshots__/jsfmt.spec.js.snap index 6f24ee06a..331453070 100644 --- a/tests/flow/annot2/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/annot2/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/** * @providesModule A * @flow */ -import type T from \"T\"; +import type T from \\"T\\"; export default class { p: T; @@ -19,7 +21,7 @@ export default class { * @flow */ -import type T from \"T\"; +import type T from \\"T\\"; export default class { p: T; @@ -31,12 +33,12 @@ export default class { " `; -exports[`test B.js 1`] = ` +exports[`B.js 1`] = ` "/** * @flow */ -import A from \"A\" +import A from \\"A\\" class B extends A { p: string; // OK, string ~> any @@ -46,7 +48,7 @@ class B extends A { * @flow */ -import A from \"A\"; +import A from \\"A\\"; class B extends A { p: string; // OK, string ~> any @@ -54,7 +56,7 @@ class B extends A { " `; -exports[`test T.js 1`] = ` +exports[`T.js 1`] = ` "/** * @providesModule T */ diff --git a/tests/flow/any/__snapshots__/jsfmt.spec.js.snap b/tests/flow/any/__snapshots__/jsfmt.spec.js.snap index 9ce266d26..2404ac011 100644 --- a/tests/flow/any/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/any/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test any.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`any.js 1`] = ` "// @flow function foo(x:any):any { return x; } @@ -27,7 +29,7 @@ var z: string = qux(0); " `; -exports[`test anyexportflowfile.js 1`] = ` +exports[`anyexportflowfile.js 1`] = ` "// @flow module.exports = ((x: any) => x: any); @@ -38,7 +40,7 @@ module.exports = ((x: any) => x: any); " `; -exports[`test flowfixme.js 1`] = ` +exports[`flowfixme.js 1`] = ` "/* FlowFixMe is a synonym for any, used by the Flow team to signal a needed mod to JS devs. @@ -89,7 +91,7 @@ var w: string = baz(0); " `; -exports[`test flowissue.js 1`] = ` +exports[`flowissue.js 1`] = ` "/* $FlowIssue is a synonym for any, used by JS devs to signal a potential typechecker bug to the Flow team. @@ -140,7 +142,7 @@ var w: string = baz(0); " `; -exports[`test nonflowfile.js 1`] = ` +exports[`nonflowfile.js 1`] = ` "// @noflow module.exports = (x) => x; @@ -151,7 +153,7 @@ module.exports = x => x; " `; -exports[`test propagate.js 1`] = ` +exports[`propagate.js 1`] = ` "// @flow declare class C { @@ -164,14 +166,14 @@ function foo(c: C, x: any): string { return c.bar(0, y); // should be able to select first case and error } -var any_fun1 = require(\'./nonflowfile\'); +var any_fun1 = require('./nonflowfile'); function bar1(x: mixed) { if (any_fun1(x)) { (x: boolean); } } -var any_fun2 = require(\'./anyexportflowfile\'); +var any_fun2 = require('./anyexportflowfile'); function bar2(x: mixed) { if (any_fun2(x)) { (x: boolean); @@ -190,14 +192,14 @@ function foo(c: C, x: any): string { return c.bar(0, y); // should be able to select first case and error } -var any_fun1 = require(\"./nonflowfile\"); +var any_fun1 = require(\\"./nonflowfile\\"); function bar1(x: mixed) { if (any_fun1(x)) { (x: boolean); } } -var any_fun2 = require(\"./anyexportflowfile\"); +var any_fun2 = require(\\"./anyexportflowfile\\"); function bar2(x: mixed) { if (any_fun2(x)) { (x: boolean); @@ -206,7 +208,7 @@ function bar2(x: mixed) { " `; -exports[`test reach.js 1`] = ` +exports[`reach.js 1`] = ` "/** * like class and function values, any-typed values may be used in * type annotations. Here we test propagation of any through the diff --git a/tests/flow/arith/__snapshots__/jsfmt.spec.js.snap b/tests/flow/arith/__snapshots__/jsfmt.spec.js.snap index 6f4d1a212..81a8170a1 100644 --- a/tests/flow/arith/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/arith/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test Arith.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Arith.js 1`] = ` " /* @providesModule Arith */ @@ -8,7 +10,7 @@ function str(x:string) { } function foo() { var x = 0; - var y = \"...\"; + var y = \\"...\\"; var z = {}; num(x+x); num(x+y); // error @@ -54,20 +56,20 @@ num(true + null); // === 1 num(undefined + true); // === NaN num(true + undefined); // === NaN -str(\"foo\" + true); // error -str(true + \"foo\"); // error -str(\"foo\" + null); // error -str(null + \"foo\"); // error -str(\"foo\" + undefined); // error -str(undefined + \"foo\"); // error +str(\\"foo\\" + true); // error +str(true + \\"foo\\"); // error +str(\\"foo\\" + null); // error +str(null + \\"foo\\"); // error +str(\\"foo\\" + undefined); // error +str(undefined + \\"foo\\"); // error let tests = [ function(x: mixed, y: mixed) { (x + y); // error (x + 0); // error (0 + x); // error - (x + \"\"); // error - (\"\" + x); // error + (x + \\"\\"); // error + (\\"\\" + x); // error (x + {}); // error ({} + x); // error }, @@ -78,8 +80,8 @@ let tests = [ function() { ((1 + {}): number); // error: object !~> number (({} + 1): number); // error: object !~> number - ((\"1\" + {}): string); // error: object !~> string - (({} + \"1\"): string); // error: object !~> string + ((\\"1\\" + {}): string); // error: object !~> string + (({} + \\"1\\"): string); // error: object !~> string }, function(x: any, y: number, z: string) { @@ -99,7 +101,7 @@ function str(x: string) {} function foo() { var x = 0; - var y = \"...\"; + var y = \\"...\\"; var z = {}; num(x + x); num(x + y); // error @@ -145,20 +147,20 @@ num(true + null); // === 1 num(undefined + true); // === NaN num(true + undefined); // === NaN -str(\"foo\" + true); // error -str(true + \"foo\"); // error -str(\"foo\" + null); // error -str(null + \"foo\"); // error -str(\"foo\" + undefined); // error -str(undefined + \"foo\"); // error +str(\\"foo\\" + true); // error +str(true + \\"foo\\"); // error +str(\\"foo\\" + null); // error +str(null + \\"foo\\"); // error +str(\\"foo\\" + undefined); // error +str(undefined + \\"foo\\"); // error let tests = [ function(x: mixed, y: mixed) { x + y; // error x + 0; // error 0 + x; // error - x + \"\"; // error - \"\" + x; // error + x + \\"\\"; // error + \\"\\" + x; // error x + {}; // error ({}) + x; // error }, @@ -169,8 +171,8 @@ let tests = [ function() { (1 + {}: number); // error: object !~> number ({} + 1: number); // error: object !~> number - (\"1\" + {}: string); // error: object !~> string - ({} + \"1\": string); // error: object !~> string + (\\"1\\" + {}: string); // error: object !~> string + ({} + \\"1\\": string); // error: object !~> string }, function(x: any, y: number, z: string) { @@ -184,13 +186,13 @@ let tests = [ " `; -exports[`test exponent.js 1`] = ` +exports[`exponent.js 1`] = ` "/* @flow */ let x: number = 2 ** 3; x **= 4; -let y: string = \"123\"; +let y: string = \\"123\\"; y **= 2; // error 1 + 2 ** 3 + 4; @@ -202,7 +204,7 @@ y **= 2; // error let x: number = 2 ** 3; x **= 4; -let y: string = \"123\"; +let y: string = \\"123\\"; y **= 2; // error 1 + 2 ** 3 + 4; @@ -211,7 +213,7 @@ y **= 2; // error " `; -exports[`test generic.js 1`] = ` +exports[`generic.js 1`] = ` "/* @flow */ function f(a: A): A { return a + a; } // error @@ -240,7 +242,7 @@ function f(a: A, b: B): B { " `; -exports[`test mult.js 1`] = ` +exports[`mult.js 1`] = ` "/* @flow */ function num(x:number) { } @@ -251,7 +253,7 @@ num(1 * null); let x: number = 2 * 3; x *= 4; -let y: string = \"123\"; +let y: string = \\"123\\"; y *= 2; // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -264,23 +266,23 @@ num(1 * null); let x: number = 2 * 3; x *= 4; -let y: string = \"123\"; +let y: string = \\"123\\"; y *= 2; // error " `; -exports[`test relational.js 1`] = ` +exports[`relational.js 1`] = ` "/* @flow */ (1 < 2); -(1 < \"foo\"); // error -(\"foo\" < 1); // error -(\"foo\" < \"bar\"); +(1 < \\"foo\\"); // error +(\\"foo\\" < 1); // error +(\\"foo\\" < \\"bar\\"); (1 < {foo: 1}); // error ({foo: 1} < 1); // error ({foo: 1} < {foo: 1}); // error -(\"foo\" < {foo: 1}); // error -({foo: 1} < \"foo\"); // error +(\\"foo\\" < {foo: 1}); // error +({foo: 1} < \\"foo\\"); // error var x = (null : ?number); (1 < x); // 2 errors: null !~> number; undefined !~> number @@ -304,14 +306,14 @@ let tests = [ /* @flow */ 1 < 2; -1 < \"foo\"; // error -\"foo\" < 1; // error -\"foo\" < \"bar\"; +1 < \\"foo\\"; // error +\\"foo\\" < 1; // error +\\"foo\\" < \\"bar\\"; 1 < { foo: 1 }; // error ({ foo: 1 }) < 1; // error ({ foo: 1 }) < { foo: 1 }; // error -\"foo\" < { foo: 1 }; // error -({ foo: 1 }) < \"foo\"; // error +\\"foo\\" < { foo: 1 }; // error +({ foo: 1 }) < \\"foo\\"; // error var x = (null: ?number); 1 < x; // 2 errors: null !~> number; undefined !~> number diff --git a/tests/flow/array-filter/__snapshots__/jsfmt.spec.js.snap b/tests/flow/array-filter/__snapshots__/jsfmt.spec.js.snap index 4cc7e369f..392a38943 100644 --- a/tests/flow/array-filter/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/array-filter/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "/* @flow */ function filterOutVoids (arr: Array): Array { @@ -21,12 +23,12 @@ function filterOutSmall(arr: Array): Array { " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "/* @flow */ function filterItems(items: Array): Array { return items.map(item => { - if (typeof item === \'string\') { + if (typeof item === 'string') { return item.length > 2 ? item : null; } else { return item*10; @@ -34,7 +36,7 @@ function filterItems(items: Array): Array { }).filter(Boolean); } -const filteredItems = filterItems([\'foo\', \'b\', 1, 2]); +const filteredItems = filterItems(['foo', 'b', 1, 2]); console.log(filteredItems); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -43,7 +45,7 @@ console.log(filteredItems); function filterItems(items: Array): Array { return items .map(item => { - if (typeof item === \"string\") { + if (typeof item === \\"string\\") { return item.length > 2 ? item : null; } else { return item * 10; @@ -52,7 +54,7 @@ function filterItems(items: Array): Array { .filter(Boolean); } -const filteredItems = filterItems([\"foo\", \"b\", 1, 2]); +const filteredItems = filterItems([\\"foo\\", \\"b\\", 1, 2]); console.log(filteredItems); " diff --git a/tests/flow/array_spread/__snapshots__/jsfmt.spec.js.snap b/tests/flow/array_spread/__snapshots__/jsfmt.spec.js.snap index e5b00076f..458cf3147 100644 --- a/tests/flow/array_spread/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/array_spread/__snapshots__/jsfmt.spec.js.snap @@ -1,12 +1,14 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "var A = [1,2,3]; var B = [...A]; var C = [1,2,3]; B.sort((a, b) => a - b); C.sort((a, b) => a - b); -var x: Array = [\'1\', \'2\']; -var y: Array = [\'3\', ...x]; +var x: Array = ['1', '2']; +var y: Array = ['3', ...x]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var A = [1, 2, 3]; var B = [...A]; @@ -14,7 +16,7 @@ var C = [1, 2, 3]; B.sort((a, b) => a - b); C.sort((a, b) => a - b); -var x: Array = [\"1\", \"2\"]; -var y: Array = [\"3\", ...x]; +var x: Array = [\\"1\\", \\"2\\"]; +var y: Array = [\\"3\\", ...x]; " `; diff --git a/tests/flow/arraylib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/arraylib/__snapshots__/jsfmt.spec.js.snap index b5be6bc42..f573a5085 100644 --- a/tests/flow/arraylib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/arraylib/__snapshots__/jsfmt.spec.js.snap @@ -1,25 +1,27 @@ -exports[`test array_lib.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`array_lib.js 1`] = ` "/* @flow */ function foo(x:string) { } var a = [0]; -var b = a.map(function (x) { foo(x); return \"\" + x; }); +var b = a.map(function (x) { foo(x); return \\"\\" + x; }); var c: number = a[0]; var d: number = b[0]; var e:Array = a.reverse(); -var f = [\"\"]; +var f = [\\"\\"]; var g:number = f.map(function () { return 0; })[0]; var h: Array = [1,2,3]; -var i: Array = [\'a\', \'b\', \'c\']; +var i: Array = ['a', 'b', 'c']; var j: Array = h.concat(i); var k: Array = h.concat(h); var l: Array = h.concat(1,2,3); -var m: Array = h.concat(\'a\', \'b\', \'c\'); -var n: Array = h.concat(\'a\', \'b\', \'c\'); // Error +var m: Array = h.concat('a', 'b', 'c'); +var n: Array = h.concat('a', 'b', 'c'); // Error function reduce_test() { /* Adapted from the following source: @@ -44,13 +46,13 @@ function reduce_test() { /* Added later, because the above is insufficient */ // acc is element type of array when no init is provided - [\"\"].reduce((acc, str) => acc * str.length); // error, string ~> number - [\"\"].reduceRight((acc, str) => acc * str.length); // error, string ~> number + [\\"\\"].reduce((acc, str) => acc * str.length); // error, string ~> number + [\\"\\"].reduceRight((acc, str) => acc * str.length); // error, string ~> number } function from_test() { var a: Array = Array.from([1, 2, 3], function(val, index) { - return index % 2 ? \"foo\" : String(val); + return index % 2 ? \\"foo\\" : String(val); }); var b: Array = Array.from([1, 2, 3], function(val) { return String(val); @@ -63,7 +65,7 @@ function foo(x: string) {} var a = [0]; var b = a.map(function(x) { foo(x); - return \"\" + x; + return \\"\\" + x; }); var c: number = a[0]; @@ -71,18 +73,18 @@ var d: number = b[0]; var e: Array = a.reverse(); -var f = [\"\"]; +var f = [\\"\\"]; var g: number = f.map(function() { return 0; })[0]; var h: Array = [1, 2, 3]; -var i: Array = [\"a\", \"b\", \"c\"]; +var i: Array = [\\"a\\", \\"b\\", \\"c\\"]; var j: Array = h.concat(i); var k: Array = h.concat(h); var l: Array = h.concat(1, 2, 3); -var m: Array = h.concat(\"a\", \"b\", \"c\"); -var n: Array = h.concat(\"a\", \"b\", \"c\"); // Error +var m: Array = h.concat(\\"a\\", \\"b\\", \\"c\\"); +var n: Array = h.concat(\\"a\\", \\"b\\", \\"c\\"); // Error function reduce_test() { /* Adapted from the following source: @@ -110,13 +112,13 @@ function reduce_test() { /* Added later, because the above is insufficient */ // acc is element type of array when no init is provided - [\"\"].reduce((acc, str) => acc * str.length); // error, string ~> number - [\"\"].reduceRight((acc, str) => acc * str.length); // error, string ~> number + [\\"\\"].reduce((acc, str) => acc * str.length); // error, string ~> number + [\\"\\"].reduceRight((acc, str) => acc * str.length); // error, string ~> number } function from_test() { var a: Array = Array.from([1, 2, 3], function(val, index) { - return index % 2 ? \"foo\" : String(val); + return index % 2 ? \\"foo\\" : String(val); }); var b: Array = Array.from([1, 2, 3], function(val) { return String(val); diff --git a/tests/flow/arrays/__snapshots__/jsfmt.spec.js.snap b/tests/flow/arrays/__snapshots__/jsfmt.spec.js.snap index 54e281694..28b3cd9c5 100644 --- a/tests/flow/arrays/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/arrays/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test Arrays.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Arrays.js 1`] = ` " /* @providesModule Arrays */ @@ -6,7 +8,7 @@ function foo(x:string) { } var a = []; a[0] = 1; -a[1] = \"...\"; +a[1] = \\"...\\"; foo(a[1]); var y; @@ -32,12 +34,12 @@ var abig2: Array<{x:number; y:number}> = [ {x:0, y:0}, {x:0, y:0}, {x:0, y:0, a:true}, - {x:0, y:0, b:\"hey\"}, + {x:0, y:0, b:\\"hey\\"}, {x:0, y:0, c:1}, - {x:0, y:0, c:\"hey\"} + {x:0, y:0, c:\\"hey\\"} ]; -module.exports = \"arrays\"; +module.exports = \\"arrays\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule Arrays */ @@ -45,7 +47,7 @@ function foo(x: string) {} var a = []; a[0] = 1; -a[1] = \"...\"; +a[1] = \\"...\\"; foo(a[1]); var y; @@ -71,16 +73,16 @@ var abig2: Array<{ x: number, y: number }> = [ { x: 0, y: 0 }, { x: 0, y: 0 }, { x: 0, y: 0, a: true }, - { x: 0, y: 0, b: \"hey\" }, + { x: 0, y: 0, b: \\"hey\\" }, { x: 0, y: 0, c: 1 }, - { x: 0, y: 0, c: \"hey\" } + { x: 0, y: 0, c: \\"hey\\" } ]; -module.exports = \"arrays\"; +module.exports = \\"arrays\\"; " `; -exports[`test numeric_elem.js 1`] = ` +exports[`numeric_elem.js 1`] = ` "var arr = []; var day = new Date; diff --git a/tests/flow/arrows/__snapshots__/jsfmt.spec.js.snap b/tests/flow/arrows/__snapshots__/jsfmt.spec.js.snap index 963c66cba..5e28eb402 100644 --- a/tests/flow/arrows/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/arrows/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test advanced_arrows.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`advanced_arrows.js 1`] = ` "/** * @flow */ @@ -9,7 +11,7 @@ var bad = (x: number): string => x; // Error! var ident = (x: T): T => x; (ident(1): number); -(ident(\"hi\"): number); // Error +(ident(\\"hi\\"): number); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow @@ -21,18 +23,18 @@ var bad = (x: number): string => x; // Error! var ident = (x: T): T => x; (ident(1): number); -(ident(\"hi\"): number); // Error +(ident(\\"hi\\"): number); // Error " `; -exports[`test arrows.js 1`] = ` +exports[`arrows.js 1`] = ` "function selectBestEffortImageForWidth( maxWidth: number, images: Array ): Image { var maxPixelWidth = maxWidth; //images = images.sort(function (a, b) { return a.width - b.width }); - images = images.sort((a, b) => (a.width - b.width) + \"\"); + images = images.sort((a, b) => (a.width - b.width) + \\"\\"); return images.find(image => image.width >= maxPixelWidth) || images[images.length - 1]; } @@ -43,7 +45,7 @@ function selectBestEffortImageForWidth( ): Image { var maxPixelWidth = maxWidth; //images = images.sort(function (a, b) { return a.width - b.width }); - images = images.sort((a, b) => a.width - b.width + \"\"); + images = images.sort((a, b) => a.width - b.width + \\"\\"); return images.find(image => image.width >= maxPixelWidth) || images[images.length - 1]; } diff --git a/tests/flow/async/__snapshots__/jsfmt.spec.js.snap b/tests/flow/async/__snapshots__/jsfmt.spec.js.snap index ae343e177..eb6e11e02 100644 --- a/tests/flow/async/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/async/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test async.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`async.js 1`] = ` "// @flow -// \"For async functions, a Promise is returned, -// and the type of return expressions must be T.\" +// \\"For async functions, a Promise is returned, +// and the type of return expressions must be T.\\" // async function f0(): Promise { @@ -27,7 +29,7 @@ async function f3(p: Promise): Promise { } // TODO: this is one of those bad generic errors, currently: -// \"inconsistent use of library definitions\" with two core.js locs +// \\"inconsistent use of library definitions\\" with two core.js locs async function f4(p: Promise): Promise { return await p; // error, number != bool } @@ -54,8 +56,8 @@ var objf : () => Promise = obj.f; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -// \"For async functions, a Promise is returned, -// and the type of return expressions must be T.\" +// \\"For async functions, a Promise is returned, +// and the type of return expressions must be T.\\" // async function f0(): Promise { @@ -80,7 +82,7 @@ async function f3(p: Promise): Promise { } // TODO: this is one of those bad generic errors, currently: -// \"inconsistent use of library definitions\" with two core.js locs +// \\"inconsistent use of library definitions\\" with two core.js locs async function f4(p: Promise): Promise { return await p; // error, number != bool } @@ -115,10 +117,10 @@ var objf: () => Promise = obj.f; " `; -exports[`test async_base_class.js 1`] = ` +exports[`async_base_class.js 1`] = ` "// This is kind of weird, but it should parse. This works in babel without the // parens around (await promise). From the es6 and async/await specs I (nmote) -// am not clear on whether it should. In any case it\'s a strange corner case +// am not clear on whether it should. In any case it's a strange corner case // that is probably not important to support. class C {}; @@ -133,7 +135,7 @@ async function foo() { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // This is kind of weird, but it should parse. This works in babel without the // parens around (await promise). From the es6 and async/await specs I (nmote) -// am not clear on whether it should. In any case it\'s a strange corner case +// am not clear on whether it should. In any case it's a strange corner case // that is probably not important to support. class C {} @@ -148,7 +150,7 @@ async function foo() { " `; -exports[`test async_parse.js 1`] = ` +exports[`async_parse.js 1`] = ` "async function f() {} async function ft(a: T) {} @@ -201,7 +203,7 @@ var y = { async }; " `; -exports[`test async_promise.js 1`] = ` +exports[`async_promise.js 1`] = ` "async function f(): Promise { return Promise.resolve(1); } @@ -212,7 +214,7 @@ async function f(): Promise { " `; -exports[`test async_return_void.js 1`] = ` +exports[`async_return_void.js 1`] = ` "// @flow async function foo1(): Promise { @@ -245,7 +247,7 @@ async function foo3(): Promise { " `; -exports[`test async2.js 1`] = ` +exports[`async2.js 1`] = ` "// @flow // misc basic @@ -272,7 +274,7 @@ function test1() { function test2() { async function voidoid1() { - console.log(\"HEY\"); + console.log(\\"HEY\\"); } var voidoid2: () => Promise = voidoid1; // ok @@ -285,7 +287,7 @@ function test2() { function test3() { async function voidoid4(): Promise { // ok - console.log(\"HEY\"); + console.log(\\"HEY\\"); } } @@ -296,14 +298,14 @@ function test3() { function test4() { async function voidoid5(): void { // error, void != Promise - console.log(\"HEY\"); + console.log(\\"HEY\\"); } } function test5() { async function voidoid6() : Promise { // error, number != void - console.log(\"HEY\"); + console.log(\\"HEY\\"); } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -333,7 +335,7 @@ function test1() { function test2() { async function voidoid1() { - console.log(\"HEY\"); + console.log(\\"HEY\\"); } var voidoid2: () => Promise = voidoid1; // ok @@ -347,7 +349,7 @@ function test2() { function test3() { async function voidoid4(): Promise { // ok - console.log(\"HEY\"); + console.log(\\"HEY\\"); } } @@ -359,27 +361,27 @@ function test3() { function test4() { async function voidoid5(): void { // error, void != Promise - console.log(\"HEY\"); + console.log(\\"HEY\\"); } } function test5() { async function voidoid6(): Promise { // error, number != void - console.log(\"HEY\"); + console.log(\\"HEY\\"); } } " `; -exports[`test async3.js 1`] = ` +exports[`async3.js 1`] = ` "// @flow /** * test nested-promise unwrapping. - * Note: currently we don\'t do this properly in the underlying + * Note: currently we don't do this properly in the underlying * type of the Promise class, which causes spurious errors to - * be raised here. Once that\'s fixed, the errors here will go + * be raised here. Once that's fixed, the errors here will go * away. */ @@ -410,9 +412,9 @@ async function baz() { /** * test nested-promise unwrapping. - * Note: currently we don\'t do this properly in the underlying + * Note: currently we don't do this properly in the underlying * type of the Promise class, which causes spurious errors to - * be raised here. Once that\'s fixed, the errors here will go + * be raised here. Once that's fixed, the errors here will go * away. */ @@ -440,7 +442,7 @@ async function baz() { " `; -exports[`test await_parse.js 1`] = ` +exports[`await_parse.js 1`] = ` "async function f() { await 1; } async function ft(a: T) { await 1; } diff --git a/tests/flow/async_iteration/__snapshots__/jsfmt.spec.js.snap b/tests/flow/async_iteration/__snapshots__/jsfmt.spec.js.snap index c4f8a3418..477f51c7c 100644 --- a/tests/flow/async_iteration/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/async_iteration/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test delegate_yield.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`delegate_yield.js 1`] = ` "async function *delegate_next() { async function *inner() { var x: void = yield; // error: number ~> void @@ -55,7 +57,7 @@ async function* delegate_return() { " `; -exports[`test generator.js 1`] = ` +exports[`generator.js 1`] = ` "declare interface File { readLine(): Promise; close(): void; @@ -77,7 +79,7 @@ async function* readLines(path) { } async function f() { - for await (const line of readLines(\"/path/to/file\")) { + for await (const line of readLines(\\"/path/to/file\\")) { (line: void); // error: string ~> void } } @@ -103,23 +105,23 @@ async function* readLines(path) { } async function f() { - for await (const line of readLines(\"/path/to/file\")) { + for await (const line of readLines(\\"/path/to/file\\")) { (line: void); // error: string ~> void } } " `; -exports[`test return.js 1`] = ` +exports[`return.js 1`] = ` "declare var gen: AsyncGenerator; -// You can pass whatever you like to return, it doesn\'t need to be related to -// the AsyncGenerator\'s return type +// You can pass whatever you like to return, it doesn't need to be related to +// the AsyncGenerator's return type gen.return(0).then(result => { (result.value: void); // error: string | number ~> void }); -// However, a generator can \"refuse\" the return by catching an exception and +// However, a generator can \\"refuse\\" the return by catching an exception and // yielding or returning internally. async function *refuse_return() { try { @@ -128,7 +130,7 @@ async function *refuse_return() { return 0; } } -refuse_return().return(\"string\").then(result => { +refuse_return().return(\\"string\\").then(result => { if (result.done) { (result.value: string); // error: number | void ~> string } @@ -136,13 +138,13 @@ refuse_return().return(\"string\").then(result => { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare var gen: AsyncGenerator; -// You can pass whatever you like to return, it doesn\'t need to be related to -// the AsyncGenerator\'s return type +// You can pass whatever you like to return, it doesn't need to be related to +// the AsyncGenerator's return type gen.return(0).then(result => { (result.value: void); // error: string | number ~> void }); -// However, a generator can \"refuse\" the return by catching an exception and +// However, a generator can \\"refuse\\" the return by catching an exception and // yielding or returning internally. async function* refuse_return() { try { @@ -151,7 +153,7 @@ async function* refuse_return() { return 0; } } -refuse_return().return(\"string\").then(result => { +refuse_return().return(\\"string\\").then(result => { if (result.done) { (result.value: string); // error: number | void ~> string } @@ -159,7 +161,7 @@ refuse_return().return(\"string\").then(result => { " `; -exports[`test throw.js 1`] = ` +exports[`throw.js 1`] = ` "async function *catch_return() { try { yield 0; @@ -169,7 +171,7 @@ exports[`test throw.js 1`] = ` } (async () => { - catch_return().throw(\"\").then(({value}) => { + catch_return().throw(\\"\\").then(({value}) => { if (value !== undefined) { (value: void); // error: number ~> void } @@ -186,7 +188,7 @@ async function *yield_return() { } (async () => { - yield_return().throw(\"\").then(({value}) => { + yield_return().throw(\\"\\").then(({value}) => { if (value !== undefined) { (value: void); // error: number ~> void } @@ -202,7 +204,7 @@ async function* catch_return() { } (async () => { - catch_return().throw(\"\").then(({ value }) => { + catch_return().throw(\\"\\").then(({ value }) => { if (value !== undefined) { (value: void); // error: number ~> void } @@ -219,7 +221,7 @@ async function* yield_return() { } (async () => { - yield_return().throw(\"\").then(({ value }) => { + yield_return().throw(\\"\\").then(({ value }) => { if (value !== undefined) { (value: void); // error: number ~> void } diff --git a/tests/flow/autocomplete/__snapshots__/jsfmt.spec.js.snap b/tests/flow/autocomplete/__snapshots__/jsfmt.spec.js.snap index 3161df6cd..478e73aed 100644 --- a/tests/flow/autocomplete/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/autocomplete/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test customfun.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`customfun.js 1`] = ` "// @flow declare var idx: $Facebookism$Idx; @@ -25,11 +27,11 @@ m; " `; -exports[`test unknown.js 1`] = ` +exports[`unknown.js 1`] = ` "// @noflow -module.exports = { x: { y: \"\" } }; +module.exports = { x: { y: \\"\\" } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @noflow -module.exports = { x: { y: \"\" } }; +module.exports = { x: { y: \\"\\" } }; " `; diff --git a/tests/flow/auxiliary/__snapshots__/jsfmt.spec.js.snap b/tests/flow/auxiliary/__snapshots__/jsfmt.spec.js.snap index 37d954bc5..4687a8d8e 100644 --- a/tests/flow/auxiliary/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/auxiliary/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test client.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`client.js 1`] = ` "var y:number = x; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var y: number = x; diff --git a/tests/flow/auxiliary/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/auxiliary/lib/__snapshots__/jsfmt.spec.js.snap index 0f050a1f8..5180d35de 100644 --- a/tests/flow/auxiliary/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/auxiliary/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test lib.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`lib.js 1`] = ` "declare var x: string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare var x: string; diff --git a/tests/flow/binary/__snapshots__/jsfmt.spec.js.snap b/tests/flow/binary/__snapshots__/jsfmt.spec.js.snap index d04fa0799..c19f968c7 100644 --- a/tests/flow/binary/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/binary/__snapshots__/jsfmt.spec.js.snap @@ -1,34 +1,36 @@ -exports[`test in.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`in.js 1`] = ` "// @flow let tests = [ // objects on RHS function() { - (\'foo\' in {}); - (\'foo\' in { foo: null }); + ('foo' in {}); + ('foo' in { foo: null }); (0 in {}); - (0 in { \"0\": null }); + (0 in { \\"0\\": null }); }, // arrays on RHS function() { - (\'foo\' in []); + ('foo' in []); (0 in []); - (\'length\' in []); + ('length' in []); }, // primitive classes on RHS function() { - (\'foo\' in new String(\'bar\')); - (\'foo\' in new Number(123)); + ('foo' in new String('bar')); + ('foo' in new Number(123)); }, // primitives on RHS function() { - (\'foo\' in 123); // error - (\'foo\' in \'bar\'); // error - (\'foo\' in void 0); // error - (\'foo\' in null); // error + ('foo' in 123); // error + ('foo' in 'bar'); // error + ('foo' in void 0); // error + ('foo' in null); // error }, // bogus stuff on LHS @@ -42,15 +44,15 @@ let tests = [ // in predicates function() { - if (\'foo\' in 123) {} // error - if (!\'foo\' in {}) {} // error, !\'foo\' is a boolean - if (!(\'foo\' in {})) {} + if ('foo' in 123) {} // error + if (!'foo' in {}) {} // error, !'foo' is a boolean + if (!('foo' in {})) {} }, // annotations on RHS function(x: Object, y: mixed) { - (\'foo\' in x); // ok - (\'foo\' in y); // error + ('foo' in x); // ok + ('foo' in y); // error }, ] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -59,31 +61,31 @@ let tests = [ let tests = [ // objects on RHS function() { - \"foo\" in {}; - \"foo\" in { foo: null }; + \\"foo\\" in {}; + \\"foo\\" in { foo: null }; 0 in {}; - 0 in { \"0\": null }; + 0 in { \\"0\\": null }; }, // arrays on RHS function() { - \"foo\" in []; + \\"foo\\" in []; 0 in []; - \"length\" in []; + \\"length\\" in []; }, // primitive classes on RHS function() { - \"foo\" in new String(\"bar\"); - \"foo\" in new Number(123); + \\"foo\\" in new String(\\"bar\\"); + \\"foo\\" in new Number(123); }, // primitives on RHS function() { - \"foo\" in 123; // error - \"foo\" in \"bar\"; // error - \"foo\" in void 0; // error - \"foo\" in null; // error + \\"foo\\" in 123; // error + \\"foo\\" in \\"bar\\"; // error + \\"foo\\" in void 0; // error + \\"foo\\" in null; // error }, // bogus stuff on LHS @@ -97,18 +99,18 @@ let tests = [ // in predicates function() { - if (\"foo\" in 123) { + if (\\"foo\\" in 123) { } // error - if (!\"foo\" in {}) { - } // error, !\'foo\' is a boolean - if (!(\"foo\" in {})) { + if (!\\"foo\\" in {}) { + } // error, !'foo' is a boolean + if (!(\\"foo\\" in {})) { } }, // annotations on RHS function(x: Object, y: mixed) { - \"foo\" in x; // ok - \"foo\" in y; // error + \\"foo\\" in x; // ok + \\"foo\\" in y; // error } ]; " diff --git a/tests/flow/binding/__snapshots__/jsfmt.spec.js.snap b/tests/flow/binding/__snapshots__/jsfmt.spec.js.snap index 495adf455..1ee41050c 100644 --- a/tests/flow/binding/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/binding/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test const.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`const.js 1`] = ` "const x = 0; // errors: const cannot be reassigned @@ -17,8 +19,8 @@ x &= 0; // regression tests -- OK to assign consts like this: -const { foo } = { foo: \"foo\" } -const [ bar ] = [\"bar\"]; +const { foo } = { foo: \\"foo\\" } +const [ bar ] = [\\"bar\\"]; (foo: number); // error: string ~> number (bar: number); // error: string ~> number @@ -45,8 +47,8 @@ x &= 0; // regression tests -- OK to assign consts like this: -const { foo } = { foo: \"foo\" }; -const [bar] = [\"bar\"]; +const { foo } = { foo: \\"foo\\" }; +const [bar] = [\\"bar\\"]; (foo: number); // error: string ~> number (bar: number); // error: string ~> number @@ -57,7 +59,7 @@ for (const { baz } of bazzes) { " `; -exports[`test rebinding.js 1`] = ` +exports[`rebinding.js 1`] = ` "/* @flow * test errors on illegal rebinding/reassignment * @@ -98,7 +100,7 @@ function type_var() { function type_reassign() { type A = number; - A = 42; // error: type alias ref\'d from value pos + A = 42; // error: type alias ref'd from value pos } // class x * @@ -296,7 +298,7 @@ function type_var() { function type_reassign() { type A = number; - A = 42; // error: type alias ref\'d from value pos + A = 42; // error: type alias ref'd from value pos } // class x * @@ -456,13 +458,13 @@ function fn_params_clash_fn_binding(x, y) { " `; -exports[`test scope.js 1`] = ` +exports[`scope.js 1`] = ` "function block_scope() { let a: number = 0; var b: number = 0; { - let a = \"\"; // ok: local to block - var b = \"\"; // error: string ~> number + let a = \\"\\"; // ok: local to block + var b = \\"\\"; // error: string ~> number } } @@ -470,12 +472,12 @@ function switch_scope(x: string) { let a: number = 0; var b: number = 0; switch (x) { - case \"foo\": - let a = \"\"; // ok: local to switch - var b = \"\"; // error: string ~> number + case \\"foo\\": + let a = \\"\\"; // ok: local to switch + var b = \\"\\"; // error: string ~> number break; - case \"bar\": - let a = \"\"; // error: a already bound in switch + case \\"bar\\": + let a = \\"\\"; // error: a already bound in switch break; } } @@ -486,43 +488,43 @@ function switch_scope(x: string) { function switch_scope2(x: number) { switch (x) { case 0: - a = \"\"; // error: assign before declaration + a = \\"\\"; // error: assign before declaration break; case 1: var b = a; // error: use before declaration break; case 2: - let a = \"\"; + let a = \\"\\"; break; case 3: - a = \"\"; // error: skipped initializer + a = \\"\\"; // error: skipped initializer break; case 4: var c:string = a; // error: skipped initializer break; } - a = \"\"; // error: a no longer in scope + a = \\"\\"; // error: a no longer in scope } function try_scope() { let a: number = 0; try { - let a = \"\"; // ok + let a = \\"\\"; // ok } catch (e) { - let a = \"\"; // ok + let a = \\"\\"; // ok } finally { - let a = \"\"; // ok + let a = \\"\\"; // ok } } function for_scope_let() { let a: number = 0; - for (let a = \"\" /* ok: local to init */;;) {} + for (let a = \\"\\" /* ok: local to init */;;) {} } function for_scope_var() { var a: number = 0; - for (var a = \"\" /* error: string ~> number */;;) {} + for (var a = \\"\\" /* error: string ~> number */;;) {} } function for_in_scope_let(o: Object) { @@ -556,7 +558,7 @@ function default_param_1() { function default_param_2() { // fn body bindings not visible from param scope - let a = \"\"; + let a = \\"\\"; function f0(x = () => a): number { let a = 0; return x(); // error: string ~> number @@ -571,8 +573,8 @@ function block_scope() { let a: number = 0; var b: number = 0; { - let a = \"\"; // ok: local to block - var b = \"\"; // error: string ~> number + let a = \\"\\"; // ok: local to block + var b = \\"\\"; // error: string ~> number } } @@ -580,12 +582,12 @@ function switch_scope(x: string) { let a: number = 0; var b: number = 0; switch (x) { - case \"foo\": - let a = \"\"; // ok: local to switch - var b = \"\"; // error: string ~> number + case \\"foo\\": + let a = \\"\\"; // ok: local to switch + var b = \\"\\"; // error: string ~> number break; - case \"bar\": - let a = \"\"; // error: a already bound in switch + case \\"bar\\": + let a = \\"\\"; // error: a already bound in switch break; } } @@ -596,44 +598,44 @@ function switch_scope(x: string) { function switch_scope2(x: number) { switch (x) { case 0: - a = \"\"; // error: assign before declaration + a = \\"\\"; // error: assign before declaration break; case 1: var b = a; // error: use before declaration break; case 2: - let a = \"\"; + let a = \\"\\"; break; case 3: - a = \"\"; // error: skipped initializer + a = \\"\\"; // error: skipped initializer break; case 4: var c: string = a; // error: skipped initializer break; } - a = \"\"; // error: a no longer in scope + a = \\"\\"; // error: a no longer in scope } function try_scope() { let a: number = 0; try { - let a = \"\"; // ok + let a = \\"\\"; // ok } catch (e) { - let a = \"\"; // ok + let a = \\"\\"; // ok } finally { - let a = \"\"; // ok + let a = \\"\\"; // ok } } function for_scope_let() { let a: number = 0; - for (let a = \"\" /* ok: local to init */; ; ) { + for (let a = \\"\\" /* ok: local to init */; ; ) { } } function for_scope_var() { var a: number = 0; - for (var a = \"\" /* error: string ~> number */; ; ) { + for (var a = \\"\\" /* error: string ~> number */; ; ) { } } @@ -672,7 +674,7 @@ function default_param_1() { function default_param_2() { // fn body bindings not visible from param scope - let a = \"\"; + let a = \\"\\"; function f0(x = () => a): number { let a = 0; return x(); // error: string ~> number @@ -685,7 +687,7 @@ function default_param_2() { " `; -exports[`test tdz.js 1`] = ` +exports[`tdz.js 1`] = ` "/** @flow */ // -- types --- @@ -702,7 +704,7 @@ type T2 = number; // while let is in TDZ. // - allow forward refs to lets from type positions. // -// currently we\'re too lenient about TDZ in closures - +// currently we're too lenient about TDZ in closures - // from value positions, we currently enforce TDZ only in-scope. // this is unsound - a let or const may remain uninitialized when // a lambda runs. But a simple conservative approach would prohibit @@ -740,12 +742,12 @@ function f3() { function foo() { return 0; } } var s2: string = foo(); // ok, hoisted outer not clobbered - function foo() { return \"\"; } + function foo() { return \\"\\"; } } // out-of-scope TDZ not enforced. sometimes right... function f4() { - function g() { return x + c; } // ok, g doesn\'t run in TDZ + function g() { return x + c; } // ok, g doesn't run in TDZ let x = 0; const c = 0; } @@ -753,7 +755,7 @@ function f4() { // ...sometimes wrong function f5() { function g() { return x; } - g(); // should error, but doesn\'t currently + g(); // should error, but doesn't currently let x = 0; const c = 0; } @@ -773,8 +775,8 @@ var z: C = new C(); // ok // --- vars --- -// it\'s possible to annotate a var with a non-maybe type, -// but leave it uninitialized until later (as long as it\'s +// it's possible to annotate a var with a non-maybe type, +// but leave it uninitialized until later (as long as it's // initialized before use) var a: number; // not an error per se - only if used before init @@ -803,7 +805,7 @@ type T2 = number; // while let is in TDZ. // - allow forward refs to lets from type positions. // -// currently we\'re too lenient about TDZ in closures - +// currently we're too lenient about TDZ in closures - // from value positions, we currently enforce TDZ only in-scope. // this is unsound - a let or const may remain uninitialized when // a lambda runs. But a simple conservative approach would prohibit @@ -844,7 +846,7 @@ function f3() { } var s2: string = foo(); // ok, hoisted outer not clobbered function foo() { - return \"\"; + return \\"\\"; } } @@ -852,7 +854,7 @@ function f3() { function f4() { function g() { return x + c; - } // ok, g doesn\'t run in TDZ + } // ok, g doesn't run in TDZ let x = 0; const c = 0; } @@ -862,7 +864,7 @@ function f5() { function g() { return x; } - g(); // should error, but doesn\'t currently + g(); // should error, but doesn't currently let x = 0; const c = 0; } @@ -882,8 +884,8 @@ var z: C = new C(); // ok // --- vars --- -// it\'s possible to annotate a var with a non-maybe type, -// but leave it uninitialized until later (as long as it\'s +// it's possible to annotate a var with a non-maybe type, +// but leave it uninitialized until later (as long as it's // initialized before use) var a: number; // not an error per se - only if used before init diff --git a/tests/flow/bom/__snapshots__/jsfmt.spec.js.snap b/tests/flow/bom/__snapshots__/jsfmt.spec.js.snap index a64586e29..7a8c5584c 100644 --- a/tests/flow/bom/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/bom/__snapshots__/jsfmt.spec.js.snap @@ -1,55 +1,57 @@ -exports[`test FormData.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FormData.js 1`] = ` "/* @flow */ // constructor const a: FormData = new FormData(); // correct -new FormData(\'\'); // incorrect -new FormData(document.createElement(\'input\')); // incorrect -new FormData(document.createElement(\'form\')); // correct +new FormData(''); // incorrect +new FormData(document.createElement('input')); // incorrect +new FormData(document.createElement('form')); // correct // has -const b: boolean = a.has(\'foo\'); // correct +const b: boolean = a.has('foo'); // correct // get -const c: ?(string | File) = a.get(\'foo\'); // correct -const d: string = a.get(\'foo\'); // incorrect -const e: Blob = a.get(\'foo\'); // incorrect -const f: ?(string | File | Blob) = a.get(\'foo\'); // incorrect +const c: ?(string | File) = a.get('foo'); // correct +const d: string = a.get('foo'); // incorrect +const e: Blob = a.get('foo'); // incorrect +const f: ?(string | File | Blob) = a.get('foo'); // incorrect a.get(2); // incorrect // getAll -const a1: Array = a.getAll(\'foo\'); // correct -const a2: Array = a.getAll(\'foo\'); // incorrect -const a3: Array = a.getAll(\'foo\'); // incorrect +const a1: Array = a.getAll('foo'); // correct +const a2: Array = a.getAll('foo'); // incorrect +const a3: Array = a.getAll('foo'); // incorrect a.getAll(23); // incorrect // set -a.set(\'foo\', \'bar\'); // correct -a.set(\'foo\', {}); // incorrect -a.set(2, \'bar\'); // incorrect -a.set(\'foo\', \'bar\', \'baz\'); // incorrect -a.set(\'bar\', new File([], \'q\')) // correct -a.set(\'bar\', new File([], \'q\'), \'x\') // correct -a.set(\'bar\', new File([], \'q\'), 2) // incorrect -a.set(\'bar\', new Blob) // correct -a.set(\'bar\', new Blob, \'x\') // correct -a.set(\'bar\', new Blob, 2) // incorrect +a.set('foo', 'bar'); // correct +a.set('foo', {}); // incorrect +a.set(2, 'bar'); // incorrect +a.set('foo', 'bar', 'baz'); // incorrect +a.set('bar', new File([], 'q')) // correct +a.set('bar', new File([], 'q'), 'x') // correct +a.set('bar', new File([], 'q'), 2) // incorrect +a.set('bar', new Blob) // correct +a.set('bar', new Blob, 'x') // correct +a.set('bar', new Blob, 2) // incorrect // append -a.append(\'foo\', \'bar\'); // correct -a.append(\'foo\', {}); // incorrect -a.append(2, \'bar\'); // incorrect -a.append(\'foo\', \'bar\', \'baz\'); // incorrect -a.append(\'foo\', \'bar\'); // incorrect -a.append(\'bar\', new File([], \'q\')) // correct -a.append(\'bar\', new File([], \'q\'), \'x\') // correct -a.append(\'bar\', new File([], \'q\'), 2) // incorrect -a.append(\'bar\', new Blob) // correct -a.append(\'bar\', new Blob, \'x\') // correct -a.append(\'bar\', new Blob, 2) // incorrect +a.append('foo', 'bar'); // correct +a.append('foo', {}); // incorrect +a.append(2, 'bar'); // incorrect +a.append('foo', 'bar', 'baz'); // incorrect +a.append('foo', 'bar'); // incorrect +a.append('bar', new File([], 'q')) // correct +a.append('bar', new File([], 'q'), 'x') // correct +a.append('bar', new File([], 'q'), 2) // incorrect +a.append('bar', new Blob) // correct +a.append('bar', new Blob, 'x') // correct +a.append('bar', new Blob, 2) // incorrect // delete -a.delete(\'xx\'); // correct +a.delete('xx'); // correct a.delete(3); // incorrect // keys @@ -71,53 +73,53 @@ for (let [x, y]: [number, number] of a.entries()) {} // incorrect // constructor const a: FormData = new FormData(); // correct -new FormData(\"\"); // incorrect -new FormData(document.createElement(\"input\")); // incorrect -new FormData(document.createElement(\"form\")); // correct +new FormData(\\"\\"); // incorrect +new FormData(document.createElement(\\"input\\")); // incorrect +new FormData(document.createElement(\\"form\\")); // correct // has -const b: boolean = a.has(\"foo\"); // correct +const b: boolean = a.has(\\"foo\\"); // correct // get -const c: ?(string | File) = a.get(\"foo\"); // correct -const d: string = a.get(\"foo\"); // incorrect -const e: Blob = a.get(\"foo\"); // incorrect -const f: ?(string | File | Blob) = a.get(\"foo\"); // incorrect +const c: ?(string | File) = a.get(\\"foo\\"); // correct +const d: string = a.get(\\"foo\\"); // incorrect +const e: Blob = a.get(\\"foo\\"); // incorrect +const f: ?(string | File | Blob) = a.get(\\"foo\\"); // incorrect a.get(2); // incorrect // getAll -const a1: Array = a.getAll(\"foo\"); // correct -const a2: Array = a.getAll(\"foo\"); // incorrect -const a3: Array = a.getAll(\"foo\"); // incorrect +const a1: Array = a.getAll(\\"foo\\"); // correct +const a2: Array = a.getAll(\\"foo\\"); // incorrect +const a3: Array = a.getAll(\\"foo\\"); // incorrect a.getAll(23); // incorrect // set -a.set(\"foo\", \"bar\"); // correct -a.set(\"foo\", {}); // incorrect -a.set(2, \"bar\"); // incorrect -a.set(\"foo\", \"bar\", \"baz\"); // incorrect -a.set(\"bar\", new File([], \"q\")); // correct -a.set(\"bar\", new File([], \"q\"), \"x\"); // correct -a.set(\"bar\", new File([], \"q\"), 2); // incorrect -a.set(\"bar\", new Blob()); // correct -a.set(\"bar\", new Blob(), \"x\"); // correct -a.set(\"bar\", new Blob(), 2); // incorrect +a.set(\\"foo\\", \\"bar\\"); // correct +a.set(\\"foo\\", {}); // incorrect +a.set(2, \\"bar\\"); // incorrect +a.set(\\"foo\\", \\"bar\\", \\"baz\\"); // incorrect +a.set(\\"bar\\", new File([], \\"q\\")); // correct +a.set(\\"bar\\", new File([], \\"q\\"), \\"x\\"); // correct +a.set(\\"bar\\", new File([], \\"q\\"), 2); // incorrect +a.set(\\"bar\\", new Blob()); // correct +a.set(\\"bar\\", new Blob(), \\"x\\"); // correct +a.set(\\"bar\\", new Blob(), 2); // incorrect // append -a.append(\"foo\", \"bar\"); // correct -a.append(\"foo\", {}); // incorrect -a.append(2, \"bar\"); // incorrect -a.append(\"foo\", \"bar\", \"baz\"); // incorrect -a.append(\"foo\", \"bar\"); // incorrect -a.append(\"bar\", new File([], \"q\")); // correct -a.append(\"bar\", new File([], \"q\"), \"x\"); // correct -a.append(\"bar\", new File([], \"q\"), 2); // incorrect -a.append(\"bar\", new Blob()); // correct -a.append(\"bar\", new Blob(), \"x\"); // correct -a.append(\"bar\", new Blob(), 2); // incorrect +a.append(\\"foo\\", \\"bar\\"); // correct +a.append(\\"foo\\", {}); // incorrect +a.append(2, \\"bar\\"); // incorrect +a.append(\\"foo\\", \\"bar\\", \\"baz\\"); // incorrect +a.append(\\"foo\\", \\"bar\\"); // incorrect +a.append(\\"bar\\", new File([], \\"q\\")); // correct +a.append(\\"bar\\", new File([], \\"q\\"), \\"x\\"); // correct +a.append(\\"bar\\", new File([], \\"q\\"), 2); // incorrect +a.append(\\"bar\\", new Blob()); // correct +a.append(\\"bar\\", new Blob(), \\"x\\"); // correct +a.append(\\"bar\\", new Blob(), 2); // incorrect // delete -a.delete(\"xx\"); // correct +a.delete(\\"xx\\"); // correct a.delete(3); // incorrect // keys @@ -146,7 +148,7 @@ for (let [x, y]: [number, number] of a.entries()) { " `; -exports[`test MutationObserver.js 1`] = ` +exports[`MutationObserver.js 1`] = ` "/* @flow */ // constructor @@ -161,11 +163,11 @@ new MutationObserver(42); // incorrect new MutationObserver((n: number) => {}); // incorrect // observe -const div = document.createElement(\'div\'); -o.observe(div, { attributes: true, attributeFilter: [\'style\'] }); // correct +const div = document.createElement('div'); +o.observe(div, { attributes: true, attributeFilter: ['style'] }); // correct o.observe(div, { characterData: true, invalid: true }); // correct o.observe(); // incorrect -o.observe(\'invalid\'); // incorrect +o.observe('invalid'); // incorrect o.observe(div); // incorrect o.observe(div, {}); // incorrect o.observe(div, { subtree: true }); // incorrect @@ -194,11 +196,11 @@ new MutationObserver(42); // incorrect new MutationObserver((n: number) => {}); // incorrect // observe -const div = document.createElement(\"div\"); -o.observe(div, { attributes: true, attributeFilter: [\"style\"] }); // correct +const div = document.createElement(\\"div\\"); +o.observe(div, { attributes: true, attributeFilter: [\\"style\\"] }); // correct o.observe(div, { characterData: true, invalid: true }); // correct o.observe(); // incorrect -o.observe(\"invalid\"); // incorrect +o.observe(\\"invalid\\"); // incorrect o.observe(div); // incorrect o.observe(div, {}); // incorrect o.observe(div, { subtree: true }); // incorrect diff --git a/tests/flow/bounded_poly/__snapshots__/jsfmt.spec.js.snap b/tests/flow/bounded_poly/__snapshots__/jsfmt.spec.js.snap index 4ae02d37d..2698f0005 100644 --- a/tests/flow/bounded_poly/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/bounded_poly/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test scope.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`scope.js 1`] = ` "function foo(x:X, y:Y):void { } -foo(0, \"\"); +foo(0, \\"\\"); function bar(x:X, y:Y): number { return y*0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function foo(x: X, y: Y): void {} -foo(0, \"\"); +foo(0, \\"\\"); function bar(x: X, y: Y): number { return y * 0; @@ -13,7 +15,7 @@ function bar(x: X, y: Y): number { " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "function foo(x: T): T { var _ = x * 1; // OK var y: string = x; // error @@ -32,7 +34,7 @@ class C { } function example(o: T): T { o.x = 0; return o; } -var obj1: {x: number; y: string} = example({x: 0, y: \"\"}); +var obj1: {x: number; y: string} = example({x: 0, y: \\"\\"}); var obj2: {x: number} = example({x: 0}); var c: C = new C; // error, since T = string is incompatible with number @@ -61,7 +63,7 @@ function example(o: T): T { o.x = 0; return o; } -var obj1: { x: number, y: string } = example({ x: 0, y: \"\" }); +var obj1: { x: number, y: string } = example({ x: 0, y: \\"\\" }); var obj2: { x: number } = example({ x: 0 }); var c: C = new C(); // error, since T = string is incompatible with number diff --git a/tests/flow/break/__snapshots__/jsfmt.spec.js.snap b/tests/flow/break/__snapshots__/jsfmt.spec.js.snap index dba6293b4..e6819ea80 100644 --- a/tests/flow/break/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/break/__snapshots__/jsfmt.spec.js.snap @@ -1,9 +1,11 @@ -exports[`test break.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`break.js 1`] = ` "function foo(b) { var x = b ? null: false; var z; while(b) { - if (x == null) { z = \"\"; break; } + if (x == null) { z = \\"\\"; break; } var y:number = x; // error: boolean !~> number } var w:number = z; // 2 errors: ?string !~> number @@ -12,10 +14,10 @@ exports[`test break.js 1`] = ` function bar(b) { var x = b ? null: false; if (x == null) return; - switch (\"\") { + switch (\\"\\") { case 0: var y:number = x; // error: boolean !~> number - x = \"\"; + x = \\"\\"; case 1: var z:number = x; // 2 errors: (boolean | string) !~> number break; @@ -27,10 +29,10 @@ function bar(b) { function bar2(b) { var x = b ? null: false; if (x == null) return; - switch (\"\") { + switch (\\"\\") { case 0: { let y:number = x; // error: boolean !~> number - x = \"\"; + x = \\"\\"; } case 1: { let z:number = x; // 2 errors: (boolean | string) !~> number @@ -45,7 +47,7 @@ function qux(b) { var z = 0; while(b) { var y:number = z; - if (b) { z = \"\"; continue; } // error: string !~> number + if (b) { z = \\"\\"; continue; } // error: string !~> number z = 0; } var w:number = z; // error: string !~> number @@ -54,10 +56,10 @@ function qux(b) { // same basic test as foo(), but with const. probes the // logic that still uses havoc to do env resets. function test_const() { - let st: string = \'abc\'; + let st: string = 'abc'; for (let i = 1; i < 100; i++) { - const fooRes: ?string = \"HEY\"; + const fooRes: ?string = \\"HEY\\"; if (!fooRes) { break; } @@ -73,7 +75,7 @@ function foo(b) { var z; while (b) { if (x == null) { - z = \"\"; + z = \\"\\"; break; } var y: number = x; // error: boolean !~> number @@ -84,10 +86,10 @@ function foo(b) { function bar(b) { var x = b ? null : false; if (x == null) return; - switch (\"\") { + switch (\\"\\") { case 0: var y: number = x; // error: boolean !~> number - x = \"\"; + x = \\"\\"; case 1: var z: number = x; // 2 errors: (boolean | string) !~> number break; @@ -99,10 +101,10 @@ function bar(b) { function bar2(b) { var x = b ? null : false; if (x == null) return; - switch (\"\") { + switch (\\"\\") { case 0: { let y: number = x; // error: boolean !~> number - x = \"\"; + x = \\"\\"; } case 1: { let z: number = x; // 2 errors: (boolean | string) !~> number @@ -118,7 +120,7 @@ function qux(b) { while (b) { var y: number = z; if (b) { - z = \"\"; + z = \\"\\"; continue; } // error: string !~> number z = 0; @@ -129,10 +131,10 @@ function qux(b) { // same basic test as foo(), but with const. probes the // logic that still uses havoc to do env resets. function test_const() { - let st: string = \"abc\"; + let st: string = \\"abc\\"; for (let i = 1; i < 100; i++) { - const fooRes: ?string = \"HEY\"; + const fooRes: ?string = \\"HEY\\"; if (!fooRes) { break; } diff --git a/tests/flow/builtin_uses/__snapshots__/jsfmt.spec.js.snap b/tests/flow/builtin_uses/__snapshots__/jsfmt.spec.js.snap index fead4428b..8951f4bd7 100644 --- a/tests/flow/builtin_uses/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/builtin_uses/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "var o = Object.freeze({ foo: 0 }); (o.foo: string); module.exports = o; @@ -9,11 +11,11 @@ module.exports = o; " `; -exports[`test test2.js 1`] = ` -"var o = require(\'./test\'); +exports[`test2.js 1`] = ` +"var o = require('./test'); (o.foo: string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var o = require(\"./test\"); +var o = require(\\"./test\\"); (o.foo: string); " `; diff --git a/tests/flow/builtins/__snapshots__/jsfmt.spec.js.snap b/tests/flow/builtins/__snapshots__/jsfmt.spec.js.snap index 43101c729..86a1670bc 100644 --- a/tests/flow/builtins/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/builtins/__snapshots__/jsfmt.spec.js.snap @@ -1,23 +1,25 @@ -exports[`test array.js 1`] = ` -"var a = [\"...\"]; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`array.js 1`] = ` +"var a = [\\"...\\"]; var b = a.map (function (x) { return 0; }); var c: string = b[0]; // error: number !~> string var array = []; function f() { - array = array.map (function () { return \"...\"; }); + array = array.map (function () { return \\"...\\"; }); var x:number = array[0]; // error: string !~> number } -var Foo = require(\'./genericfoo\'); +var Foo = require('./genericfoo'); var foo = new Foo(); function g() { - var foo1 = foo.map (function() { return \"...\"; }); + var foo1 = foo.map (function() { return \\"...\\"; }); var x:number = foo1.get(); // error: string !~> number foo = foo1; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var a = [\"...\"]; +var a = [\\"...\\"]; var b = a.map(function(x) { return 0; }); @@ -26,16 +28,16 @@ var c: string = b[0]; // error: number !~> string var array = []; function f() { array = array.map(function() { - return \"...\"; + return \\"...\\"; }); var x: number = array[0]; // error: string !~> number } -var Foo = require(\"./genericfoo\"); +var Foo = require(\\"./genericfoo\\"); var foo = new Foo(); function g() { var foo1 = foo.map(function() { - return \"...\"; + return \\"...\\"; }); var x: number = foo1.get(); // error: string !~> number foo = foo1; @@ -43,7 +45,7 @@ function g() { " `; -exports[`test genericfoo.js 1`] = ` +exports[`genericfoo.js 1`] = ` "class Foo { x:T; self():Foo { return this; } diff --git a/tests/flow/call_properties/__snapshots__/jsfmt.spec.js.snap b/tests/flow/call_properties/__snapshots__/jsfmt.spec.js.snap index 9e4ce09bc..18494e19e 100644 --- a/tests/flow/call_properties/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/call_properties/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "// You should be able to call objects with call properties function a(f: { (): string }, g: { (x: number): string } ): string { return f() + g(123); @@ -11,7 +13,7 @@ function b(f: { (): string }): number { // ...or if the param type is wrong function c(f: { (x: number): number }): number { - return f(\"hello\"); + return f(\\"hello\\"); } // ...or if the arity is wrong @@ -42,7 +44,7 @@ function b(f: { (): string }): number { // ...or if the param type is wrong function c(f: { (x: number): number }): number { - return f(\"hello\"); + return f(\\"hello\\"); } // ...or if the arity is wrong @@ -63,66 +65,66 @@ function f(): number { " `; -exports[`test B.js 1`] = ` +exports[`B.js 1`] = ` "// You should be able to use a function as an object with a call property -var a: { (x: number): string } = function (x: number): string { return \"hi\"; }; +var a: { (x: number): string } = function (x: number): string { return \\"hi\\"; }; // ...and it should notice when the return type is wrong -var b: { (x: number): number } = function (x: number): string { return \"hi\"; }; +var b: { (x: number): number } = function (x: number): string { return \\"hi\\"; }; // ...or if the param type is wrong -var c: { (x: string): string } = function (x: number): string { return \"hi\"; }; +var c: { (x: string): string } = function (x: number): string { return \\"hi\\"; }; // ...or if the arity is wrong -var d: { (): string } = function (x: number): string { return \"hi\"; }; +var d: { (): string } = function (x: number): string { return \\"hi\\"; }; // ...but subtyping rules still apply var e: { (x: any): void } = function() { } // arity -var f: { (): mixed } = function(): string { return \"hi\" } // return type +var f: { (): mixed } = function(): string { return \\"hi\\" } // return type var g: { (x: string): void } = function(x: mixed) { } // param type // A function can be an object -var y : {} = function (x: number): string { return \"hi\"; }; -var z : Object = function (x: number): string { return \"hi\"; }; +var y : {} = function (x: number): string { return \\"hi\\"; }; +var z : Object = function (x: number): string { return \\"hi\\"; }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // You should be able to use a function as an object with a call property var a: { (x: number): string } = function(x: number): string { - return \"hi\"; + return \\"hi\\"; }; // ...and it should notice when the return type is wrong var b: { (x: number): number } = function(x: number): string { - return \"hi\"; + return \\"hi\\"; }; // ...or if the param type is wrong var c: { (x: string): string } = function(x: number): string { - return \"hi\"; + return \\"hi\\"; }; // ...or if the arity is wrong var d: { (): string } = function(x: number): string { - return \"hi\"; + return \\"hi\\"; }; // ...but subtyping rules still apply var e: { (x: any): void } = function() {}; // arity var f: { (): mixed } = function(): string { - return \"hi\"; + return \\"hi\\"; }; // return type var g: { (x: string): void } = function(x: mixed) {}; // param type // A function can be an object var y: {} = function(x: number): string { - return \"hi\"; + return \\"hi\\"; }; var z: Object = function(x: number): string { - return \"hi\"; + return \\"hi\\"; }; " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` "// You should be able to use an object as a function function a(x: { (z: number): string }): (z: number) => string { return x; @@ -143,7 +145,7 @@ function d(x: { (z: number): string }): () => string { return x; } -// ...or if it doesn\'t have a call property +// ...or if it doesn't have a call property function e(x: {}): () => string { return x; } @@ -178,7 +180,7 @@ function d(x: { (z: number): string }): () => string { return x; } -// ...or if it doesn\'t have a call property +// ...or if it doesn't have a call property function e(x: {}): () => string { return x; } @@ -195,7 +197,7 @@ function g(x: {}): Function { " `; -exports[`test D.js 1`] = ` +exports[`D.js 1`] = ` "// Multiple call properties should also be supported function a(f: { (): string; (x: number): string }): string { return f() + f(123); @@ -203,11 +205,11 @@ function a(f: { (): string; (x: number): string }): string { // It should be fine when a function satisfies them all var b: { (): string; (x: number): string } = - function (x?: number): string { return \"hi\"; }; + function (x?: number): string { return \\"hi\\"; }; -// ...but should notice when a function doesn\'t satisfy them all +// ...but should notice when a function doesn't satisfy them all var c: { (): string; (x: number): string } = - function (x: number): string { return \"hi\"; }; + function (x: number): string { return \\"hi\\"; }; // Only one call property needs to match the function function d(x: { (): string; (x: number): string }): () => string { @@ -226,12 +228,12 @@ function a(f: { (): string, (x: number): string }): string { // It should be fine when a function satisfies them all var b: { (): string, (x: number): string } = function(x?: number): string { - return \"hi\"; + return \\"hi\\"; }; -// ...but should notice when a function doesn\'t satisfy them all +// ...but should notice when a function doesn't satisfy them all var c: { (): string, (x: number): string } = function(x: number): string { - return \"hi\"; + return \\"hi\\"; }; // Only one call property needs to match the function @@ -246,8 +248,8 @@ function e(x: { (): string, (x: number): string }): () => number { " `; -exports[`test E.js 1`] = ` -"// Expecting properties that don\'t exist should be an error +exports[`E.js 1`] = ` +"// Expecting properties that don't exist should be an error var a : { someProp: number } = function () {}; // Expecting properties that do exist should be fine @@ -258,7 +260,7 @@ var f = function () {}; f.myProp = 123; var c : { myProp: number } = f; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Expecting properties that don\'t exist should be an error +// Expecting properties that don't exist should be an error var a: { someProp: number } = function() {}; // Expecting properties that do exist should be fine @@ -271,51 +273,51 @@ var c: { myProp: number } = f; " `; -exports[`test F.js 1`] = ` +exports[`F.js 1`] = ` "// You should be able to use an arrow function as an object with a call property var a: { (x: number): string } = (x) => x.toString() // ...and it should notice when the return type is wrong -var b: { (x: number): number } = (x) => \"hi\" +var b: { (x: number): number } = (x) => \\"hi\\" // ...or if the param type is wrong var c: { (x: string): string } = (x) => x.toFixed() // ...or if the arity is wrong -var d: { (): string } = (x) => \"hi\" +var d: { (): string } = (x) => \\"hi\\" // ...but subtyping rules still apply var e: { (x: any): void } = () => { } // arity -var f: { (): mixed } = () => \"hi\" // return type +var f: { (): mixed } = () => \\"hi\\" // return type var g: { (x: Date): void } = (x) => { x * 2 } // param type (date < number) // A function can be an object -var y : {} = (x) => \"hi\" -var z : Object = (x) => \"hi\" +var y : {} = (x) => \\"hi\\" +var z : Object = (x) => \\"hi\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // You should be able to use an arrow function as an object with a call property var a: { (x: number): string } = x => x.toString(); // ...and it should notice when the return type is wrong -var b: { (x: number): number } = x => \"hi\"; +var b: { (x: number): number } = x => \\"hi\\"; // ...or if the param type is wrong var c: { (x: string): string } = x => x.toFixed(); // ...or if the arity is wrong -var d: { (): string } = x => \"hi\"; +var d: { (): string } = x => \\"hi\\"; // ...but subtyping rules still apply var e: { (x: any): void } = () => {}; // arity -var f: { (): mixed } = () => \"hi\"; // return type +var f: { (): mixed } = () => \\"hi\\"; // return type var g: { (x: Date): void } = x => { x * 2; }; // param type (date < number) // A function can be an object -var y: {} = x => \"hi\"; -var z: Object = x => \"hi\"; +var y: {} = x => \\"hi\\"; +var z: Object = x => \\"hi\\"; " `; diff --git a/tests/flow/callable/__snapshots__/jsfmt.spec.js.snap b/tests/flow/callable/__snapshots__/jsfmt.spec.js.snap index 51ccc0272..2fdbc337f 100644 --- a/tests/flow/callable/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/callable/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test optional.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`optional.js 1`] = ` "type F = { (x: string): number; p?: string; @@ -23,7 +25,7 @@ function f(x) { " `; -exports[`test primitives.js 1`] = ` +exports[`primitives.js 1`] = ` "var x = Boolean(4); function foo(fn:(value:any)=>boolean) { } foo(Boolean); diff --git a/tests/flow/check-contents/__snapshots__/jsfmt.spec.js.snap b/tests/flow/check-contents/__snapshots__/jsfmt.spec.js.snap index 0ad05acd5..ce33d0702 100644 --- a/tests/flow/check-contents/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/check-contents/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test not_flow.js 1`] = ` -"1 * \'foo\'; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`not_flow.js 1`] = ` +"1 * 'foo'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1 * \"foo\"; +1 * \\"foo\\"; " `; diff --git a/tests/flow/class_munging/__snapshots__/jsfmt.spec.js.snap b/tests/flow/class_munging/__snapshots__/jsfmt.spec.js.snap index 9e3829ff0..db48dcb2c 100644 --- a/tests/flow/class_munging/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/class_munging/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test with_munging.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`with_munging.js 1`] = ` "/** * @flow */ class Foo { _method(): string { - return \'this is private\'; + return 'this is private'; } } @@ -21,7 +23,7 @@ class Bar extends Foo { class Foo { _method(): string { - return \"this is private\"; + return \\"this is private\\"; } } @@ -33,7 +35,7 @@ class Bar extends Foo { " `; -exports[`test without_munging.js 1`] = ` +exports[`without_munging.js 1`] = ` "/** * @flow * @preventMunge @@ -41,7 +43,7 @@ exports[`test without_munging.js 1`] = ` class Foo { _method(): string { - return \'this is not private\'; + return 'this is not private'; } } @@ -58,7 +60,7 @@ class Bar extends Foo { class Foo { _method(): string { - return \"this is not private\"; + return \\"this is not private\\"; } } diff --git a/tests/flow/class_statics/__snapshots__/jsfmt.spec.js.snap b/tests/flow/class_statics/__snapshots__/jsfmt.spec.js.snap index ffe0658d1..cf38583f1 100644 --- a/tests/flow/class_statics/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/class_statics/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "class A { static x: number; static y: string; @@ -12,9 +14,9 @@ class B extends A { static foo(x: string) { } // error? static main() { B.x = 0; // error - B.x = \"\"; + B.x = \\"\\"; B.foo(0); // error - B.foo(\"\"); + B.foo(\\"\\"); B.y = 0; // error B.bar(0); // error B.qux(0); // error @@ -74,9 +76,9 @@ class B extends A { static foo(x: string) {} // error? static main() { B.x = 0; // error - B.x = \"\"; + B.x = \\"\\"; B.foo(0); // error - B.foo(\"\"); + B.foo(\\"\\"); B.y = 0; // error B.bar(0); // error B.qux(0); // error diff --git a/tests/flow/class_subtyping/__snapshots__/jsfmt.spec.js.snap b/tests/flow/class_subtyping/__snapshots__/jsfmt.spec.js.snap index 8c84c5124..3d3d43382 100644 --- a/tests/flow/class_subtyping/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/class_subtyping/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "/* @flow */ class A {} class B {} @@ -13,9 +15,9 @@ module.exports = { A, B }; " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "/* @flow */ -var I = require(\"./test.js\"); +var I = require(\\"./test.js\\"); class C extends I.A {} @@ -23,7 +25,7 @@ var x: I.A = new C(); var y: I.B = new C(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var I = require(\"./test.js\"); +var I = require(\\"./test.js\\"); class C extends I.A {} @@ -32,7 +34,7 @@ var y: I.B = new C(); " `; -exports[`test test3.js 1`] = ` +exports[`test3.js 1`] = ` "class A {} class B extends A {} class C extends B {} @@ -49,7 +51,7 @@ var a: A> = c; // the third type arg is incorrect " `; -exports[`test test4.js 1`] = ` +exports[`test4.js 1`] = ` "class C { x: X; } function foo(c: C, x: X) { } diff --git a/tests/flow/class_type/__snapshots__/jsfmt.spec.js.snap b/tests/flow/class_type/__snapshots__/jsfmt.spec.js.snap index d512b80d6..89e01640d 100644 --- a/tests/flow/class_type/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/class_type/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "class A { } function foo(x: Class): A { return new x(); // OK @@ -25,7 +27,7 @@ function bar(x: Class): B { " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "// A function to typecheck values against their types. Covariance of Class<.> // makes it useless in such a function (when limited to classes and instances), // since everything can be trivially satisfied by going to \`mixed\`. diff --git a/tests/flow/classes/__snapshots__/jsfmt.spec.js.snap b/tests/flow/classes/__snapshots__/jsfmt.spec.js.snap index 8f91fe56f..3e7618264 100644 --- a/tests/flow/classes/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/classes/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "class A { foo(x:number):void { } } @@ -13,8 +15,8 @@ module.exports = A; " `; -exports[`test B.js 1`] = ` -"var A = require(\'./A\'); +exports[`B.js 1`] = ` +"var A = require('./A'); class B extends A { } @@ -23,7 +25,7 @@ let b = new B(); module.exports = B; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var A = require(\"./A\"); +var A = require(\\"./A\\"); class B extends A {} @@ -34,8 +36,8 @@ module.exports = B; " `; -exports[`test C.js 1`] = ` -"var B = require(\'./B\'); +exports[`C.js 1`] = ` +"var B = require('./B'); class C extends B { foo(x:string):void { } @@ -46,7 +48,7 @@ let c = new C(); module.exports = C; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var B = require(\"./B\"); +var B = require(\\"./B\\"); class C extends B { foo(x: string): void {} @@ -59,7 +61,7 @@ module.exports = C; " `; -exports[`test D.js 1`] = ` +exports[`D.js 1`] = ` "class D { } class E { } new E().x @@ -70,14 +72,14 @@ new E().x; " `; -exports[`test class_shapes.js 1`] = ` +exports[`class_shapes.js 1`] = ` "/* @flow */ type Foo = { a: string; // exists in TestClass - b: string; // doesn\'t exist + b: string; // doesn't exist c?: ?string; // exists in TestClass, optional - d?: number; // doesn\'t exist + d?: number; // doesn't exist } class TestClass { @@ -93,8 +95,8 @@ x.c; // ok x.d; // error, TestClass has no d var y : Foo = x; -y.b; // error, doesn\'t exist in TestClass -y.d; // ok, it\'s optional +y.b; // error, doesn't exist in TestClass +y.d; // ok, it's optional class Test2Superclass { a: number; // conflicts with cast to Foo @@ -111,9 +113,9 @@ var w : Foo = z; type Foo = { a: string, // exists in TestClass - b: string, // doesn\'t exist + b: string, // doesn't exist c?: ?string, // exists in TestClass, optional - d?: number /* doesn\'t exist*/ + d?: number /* doesn't exist*/ }; class TestClass { @@ -129,8 +131,8 @@ x.c; // ok x.d; // error, TestClass has no d var y: Foo = x; -y.b; // error, doesn\'t exist in TestClass -y.d; // ok, it\'s optional +y.b; // error, doesn't exist in TestClass +y.d; // ok, it's optional class Test2Superclass { a: number; // conflicts with cast to Foo @@ -145,7 +147,7 @@ var w: Foo = z; " `; -exports[`test expr.js 1`] = ` +exports[`expr.js 1`] = ` "var Bar = class Foo { static factory(): Foo { // OK: Foo is a type in this scope return new Foo() // OK: Foo is a runtime binding in this scope @@ -155,7 +157,7 @@ exports[`test expr.js 1`] = ` var bar1: Bar = new Bar() // OK var bar2: Bar = Bar.factory() // OK -// NB: Don\'t write expected errors using Foo to avoid error collapse hiding an +// NB: Don't write expected errors using Foo to avoid error collapse hiding an // unexpected failure in the above code. var B = class Baz { } @@ -187,7 +189,7 @@ var Bar = class Foo { var bar1: Bar = new Bar(); // OK var bar2: Bar = Bar.factory(); // OK -// NB: Don\'t write expected errors using Foo to avoid error collapse hiding an +// NB: Don't write expected errors using Foo to avoid error collapse hiding an // unexpected failure in the above code. var B = class Baz {}; @@ -211,7 +213,7 @@ var alias2: Alias = _Alias.factory(); // error: bad pun " `; -exports[`test loc.js 1`] = ` +exports[`loc.js 1`] = ` "/* @flow */ type Foo = number @@ -226,13 +228,13 @@ class Foo {} // error, shadows type Foo " `; -exports[`test statics.js 1`] = ` +exports[`statics.js 1`] = ` "/* @flow */ class C { static p: string; } -C.p = \"hi\"; +C.p = \\"hi\\"; // Class static fields are compatible with object types (C: {p:string}); // ok @@ -246,7 +248,7 @@ declare var o: {p:number}; class C { static p: string; } -C.p = \"hi\"; +C.p = \\"hi\\"; // Class static fields are compatible with object types (C: { p: string }); // ok diff --git a/tests/flow/closure/__snapshots__/jsfmt.spec.js.snap b/tests/flow/closure/__snapshots__/jsfmt.spec.js.snap index bef0b3663..76625bc09 100644 --- a/tests/flow/closure/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/closure/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test Closure.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Closure.js 1`] = ` "/*** * Test tracking of variable types across closure calls. * @flow @@ -9,7 +11,7 @@ function takes_string(_:string) { } // global write from function // -var global_x = \"hello\"; +var global_x = \\"hello\\"; function global_f() { } function global_g() { global_x = 42; } @@ -20,14 +22,14 @@ takes_string(global_x); // ok global_g(); takes_string(global_x); // error -global_x = 42; // shouldn\'t pollute linear refinement +global_x = 42; // shouldn't pollute linear refinement // local write from function // function local_func() { - var local_x = \"hello\"; + var local_x = \\"hello\\"; function local_f() { } function local_g() { local_x = 42; } @@ -38,13 +40,13 @@ function local_func() { local_g(); takes_string(local_x); // error - local_x = 42; // shouldn\'t pollute linear refinement + local_x = 42; // shouldn't pollute linear refinement } // global write from method // -var global_y = \"hello\"; +var global_y = \\"hello\\"; var global_o = { f: function() { }, @@ -57,14 +59,14 @@ takes_string(global_y); // ok global_o.g(); takes_string(global_y); // error -global_y = 42; // shouldn\'t pollute linear refinement +global_y = 42; // shouldn't pollute linear refinement // local write from method // function local_meth() { - var local_y = \"hello\"; + var local_y = \\"hello\\"; var local_o = { f: function() { }, @@ -77,7 +79,7 @@ function local_meth() { local_o.g(); takes_string(local_y); // error - local_y = 42; // shouldn\'t pollute linear refinement + local_y = 42; // shouldn't pollute linear refinement } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /*** @@ -90,7 +92,7 @@ function takes_string(_: string) {} // global write from function // -var global_x = \"hello\"; +var global_x = \\"hello\\"; function global_f() {} function global_g() { @@ -103,13 +105,13 @@ takes_string(global_x); // ok global_g(); takes_string(global_x); // error -global_x = 42; // shouldn\'t pollute linear refinement +global_x = 42; // shouldn't pollute linear refinement // local write from function // function local_func() { - var local_x = \"hello\"; + var local_x = \\"hello\\"; function local_f() {} function local_g() { @@ -122,13 +124,13 @@ function local_func() { local_g(); takes_string(local_x); // error - local_x = 42; // shouldn\'t pollute linear refinement + local_x = 42; // shouldn't pollute linear refinement } // global write from method // -var global_y = \"hello\"; +var global_y = \\"hello\\"; var global_o = { f: function() {}, @@ -143,13 +145,13 @@ takes_string(global_y); // ok global_o.g(); takes_string(global_y); // error -global_y = 42; // shouldn\'t pollute linear refinement +global_y = 42; // shouldn't pollute linear refinement // local write from method // function local_meth() { - var local_y = \"hello\"; + var local_y = \\"hello\\"; var local_o = { f: function() {}, @@ -164,12 +166,12 @@ function local_meth() { local_o.g(); takes_string(local_y); // error - local_y = 42; // shouldn\'t pollute linear refinement + local_y = 42; // shouldn't pollute linear refinement } " `; -exports[`test cond_havoc.js 1`] = ` +exports[`cond_havoc.js 1`] = ` "// @flow // from sam, https://github.com/facebook/flow/issues/780 @@ -177,7 +179,7 @@ exports[`test cond_havoc.js 1`] = ` // function example(b: bool): number { var x = 0; - function f() { x = \"\" } + function f() { x = \\"\\" } if (b) { f(); } @@ -192,7 +194,7 @@ function example(b: bool): number { function example(b: boolean): number { var x = 0; function f() { - x = \"\"; + x = \\"\\"; } if (b) { f(); @@ -202,7 +204,7 @@ function example(b: boolean): number { " `; -exports[`test const.js 1`] = ` +exports[`const.js 1`] = ` "/*** * consts retain refinements * @flow @@ -215,7 +217,7 @@ function g(x: ?number) { const const_x = x; if (const_x) { - // ok: if const_x is truthy here, it\'s truthy everywhere + // ok: if const_x is truthy here, it's truthy everywhere call_me = () => { var y:number = const_x; }; } @@ -230,20 +232,20 @@ function g(x: ?number) { function h(x: number | string | boolean) { const const_x = x; - if (typeof(const_x) == \"number\") { + if (typeof(const_x) == \\"number\\") { call_me = () => { var y:number = const_x; }; // ok - } else if (typeof(const_x) == \"string\") { + } else if (typeof(const_x) == \\"string\\") { call_me = () => { var y:string = const_x; }; // ok - } else if (typeof(const_x) == \"boolean\") { + } else if (typeof(const_x) == \\"boolean\\") { call_me = () => { var y:boolean = const_x; }; // ok } var var_x = x; - if (typeof(var_x) == \"number\") { + if (typeof(var_x) == \\"number\\") { call_me = () => { var y:number = var_x; }; // error - } else if (typeof(var_x) == \"string\") { + } else if (typeof(var_x) == \\"string\\") { call_me = () => { var y:string = var_x; }; // error - } else if (typeof(var_x) == \"boolean\") { + } else if (typeof(var_x) == \\"boolean\\") { call_me = () => { var y:boolean = var_x; }; // error } } @@ -262,7 +264,7 @@ var call_me: () => void = () => {}; function g(x: ?number) { const const_x = x; if (const_x) { - // ok: if const_x is truthy here, it\'s truthy everywhere + // ok: if const_x is truthy here, it's truthy everywhere call_me = () => { var y: number = const_x; }; @@ -280,30 +282,30 @@ function g(x: ?number) { function h(x: number | string | boolean) { const const_x = x; - if (typeof const_x == \"number\") { + if (typeof const_x == \\"number\\") { call_me = () => { var y: number = const_x; }; // ok - } else if (typeof const_x == \"string\") { + } else if (typeof const_x == \\"string\\") { call_me = () => { var y: string = const_x; }; // ok - } else if (typeof const_x == \"boolean\") { + } else if (typeof const_x == \\"boolean\\") { call_me = () => { var y: boolean = const_x; }; // ok } var var_x = x; - if (typeof var_x == \"number\") { + if (typeof var_x == \\"number\\") { call_me = () => { var y: number = var_x; }; // error - } else if (typeof var_x == \"string\") { + } else if (typeof var_x == \\"string\\") { call_me = () => { var y: string = var_x; }; // error - } else if (typeof var_x == \"boolean\") { + } else if (typeof var_x == \\"boolean\\") { call_me = () => { var y: boolean = var_x; }; // error diff --git a/tests/flow/commonjs/__snapshots__/jsfmt.spec.js.snap b/tests/flow/commonjs/__snapshots__/jsfmt.spec.js.snap index 671e7cb5d..e0abce678 100644 --- a/tests/flow/commonjs/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/commonjs/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test Abs.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Abs.js 1`] = ` " function f(x:string) { } @@ -10,13 +12,13 @@ module.exports = f; " `; -exports[`test Rel.js 1`] = ` +exports[`Rel.js 1`] = ` " -var f = require(\'./Abs\'); +var f = require('./Abs'); f(0); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var f = require(\"./Abs\"); +var f = require(\\"./Abs\\"); f(0); " diff --git a/tests/flow/computed_props/__snapshots__/jsfmt.spec.js.snap b/tests/flow/computed_props/__snapshots__/jsfmt.spec.js.snap index 324a499bb..bf1ffc18e 100644 --- a/tests/flow/computed_props/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/computed_props/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "var ColorId = { - RED: \'R\', - GREEN: \'G\', - BLUE: \'B\', + RED: 'R', + GREEN: 'G', + BLUE: 'B', }; var ColorNumber = { - RED: \'ff0000\', - GREEN: \'00ff00\', - BLUE: \'0000ff\', + RED: 'ff0000', + GREEN: '00ff00', + BLUE: '0000ff', }; var ColorIdToNumber = { @@ -17,22 +19,22 @@ var ColorIdToNumber = { [ColorId.BLUE]: ColorNumber.BLUE, }; -(ColorIdToNumber[ColorId.RED]: \'ffffff\'); // oops +(ColorIdToNumber[ColorId.RED]: 'ffffff'); // oops ColorIdToNumber.XXX; // oops module.exports = { ColorId, ColorNumber }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var ColorId = { - RED: \"R\", - GREEN: \"G\", - BLUE: \"B\" + RED: \\"R\\", + GREEN: \\"G\\", + BLUE: \\"B\\" }; var ColorNumber = { - RED: \"ff0000\", - GREEN: \"00ff00\", - BLUE: \"0000ff\" + RED: \\"ff0000\\", + GREEN: \\"00ff00\\", + BLUE: \\"0000ff\\" }; var ColorIdToNumber = { @@ -41,7 +43,7 @@ var ColorIdToNumber = { [ColorId.BLUE]: ColorNumber.BLUE }; -(ColorIdToNumber[ColorId.RED]: \"ffffff\"); // oops +(ColorIdToNumber[ColorId.RED]: \\"ffffff\\"); // oops ColorIdToNumber.XXX; // oops @@ -49,82 +51,82 @@ module.exports = { ColorId, ColorNumber }; " `; -exports[`test test2.js 1`] = ` -"var { ColorId, ColorNumber } = require(\'./test\'); +exports[`test2.js 1`] = ` +"var { ColorId, ColorNumber } = require('./test'); var ColorIdToNumber = { [ColorId.RED]: ColorNumber.RED, [ColorId.GREEN]: ColorNumber.GREEN, [ColorId.BLUE]: ColorNumber.BLUE, }; -(ColorIdToNumber[ColorId.GREEN]: \'ffffff\'); // oops +(ColorIdToNumber[ColorId.GREEN]: 'ffffff'); // oops module.exports = ColorIdToNumber; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var { ColorId, ColorNumber } = require(\"./test\"); +var { ColorId, ColorNumber } = require(\\"./test\\"); var ColorIdToNumber = { [ColorId.RED]: ColorNumber.RED, [ColorId.GREEN]: ColorNumber.GREEN, [ColorId.BLUE]: ColorNumber.BLUE }; -(ColorIdToNumber[ColorId.GREEN]: \"ffffff\"); // oops +(ColorIdToNumber[ColorId.GREEN]: \\"ffffff\\"); // oops module.exports = ColorIdToNumber; " `; -exports[`test test3.js 1`] = ` -"var { ColorId } = require(\'./test\'); -var ColorIdToNumber = require(\'./test2\'); +exports[`test3.js 1`] = ` +"var { ColorId } = require('./test'); +var ColorIdToNumber = require('./test2'); -(ColorIdToNumber[ColorId.BLUE]: \'ffffff\'); // oops +(ColorIdToNumber[ColorId.BLUE]: 'ffffff'); // oops ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var { ColorId } = require(\"./test\"); -var ColorIdToNumber = require(\"./test2\"); +var { ColorId } = require(\\"./test\\"); +var ColorIdToNumber = require(\\"./test2\\"); -(ColorIdToNumber[ColorId.BLUE]: \"ffffff\"); // oops +(ColorIdToNumber[ColorId.BLUE]: \\"ffffff\\"); // oops " `; -exports[`test test4.js 1`] = ` -"module.exports = \'hello\'; +exports[`test4.js 1`] = ` +"module.exports = 'hello'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = \"hello\"; +module.exports = \\"hello\\"; " `; -exports[`test test5.js 1`] = ` -"var hello = require(\'./test4\'); -var dummy = require(\'./test\'); +exports[`test5.js 1`] = ` +"var hello = require('./test4'); +var dummy = require('./test'); module.exports = { ...dummy, - [hello]: \'world\', + [hello]: 'world', ...dummy, }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var hello = require(\"./test4\"); -var dummy = require(\"./test\"); +var hello = require(\\"./test4\\"); +var dummy = require(\\"./test\\"); module.exports = { ...dummy, - [hello]: \"world\", + [hello]: \\"world\\", ...dummy }; " `; -exports[`test test6.js 1`] = ` -"var o = require(\'./test5\'); -(o.hello: \'nothing\'); // oops +exports[`test6.js 1`] = ` +"var o = require('./test5'); +(o.hello: 'nothing'); // oops ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var o = require(\"./test5\"); -(o.hello: \"nothing\"); // oops +var o = require(\\"./test5\\"); +(o.hello: \\"nothing\\"); // oops " `; -exports[`test test7.js 1`] = ` +exports[`test7.js 1`] = ` "var obj = {x: 0, m() { return this.x }} -var x: string = obj[\'m\'](); // error, number ~> string +var x: string = obj['m'](); // error, number ~> string var arr = [function() { return this.length }]; var y: string = arr[0](); // error: number ~> string @@ -135,7 +137,7 @@ var obj = { return this.x; } }; -var x: string = obj[\"m\"](); // error, number ~> string +var x: string = obj[\\"m\\"](); // error, number ~> string var arr = [ function() { diff --git a/tests/flow/conditional/__snapshots__/jsfmt.spec.js.snap b/tests/flow/conditional/__snapshots__/jsfmt.spec.js.snap index 90dc106af..e6e2a20ff 100644 --- a/tests/flow/conditional/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/conditional/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test conditional.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`conditional.js 1`] = ` "/* @flow */ function a(): number { diff --git a/tests/flow/config_all/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_all/__snapshots__/jsfmt.spec.js.snap index 0e646c56e..b7196c185 100644 --- a/tests/flow/config_all/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_all/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test no_at_flow.js 1`] = ` -"var x: number = \"not a number\"; // Error: string ~> number +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`no_at_flow.js 1`] = ` +"var x: number = \\"not a number\\"; // Error: string ~> number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x: number = \"not a number\"; // Error: string ~> number +var x: number = \\"not a number\\"; // Error: string ~> number " `; diff --git a/tests/flow/config_all_false/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_all_false/__snapshots__/jsfmt.spec.js.snap index 42724c33f..9dafaf24e 100644 --- a/tests/flow/config_all_false/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_all_false/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test no_at_flow.js 1`] = ` -"var x: number = \"not a number\"; // No error +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`no_at_flow.js 1`] = ` +"var x: number = \\"not a number\\"; // No error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x: number = \"not a number\"; // No error +var x: number = \\"not a number\\"; // No error " `; diff --git a/tests/flow/config_all_weak/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_all_weak/__snapshots__/jsfmt.spec.js.snap index 1fba561f0..66434aa78 100644 --- a/tests/flow/config_all_weak/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_all_weak/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test no_at_flow.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`no_at_flow.js 1`] = ` "var x; x.length; diff --git a/tests/flow/config_file_extensions/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_file_extensions/__snapshots__/jsfmt.spec.js.snap index 6024efc97..7a83d74e7 100644 --- a/tests/flow/config_file_extensions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_file_extensions/__snapshots__/jsfmt.spec.js.snap @@ -1,26 +1,28 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "/* * @flow */ function foo(x) { - var a: number = \'asdf\'; + var a: number = 'asdf'; return x * 10; } // This file should be ignored, so this should not result in an error -foo(\'Hello, world!\'); +foo('Hello, world!'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* * @flow */ function foo(x) { - var a: number = \"asdf\"; + var a: number = \\"asdf\\"; return x * 10; } // This file should be ignored, so this should not result in an error -foo(\"Hello, world!\"); +foo(\\"Hello, world!\\"); " `; diff --git a/tests/flow/config_ignore/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_ignore/__snapshots__/jsfmt.spec.js.snap index 4d84e359b..2f54b95c0 100644 --- a/tests/flow/config_ignore/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_ignore/__snapshots__/jsfmt.spec.js.snap @@ -1,12 +1,14 @@ -exports[`test foo.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` "/* @flow */ // No error, this file is ignored -var x: number = \"string\"; +var x: number = \\"string\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ // No error, this file is ignored -var x: number = \"string\"; +var x: number = \\"string\\"; " `; diff --git a/tests/flow/config_ignore/dir/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_ignore/dir/__snapshots__/jsfmt.spec.js.snap index 22683d895..b043acce5 100644 --- a/tests/flow/config_ignore/dir/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_ignore/dir/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test foo.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` "/* @flow */ -var x: number = \"string\"; // Error string ~> number +var x: number = \\"string\\"; // Error string ~> number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var x: number = \"string\"; // Error string ~> number +var x: number = \\"string\\"; // Error string ~> number " `; diff --git a/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/__snapshots__/jsfmt.spec.js.snap index de0b17057..cb4e02453 100644 --- a/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test main.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`main.js 1`] = ` "// @flow -import {test} from \'testmodule\'; +import {test} from 'testmodule'; var a: number = test; var b: string = test; // Error: number ~> string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { test } from \"testmodule\"; +import { test } from \\"testmodule\\"; var a: number = test; var b: string = test; // Error: number ~> string diff --git a/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/src/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/src/__snapshots__/jsfmt.spec.js.snap index a6c0656b2..ed693ef74 100644 --- a/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/src/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_module_name_mapper_PROJECT_ROOT-1.0/src/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test testmodule.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`testmodule.js 1`] = ` "// @flow export let test = 42; diff --git a/tests/flow/config_module_name_mapper_filetype/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_name_mapper_filetype/__snapshots__/jsfmt.spec.js.snap index b81d9d8a8..29a008328 100644 --- a/tests/flow/config_module_name_mapper_filetype/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_module_name_mapper_filetype/__snapshots__/jsfmt.spec.js.snap @@ -1,12 +1,14 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "// @flow -import {className} from \"./SomeCSSFile.css\"; -import {doesntExist} from \"./SomeCSSFile.css\"; // Error: \`doestExist\` isn\'t an export +import {className} from \\"./SomeCSSFile.css\\"; +import {doesntExist} from \\"./SomeCSSFile.css\\"; // Error: \`doestExist\` isn't an export ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { className } from \"./SomeCSSFile.css\"; -import { doesntExist } from \"./SomeCSSFile.css\"; // Error: \`doestExist\` isn\'t an export +import { className } from \\"./SomeCSSFile.css\\"; +import { doesntExist } from \\"./SomeCSSFile.css\\"; // Error: \`doestExist\` isn't an export " `; diff --git a/tests/flow/config_module_name_rewrite_haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_name_rewrite_haste/__snapshots__/jsfmt.spec.js.snap index e3c3519b3..8bb8fc4e7 100644 --- a/tests/flow/config_module_name_rewrite_haste/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_module_name_rewrite_haste/__snapshots__/jsfmt.spec.js.snap @@ -1,35 +1,37 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/* @flow */ -var m1 = require(\'1DoesntExist\'); -import {numVal as numVal1} from \'1DoesntExist\'; +var m1 = require('1DoesntExist'); +import {numVal as numVal1} from '1DoesntExist'; var a_1: number = m1.numVal; var a_2: number = numVal1; -// Error: \'Exists2\' is not a valid module name +// Error: 'Exists2' is not a valid module name // // This tests that, for haste, the first name_mapper regexp that happens to // match the given module name string is picked. -var m2 = require(\'2DoesntExist\'); // Error -import {numVal as numVal2} from \'3DoesntExist\'; // Error +var m2 = require('2DoesntExist'); // Error +import {numVal as numVal2} from '3DoesntExist'; // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var m1 = require(\"1DoesntExist\"); -import { numVal as numVal1 } from \"1DoesntExist\"; +var m1 = require(\\"1DoesntExist\\"); +import { numVal as numVal1 } from \\"1DoesntExist\\"; var a_1: number = m1.numVal; var a_2: number = numVal1; -// Error: \'Exists2\' is not a valid module name +// Error: 'Exists2' is not a valid module name // // This tests that, for haste, the first name_mapper regexp that happens to // match the given module name string is picked. -var m2 = require(\"2DoesntExist\"); // Error -import { numVal as numVal2 } from \"3DoesntExist\"; // Error +var m2 = require(\\"2DoesntExist\\"); // Error +import { numVal as numVal2 } from \\"3DoesntExist\\"; // Error " `; -exports[`test Exists.js 1`] = ` +exports[`Exists.js 1`] = ` "/** * @providesModule Exists * @flow diff --git a/tests/flow/config_module_name_rewrite_node/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_name_rewrite_node/__snapshots__/jsfmt.spec.js.snap index 44e122880..39629c769 100644 --- a/tests/flow/config_module_name_rewrite_node/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_module_name_rewrite_node/__snapshots__/jsfmt.spec.js.snap @@ -1,59 +1,61 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/* @flow */ -var m1 = require(\'./1DoesntExist\'); +var m1 = require('./1DoesntExist'); var a_1: number = m1.numVal; var a_2: string = m1.numVal; // Error: number ~> string -import {numVal} from \'./1DoesntExist\'; +import {numVal} from './1DoesntExist'; var a_3: number = numVal; var a_4: string = numVal; // Error: number ~> string // This tests that, for node, the first name mapping that both matches *and* // results in a valid module filename is picked. -var m2 = require(\'./2DoesntExist\'); +var m2 = require('./2DoesntExist'); var b_1: number = m2.numVal; var b_2: string = m2.numVal; // Error: number ~> string -import {numVal as numVal2} from \'./3DoesntExist\'; +import {numVal as numVal2} from './3DoesntExist'; var b_3: number = numVal2; var b_4: string = numVal2; // Error: number ~> string // node_modules/Exists/index.js -var m3 = require(\'4DoesntExist\'); +var m3 = require('4DoesntExist'); var c_1: number = m3.numVal; var c_2: string = m3.numVal; // Error: number ~> string -import {numVal as numVal3} from \'5DoesntExist\'; +import {numVal as numVal3} from '5DoesntExist'; var c_3: number = numVal3; var c_4: string = numVal3; // Error: number ~> string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var m1 = require(\"./1DoesntExist\"); +var m1 = require(\\"./1DoesntExist\\"); var a_1: number = m1.numVal; var a_2: string = m1.numVal; // Error: number ~> string -import { numVal } from \"./1DoesntExist\"; +import { numVal } from \\"./1DoesntExist\\"; var a_3: number = numVal; var a_4: string = numVal; // Error: number ~> string // This tests that, for node, the first name mapping that both matches *and* // results in a valid module filename is picked. -var m2 = require(\"./2DoesntExist\"); +var m2 = require(\\"./2DoesntExist\\"); var b_1: number = m2.numVal; var b_2: string = m2.numVal; // Error: number ~> string -import { numVal as numVal2 } from \"./3DoesntExist\"; +import { numVal as numVal2 } from \\"./3DoesntExist\\"; var b_3: number = numVal2; var b_4: string = numVal2; // Error: number ~> string // node_modules/Exists/index.js -var m3 = require(\"4DoesntExist\"); +var m3 = require(\\"4DoesntExist\\"); var c_1: number = m3.numVal; var c_2: string = m3.numVal; // Error: number ~> string -import { numVal as numVal3 } from \"5DoesntExist\"; +import { numVal as numVal3 } from \\"5DoesntExist\\"; var c_3: number = numVal3; var c_4: string = numVal3; // Error: number ~> string " `; -exports[`test Exists.js 1`] = ` +exports[`Exists.js 1`] = ` "/* @flow */ module.exports = { diff --git a/tests/flow/config_module_system_node_resolve_dirname/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_system_node_resolve_dirname/__snapshots__/jsfmt.spec.js.snap index a9b7c46b3..8e952737f 100644 --- a/tests/flow/config_module_system_node_resolve_dirname/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_module_system_node_resolve_dirname/__snapshots__/jsfmt.spec.js.snap @@ -1,16 +1,18 @@ -exports[`test toplevel.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`toplevel.js 1`] = ` "// @flow -import {name} from \"testproj\"; +import {name} from \\"testproj\\"; -(name: \"node_modules/testproj\"); -(name: \"custom_resolve_dir/testproj\"); // Error: Resolve from node_modules first! +(name: \\"node_modules/testproj\\"); +(name: \\"custom_resolve_dir/testproj\\"); // Error: Resolve from node_modules first! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { name } from \"testproj\"; +import { name } from \\"testproj\\"; -(name: \"node_modules/testproj\"); -(name: \"custom_resolve_dir/testproj\"); // Error: Resolve from node_modules first! +(name: \\"node_modules/testproj\\"); +(name: \\"custom_resolve_dir/testproj\\"); // Error: Resolve from node_modules first! " `; diff --git a/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/__snapshots__/jsfmt.spec.js.snap index 25a5e9202..a62797762 100644 --- a/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test index.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`index.js 1`] = ` "// @flow -export var name: \"otherdir/testproj\" = \"otherdir/testproj\"; +export var name: \\"otherdir/testproj\\" = \\"otherdir/testproj\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -export var name: \"otherdir/testproj\" = \"otherdir/testproj\"; +export var name: \\"otherdir/testproj\\" = \\"otherdir/testproj\\"; " `; diff --git a/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap index a6e631314..0b954827c 100644 --- a/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_module_system_node_resolve_dirname/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test index.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`index.js 1`] = ` "// @flow -export var name: \"otherdir/testproj2\" = \"otherdir/testproj2\"; +export var name: \\"otherdir/testproj2\\" = \\"otherdir/testproj2\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -export var name: \"otherdir/testproj2\" = \"otherdir/testproj2\"; +export var name: \\"otherdir/testproj2\\" = \\"otherdir/testproj2\\"; " `; diff --git a/tests/flow/config_module_system_node_resolve_dirname/subdir/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_system_node_resolve_dirname/subdir/__snapshots__/jsfmt.spec.js.snap index 803d24fea..10be9f9ac 100644 --- a/tests/flow/config_module_system_node_resolve_dirname/subdir/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_module_system_node_resolve_dirname/subdir/__snapshots__/jsfmt.spec.js.snap @@ -1,16 +1,18 @@ -exports[`test sublevel.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`sublevel.js 1`] = ` "// @flow -import {name} from \"testproj2\"; +import {name} from \\"testproj2\\"; -(name: \"node_modules/testproj2\"); // Error: Resolve from sibling \'custom_resolve_dir\' first! -(name: \"subdir/custom_resolve_dir/testproj2\"); +(name: \\"node_modules/testproj2\\"); // Error: Resolve from sibling 'custom_resolve_dir' first! +(name: \\"subdir/custom_resolve_dir/testproj2\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { name } from \"testproj2\"; +import { name } from \\"testproj2\\"; -(name: \"node_modules/testproj2\"); // Error: Resolve from sibling \'custom_resolve_dir\' first! -(name: \"subdir/custom_resolve_dir/testproj2\"); +(name: \\"node_modules/testproj2\\"); // Error: Resolve from sibling 'custom_resolve_dir' first! +(name: \\"subdir/custom_resolve_dir/testproj2\\"); " `; diff --git a/tests/flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap index 6d3375dbe..c63d663fd 100644 --- a/tests/flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_module_system_node_resolve_dirname/subdir/custom_resolve_dir/testproj2/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test index.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`index.js 1`] = ` "// @flow -export var name: \"subdir/custom_resolve_dir/testproj2\" = \"subdir/custom_resolve_dir/testproj2\"; +export var name: \\"subdir/custom_resolve_dir/testproj2\\" = \\"subdir/custom_resolve_dir/testproj2\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -export var name: \"subdir/custom_resolve_dir/testproj2\" = \"subdir/custom_resolve_dir/testproj2\"; +export var name: \\"subdir/custom_resolve_dir/testproj2\\" = \\"subdir/custom_resolve_dir/testproj2\\"; " `; diff --git a/tests/flow/config_munging_underscores/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_munging_underscores/__snapshots__/jsfmt.spec.js.snap index b5d1a63e4..03e8baf23 100644 --- a/tests/flow/config_munging_underscores/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_munging_underscores/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test chain.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`chain.js 1`] = ` "/* @flow */ class A { @@ -12,7 +14,7 @@ class A { return 1; } static _sMethod(): string { - return \"some string\"; + return \\"some string\\"; } } A._sProperty = 48; @@ -23,16 +25,16 @@ class B extends A { constructor() { super(); - this._property1 = \"another string\"; + this._property1 = \\"another string\\"; } _method1(): string { - return \"yet another string\"; + return \\"yet another string\\"; } static _sMethod(): number { return 23; } } -B._sProperty = \"B._sProperty string\"; +B._sProperty = \\"B._sProperty string\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -47,7 +49,7 @@ class A { return 1; } static _sMethod(): string { - return \"some string\"; + return \\"some string\\"; } } A._sProperty = 48; @@ -58,20 +60,20 @@ class B extends A { constructor() { super(); - this._property1 = \"another string\"; + this._property1 = \\"another string\\"; } _method1(): string { - return \"yet another string\"; + return \\"yet another string\\"; } static _sMethod(): number { return 23; } } -B._sProperty = \"B._sProperty string\"; +B._sProperty = \\"B._sProperty string\\"; " `; -exports[`test commonjs_export.js 1`] = ` +exports[`commonjs_export.js 1`] = ` "/* @flow */ class C { @@ -90,13 +92,13 @@ module.exports = new C(); " `; -exports[`test commonjs_import.js 1`] = ` +exports[`commonjs_import.js 1`] = ` "/* @flow */ -import {_p} from \"./commonjs_export\"; +import {_p} from \\"./commonjs_export\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -import { _p } from \"./commonjs_export\"; +import { _p } from \\"./commonjs_export\\"; " `; diff --git a/tests/flow/config_munging_underscores2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/config_munging_underscores2/__snapshots__/jsfmt.spec.js.snap index 6a1d01b0c..5d87fdbb7 100644 --- a/tests/flow/config_munging_underscores2/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/config_munging_underscores2/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test chain.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`chain.js 1`] = ` "/* @flow */ class A { @@ -12,7 +14,7 @@ class A { return 1; } static _sMethod(): string { - return \"some string\"; + return \\"some string\\"; } } A._sProperty = 48; @@ -23,16 +25,16 @@ class B extends A { constructor() { super(); - this._property1 = \"another string\"; + this._property1 = \\"another string\\"; } _method1(): string { - return \"yet another string\"; + return \\"yet another string\\"; } static _sMethod(): number { return 23; } } -B._sProperty = \"B._sProperty string\"; +B._sProperty = \\"B._sProperty string\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -47,7 +49,7 @@ class A { return 1; } static _sMethod(): string { - return \"some string\"; + return \\"some string\\"; } } A._sProperty = 48; @@ -58,15 +60,15 @@ class B extends A { constructor() { super(); - this._property1 = \"another string\"; + this._property1 = \\"another string\\"; } _method1(): string { - return \"yet another string\"; + return \\"yet another string\\"; } static _sMethod(): number { return 23; } } -B._sProperty = \"B._sProperty string\"; +B._sProperty = \\"B._sProperty string\\"; " `; diff --git a/tests/flow/const_params/__snapshots__/jsfmt.spec.js.snap b/tests/flow/const_params/__snapshots__/jsfmt.spec.js.snap index 40c0e7b2d..e3bf3240b 100644 --- a/tests/flow/const_params/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/const_params/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "/** * test handling of const params * - reassignment prohibited @@ -15,16 +17,16 @@ exports[`test test.js 1`] = ` */ function cannot_reassign(x: string) { - x = \"hey\"; // error, const param cannot be reassigned + x = \\"hey\\"; // error, const param cannot be reassigned } // Note: const params use the same machinery as explicit // const bindings, which are tested more extensively elsewhere. -// Here we\'re just making sure the machinery is hooked up. +// Here we're just making sure the machinery is hooked up. // function durable_refi(x: ?number) { if (x) { - // ok: if x is truthy here, it\'s truthy everywhere + // ok: if x is truthy here, it's truthy everywhere return () => { var y:number = x; }; } } @@ -45,16 +47,16 @@ function durable_refi(x: ?number) { */ function cannot_reassign(x: string) { - x = \"hey\"; // error, const param cannot be reassigned + x = \\"hey\\"; // error, const param cannot be reassigned } // Note: const params use the same machinery as explicit // const bindings, which are tested more extensively elsewhere. -// Here we\'re just making sure the machinery is hooked up. +// Here we're just making sure the machinery is hooked up. // function durable_refi(x: ?number) { if (x) { - // ok: if x is truthy here, it\'s truthy everywhere + // ok: if x is truthy here, it's truthy everywhere return () => { var y: number = x; }; diff --git a/tests/flow/constructor/__snapshots__/jsfmt.spec.js.snap b/tests/flow/constructor/__snapshots__/jsfmt.spec.js.snap index e0326bbe3..f5c85157c 100644 --- a/tests/flow/constructor/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/constructor/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test constructor.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`constructor.js 1`] = ` "class C { constructor() { } } diff --git a/tests/flow/constructor_annots/__snapshots__/jsfmt.spec.js.snap b/tests/flow/constructor_annots/__snapshots__/jsfmt.spec.js.snap index d1f66e222..630258514 100644 --- a/tests/flow/constructor_annots/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/constructor_annots/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test constructors.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`constructors.js 1`] = ` "// Foo is a class-like function function Foo() { this.x = 0; // constructs objects with property x @@ -6,8 +8,8 @@ function Foo() { Foo.y = 0; // has static property y Foo.prototype = { m() { return 0; } }; -// exporting Foo directly doesn\'t work -// Foo\'s instance and static props are not picked up +// exporting Foo directly doesn't work +// Foo's instance and static props are not picked up exports.Foo = Foo; // so you want to type Foo, by declaring it as a class @@ -32,8 +34,8 @@ Foo.prototype = { } }; -// exporting Foo directly doesn\'t work -// Foo\'s instance and static props are not picked up +// exporting Foo directly doesn't work +// Foo's instance and static props are not picked up exports.Foo = Foo; // so you want to type Foo, by declaring it as a class @@ -49,23 +51,23 @@ exports.Foo2 = (Foo: Class); " `; -exports[`test test.js 1`] = ` -"var Foo = require(\'./constructors\').Foo; +exports[`test.js 1`] = ` +"var Foo = require('./constructors').Foo; var x: string = new Foo().x; // error, found number instead of string var y: string = Foo.y; // error, found number instead of string var z: string = new Foo().m(); -var Foo2 = require(\'./constructors\').Foo2; +var Foo2 = require('./constructors').Foo2; var x2: string = new Foo2().x; // error, found boolean instead of string var y2: string = Foo2.y; // error, found boolean instead of string var z2: string = new Foo2().m(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var Foo = require(\"./constructors\").Foo; +var Foo = require(\\"./constructors\\").Foo; var x: string = new Foo().x; // error, found number instead of string var y: string = Foo.y; // error, found number instead of string var z: string = new Foo().m(); -var Foo2 = require(\"./constructors\").Foo2; +var Foo2 = require(\\"./constructors\\").Foo2; var x2: string = new Foo2().x; // error, found boolean instead of string var y2: string = Foo2.y; // error, found boolean instead of string var z2: string = new Foo2().m(); diff --git a/tests/flow/contents/ignore/__snapshots__/jsfmt.spec.js.snap b/tests/flow/contents/ignore/__snapshots__/jsfmt.spec.js.snap index 36342af2f..694ce4033 100644 --- a/tests/flow/contents/ignore/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/contents/ignore/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test dummy.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`dummy.js 1`] = ` "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " `; -exports[`test test.js 1`] = ` -"require(\'./dummy\'); +exports[`test.js 1`] = ` +"require('./dummy'); var xxx = 0; xxx ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require(\"./dummy\"); +require(\\"./dummy\\"); var xxx = 0; xxx; " diff --git a/tests/flow/contents/no_flow/__snapshots__/jsfmt.spec.js.snap b/tests/flow/contents/no_flow/__snapshots__/jsfmt.spec.js.snap index 36342af2f..694ce4033 100644 --- a/tests/flow/contents/no_flow/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/contents/no_flow/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test dummy.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`dummy.js 1`] = ` "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " `; -exports[`test test.js 1`] = ` -"require(\'./dummy\'); +exports[`test.js 1`] = ` +"require('./dummy'); var xxx = 0; xxx ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require(\"./dummy\"); +require(\\"./dummy\\"); var xxx = 0; xxx; " diff --git a/tests/flow/core_tests/__snapshots__/jsfmt.spec.js.snap b/tests/flow/core_tests/__snapshots__/jsfmt.spec.js.snap index cb73472ad..7d6044832 100644 --- a/tests/flow/core_tests/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/core_tests/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test boolean.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`boolean.js 1`] = ` "// @flow // Boolean (the class) tests. booleans (the literals) are not part of core.js @@ -13,7 +15,7 @@ let tests = [ new Boolean(false); new Boolean(NaN); new Boolean(undefined); - new Boolean(\"\"); + new Boolean(\\"\\"); }, // toString @@ -38,7 +40,7 @@ let tests = [ Boolean(false); Boolean(NaN); Boolean(undefined); - Boolean(\"\"); + Boolean(\\"\\"); }, ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -56,7 +58,7 @@ let tests = [ new Boolean(false); new Boolean(NaN); new Boolean(undefined); - new Boolean(\"\"); + new Boolean(\\"\\"); }, // toString @@ -81,18 +83,18 @@ let tests = [ Boolean(false); Boolean(NaN); Boolean(undefined); - Boolean(\"\"); + Boolean(\\"\\"); } ]; " `; -exports[`test map.js 1`] = ` +exports[`map.js 1`] = ` "// @flow function* generator(): Iterable<[string, number]> { while (true) { - yield [\'foo\', 123]; + yield ['foo', 123]; } } @@ -101,22 +103,22 @@ let tests = [ function() { let w = new Map(); let x = new Map(null); - let y = new Map([[\'foo\', 123]]); + let y = new Map([['foo', 123]]); let z = new Map(generator()); let a: Map = new Map(); - let b: Map = new Map([[\'foo\', 123]]); + let b: Map = new Map([['foo', 123]]); let c: Map = new Map(generator()); }, // bad constructors function() { - let x = new Map([\'foo\', 123]); // error - let y: Map = new Map([[\'foo\', 123]]); // error + let x = new Map(['foo', 123]); // error + let y: Map = new Map([['foo', 123]]); // error }, // get() function(x: Map) { - (x.get(\'foo\'): boolean); // error, string | void + (x.get('foo'): boolean); // error, string | void x.get(123); // error, wrong key type }, ]; @@ -125,7 +127,7 @@ let tests = [ function* generator(): Iterable<[string, number]> { while (true) { - yield [\"foo\", 123]; + yield [\\"foo\\", 123]; } } @@ -134,56 +136,56 @@ let tests = [ function() { let w = new Map(); let x = new Map(null); - let y = new Map([[\"foo\", 123]]); + let y = new Map([[\\"foo\\", 123]]); let z = new Map(generator()); let a: Map = new Map(); - let b: Map = new Map([[\"foo\", 123]]); + let b: Map = new Map([[\\"foo\\", 123]]); let c: Map = new Map(generator()); }, // bad constructors function() { - let x = new Map([\"foo\", 123]); // error - let y: Map = new Map([[\"foo\", 123]]); // error + let x = new Map([\\"foo\\", 123]); // error + let y: Map = new Map([[\\"foo\\", 123]]); // error }, // get() function(x: Map) { - (x.get(\"foo\"): boolean); // error, string | void + (x.get(\\"foo\\"): boolean); // error, string | void x.get(123); // error, wrong key type } ]; " `; -exports[`test regexp.js 1`] = ` +exports[`regexp.js 1`] = ` "// @flow let tests = [ // constructor function() { - new RegExp(\'foo\'); + new RegExp('foo'); new RegExp(/foo/); - new RegExp(\'foo\', \'i\'); - new RegExp(\'foo\', \'ig\'); - new RegExp(/foo/, \'i\'); // invalid in ES5, valid in ES6 - new RegExp(/foo/g, \'i\'); // invalid in ES5, valid in ES6 + new RegExp('foo', 'i'); + new RegExp('foo', 'ig'); + new RegExp(/foo/, 'i'); // invalid in ES5, valid in ES6 + new RegExp(/foo/g, 'i'); // invalid in ES5, valid in ES6 }, // called as a function (equivalent to the constructor per ES6 21.2.3) function() { - RegExp(\'foo\'); + RegExp('foo'); RegExp(/foo/); - RegExp(\'foo\', \'i\'); - RegExp(\'foo\', \'ig\'); - RegExp(/foo/, \'i\'); // invalid in ES5, valid in ES6 - RegExp(/foo/g, \'i\'); // invalid in ES5, valid in ES6 + RegExp('foo', 'i'); + RegExp('foo', 'ig'); + RegExp(/foo/, 'i'); // invalid in ES5, valid in ES6 + RegExp(/foo/g, 'i'); // invalid in ES5, valid in ES6 }, // invalid flags function() { - RegExp(\'foo\', \'z\'); // error - new RegExp(\'foo\', \'z\'); // error + RegExp('foo', 'z'); // error + new RegExp('foo', 'z'); // error } ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -192,39 +194,39 @@ let tests = [ let tests = [ // constructor function() { - new RegExp(\"foo\"); + new RegExp(\\"foo\\"); new RegExp(/foo/); - new RegExp(\"foo\", \"i\"); - new RegExp(\"foo\", \"ig\"); - new RegExp(/foo/, \"i\"); // invalid in ES5, valid in ES6 - new RegExp(/foo/g, \"i\"); // invalid in ES5, valid in ES6 + new RegExp(\\"foo\\", \\"i\\"); + new RegExp(\\"foo\\", \\"ig\\"); + new RegExp(/foo/, \\"i\\"); // invalid in ES5, valid in ES6 + new RegExp(/foo/g, \\"i\\"); // invalid in ES5, valid in ES6 }, // called as a function (equivalent to the constructor per ES6 21.2.3) function() { - RegExp(\"foo\"); + RegExp(\\"foo\\"); RegExp(/foo/); - RegExp(\"foo\", \"i\"); - RegExp(\"foo\", \"ig\"); - RegExp(/foo/, \"i\"); // invalid in ES5, valid in ES6 - RegExp(/foo/g, \"i\"); // invalid in ES5, valid in ES6 + RegExp(\\"foo\\", \\"i\\"); + RegExp(\\"foo\\", \\"ig\\"); + RegExp(/foo/, \\"i\\"); // invalid in ES5, valid in ES6 + RegExp(/foo/g, \\"i\\"); // invalid in ES5, valid in ES6 }, // invalid flags function() { - RegExp(\"foo\", \"z\"); // error - new RegExp(\"foo\", \"z\"); // error + RegExp(\\"foo\\", \\"z\\"); // error + new RegExp(\\"foo\\", \\"z\\"); // error } ]; " `; -exports[`test weakset.js 1`] = ` +exports[`weakset.js 1`] = ` "// @flow let ws = new WeakSet(); let obj: Object = {}; -let dict: {foo: string} = {foo: \'bar\'}; +let dict: {foo: string} = {foo: 'bar'}; ws.add(window); ws.add(obj); @@ -242,7 +244,7 @@ let ws3 = new WeakSet([1, 2, 3]); // error, must be objects function* generator(): Iterable<{foo: string}> { while (true) { - yield {foo: \'bar\'}; + yield {foo: 'bar'}; } } @@ -261,7 +263,7 @@ let ws5 = new WeakSet(numbers()); // error, must be objects let ws = new WeakSet(); let obj: Object = {}; -let dict: { foo: string } = { foo: \"bar\" }; +let dict: { foo: string } = { foo: \\"bar\\" }; ws.add(window); ws.add(obj); @@ -279,7 +281,7 @@ let ws3 = new WeakSet([1, 2, 3]); // error, must be objects function* generator(): Iterable<{ foo: string }> { while (true) { - yield { foo: \"bar\" }; + yield { foo: \\"bar\\" }; } } diff --git a/tests/flow/covariance/__snapshots__/jsfmt.spec.js.snap b/tests/flow/covariance/__snapshots__/jsfmt.spec.js.snap index 0f489a995..8659c0a9b 100644 --- a/tests/flow/covariance/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/covariance/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "type CovArrayVerbose = Array; var b: CovArrayVerbose = []; var y: CovArrayVerbose = b; -y[0] = \"\"; // error +y[0] = \\"\\"; // error class NVerbose { x: CovArrayVerbose; @@ -22,12 +24,12 @@ var z: CovArray = c; // error var d: CovArray = []; var w: CovArray = d; -w[0] = \"\"; // error +w[0] = \\"\\"; // error type P = CovArray; var p: P = []; (p[0]: number); // not an error! -p[0] = \"\"; // error +p[0] = \\"\\"; // error class M { x: CovArray; @@ -52,7 +54,7 @@ n.x = [0]; type CovArrayVerbose = Array; var b: CovArrayVerbose = []; var y: CovArrayVerbose = b; -y[0] = \"\"; // error +y[0] = \\"\\"; // error class NVerbose { x: CovArrayVerbose; @@ -74,12 +76,12 @@ var z: CovArray = c; // error var d: CovArray = []; var w: CovArray = d; -w[0] = \"\"; // error +w[0] = \\"\\"; // error type P = CovArray; var p: P = []; (p[0]: number); // not an error! -p[0] = \"\"; // error +p[0] = \\"\\"; // error class M { x: CovArray; diff --git a/tests/flow/coverage/__snapshots__/jsfmt.spec.js.snap b/tests/flow/coverage/__snapshots__/jsfmt.spec.js.snap index af5ab7562..be3499c53 100644 --- a/tests/flow/coverage/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/coverage/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,7 @@ -exports[`test crash.js 1`] = ` -"// This file triggers a violation of the \"disjoint-or-nested ranges invariant\" +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`crash.js 1`] = ` +"// This file triggers a violation of the \\"disjoint-or-nested ranges invariant\\" // that we implicitly assume in type-at-pos and coverage implementations. In // particular, when unchecked it causes a crash with coverage --color. @@ -15,7 +17,7 @@ declare module foo { } // TODO -// This file triggers a violation of the \"disjoint-or-nested ranges invariant\" +// This file triggers a violation of the \\"disjoint-or-nested ranges invariant\\" // that we implicitly assume in type-at-pos and coverage implementations. In // particular, when unchecked it causes a crash with coverage --color. @@ -24,7 +26,7 @@ declare module bar { " `; -exports[`test declare_module.js 1`] = ` +exports[`declare_module.js 1`] = ` "// check coverage of declare module declare module foo { @@ -37,7 +39,7 @@ declare module foo { " `; -exports[`test no_pragma.js 1`] = ` +exports[`no_pragma.js 1`] = ` "let x = 0; (x: string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -46,8 +48,8 @@ let x = 0; " `; -exports[`test non-termination.js 1`] = ` -"// This file triggers a violation of the \"disjoint-or-nested ranges invariant\" +exports[`non-termination.js 1`] = ` +"// This file triggers a violation of the \\"disjoint-or-nested ranges invariant\\" // that we implicitly assume in type-at-pos and coverage implementations. In // particular, when unchecked it causes non-termination with coverage --color. @@ -64,7 +66,7 @@ declare class qux { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare module foo { } -// This file triggers a violation of the \"disjoint-or-nested ranges invariant\" +// This file triggers a violation of the \\"disjoint-or-nested ranges invariant\\" // that we implicitly assume in type-at-pos and coverage implementations. In // particular, when unchecked it causes non-termination with coverage --color. diff --git a/tests/flow/cycle/__snapshots__/jsfmt.spec.js.snap b/tests/flow/cycle/__snapshots__/jsfmt.spec.js.snap index e1a649c11..c607473c5 100644 --- a/tests/flow/cycle/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/cycle/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test A.js 1`] = ` -"var B = require(\'./B\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` +"var B = require('./B'); class A extends B { } module.exports = A; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var B = require(\"./B\"); +var B = require(\\"./B\\"); class A extends B {} @@ -13,14 +15,14 @@ module.exports = A; " `; -exports[`test B.js 1`] = ` -"var A = require(\'./A\'); +exports[`B.js 1`] = ` +"var A = require('./A'); //class B extends A { } module.exports = B; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var A = require(\"./A\"); +var A = require(\\"./A\\"); //class B extends A { } diff --git a/tests/flow/date/__snapshots__/jsfmt.spec.js.snap b/tests/flow/date/__snapshots__/jsfmt.spec.js.snap index 046782dbb..ab080405f 100644 --- a/tests/flow/date/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/date/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test date.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`date.js 1`] = ` "var d = new Date(0); var x:string = d.getTime(); @@ -7,7 +9,7 @@ var y:number = d; // valid constructors new Date(); new Date(1234567890); -new Date(\'2015/06/18\'); +new Date('2015/06/18'); new Date(2015, 6); new Date(2015, 6, 18); new Date(2015, 6, 18, 11); @@ -17,16 +19,16 @@ new Date(2015, 6, 18, 11, 55, 42, 999); // invalid constructors new Date({}); -new Date(2015, \'6\'); -new Date(2015, 6, \'18\'); -new Date(2015, 6, 18, \'11\'); -new Date(2015, 6, 18, 11, \'55\'); -new Date(2015, 6, 18, 11, 55, \'42\'); -new Date(2015, 6, 18, 11, 55, 42, \'999\'); +new Date(2015, '6'); +new Date(2015, 6, '18'); +new Date(2015, 6, 18, '11'); +new Date(2015, 6, 18, 11, '55'); +new Date(2015, 6, 18, 11, 55, '42'); +new Date(2015, 6, 18, 11, 55, 42, '999'); // invalid constructors that we incorrectly consider valid -new Date(\'2015\', 6); -new Date(2015, 6, 18, 11, 55, 42, 999, \'hahaha\'); +new Date('2015', 6); +new Date(2015, 6, 18, 11, 55, 42, 999, 'hahaha'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var d = new Date(0); var x: string = d.getTime(); @@ -36,7 +38,7 @@ var y: number = d; // valid constructors new Date(); new Date(1234567890); -new Date(\"2015/06/18\"); +new Date(\\"2015/06/18\\"); new Date(2015, 6); new Date(2015, 6, 18); new Date(2015, 6, 18, 11); @@ -46,15 +48,15 @@ new Date(2015, 6, 18, 11, 55, 42, 999); // invalid constructors new Date({}); -new Date(2015, \"6\"); -new Date(2015, 6, \"18\"); -new Date(2015, 6, 18, \"11\"); -new Date(2015, 6, 18, 11, \"55\"); -new Date(2015, 6, 18, 11, 55, \"42\"); -new Date(2015, 6, 18, 11, 55, 42, \"999\"); +new Date(2015, \\"6\\"); +new Date(2015, 6, \\"18\\"); +new Date(2015, 6, 18, \\"11\\"); +new Date(2015, 6, 18, 11, \\"55\\"); +new Date(2015, 6, 18, 11, 55, \\"42\\"); +new Date(2015, 6, 18, 11, 55, 42, \\"999\\"); // invalid constructors that we incorrectly consider valid -new Date(\"2015\", 6); -new Date(2015, 6, 18, 11, 55, 42, 999, \"hahaha\"); +new Date(\\"2015\\", 6); +new Date(2015, 6, 18, 11, 55, 42, 999, \\"hahaha\\"); " `; diff --git a/tests/flow/declaration_files_haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_haste/__snapshots__/jsfmt.spec.js.snap index 113cd6882..ac70ad001 100644 --- a/tests/flow/declaration_files_haste/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_haste/__snapshots__/jsfmt.spec.js.snap @@ -1,82 +1,84 @@ -exports[`test ExplicitProvidesModuleDifferentName.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ExplicitProvidesModuleDifferentName.js 1`] = ` "/* * @providesModule ExplicitProvidesModuleDifferentName * @flow */ -module.exports.fun = (): string => \"hello there\"; +module.exports.fun = (): string => \\"hello there\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* * @providesModule ExplicitProvidesModuleDifferentName * @flow */ -module.exports.fun = (): string => \"hello there\"; +module.exports.fun = (): string => \\"hello there\\"; " `; -exports[`test ExplicitProvidesModuleSameName.js 1`] = ` +exports[`ExplicitProvidesModuleSameName.js 1`] = ` "/* * @providesModule ExplicitProvidesModuleSameName * @flow */ -module.exports.fun = (): string => \"hello there\"; +module.exports.fun = (): string => \\"hello there\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* * @providesModule ExplicitProvidesModuleSameName * @flow */ -module.exports.fun = (): string => \"hello there\"; +module.exports.fun = (): string => \\"hello there\\"; " `; -exports[`test ImplicitProvidesModule.js 1`] = ` +exports[`ImplicitProvidesModule.js 1`] = ` "/* * @providesModule ImplicitProvidesModule * @flow */ -module.exports.fun = (): string => \"hello there\"; +module.exports.fun = (): string => \\"hello there\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* * @providesModule ImplicitProvidesModule * @flow */ -module.exports.fun = (): string => \"hello there\"; +module.exports.fun = (): string => \\"hello there\\"; " `; -exports[`test md5.js 1`] = ` +exports[`md5.js 1`] = ` "/* @providesModule md5 */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule md5 */ " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "/* @flow */ -var Implicit = require(\'ImplicitProvidesModule\'); +var Implicit = require('ImplicitProvidesModule'); (Implicit.fun(): string); -var ExplicitSameName = require(\'ExplicitProvidesModuleSameName\'); +var ExplicitSameName = require('ExplicitProvidesModuleSameName'); (ExplicitSameName.fun(): string); -var ExplicitDifferentName = require(\'ExplicitProvidesModuleDifferentName\'); +var ExplicitDifferentName = require('ExplicitProvidesModuleDifferentName'); (ExplicitDifferentName.fun(): string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var Implicit = require(\"ImplicitProvidesModule\"); +var Implicit = require(\\"ImplicitProvidesModule\\"); (Implicit.fun(): string); -var ExplicitSameName = require(\"ExplicitProvidesModuleSameName\"); +var ExplicitSameName = require(\\"ExplicitProvidesModuleSameName\\"); (ExplicitSameName.fun(): string); -var ExplicitDifferentName = require(\"ExplicitProvidesModuleDifferentName\"); +var ExplicitDifferentName = require(\\"ExplicitProvidesModuleDifferentName\\"); (ExplicitDifferentName.fun(): string); " `; diff --git a/tests/flow/declaration_files_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap index 15ba96443..8067ca3b3 100644 --- a/tests/flow/declaration_files_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test min.js 1`] = ` -"module.exports.fun = (): string => \"hello there\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`min.js 1`] = ` +"module.exports.fun = (): string => \\"hello there\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports.fun = (): string => \"hello there\"; +module.exports.fun = (): string => \\"hello there\\"; " `; diff --git a/tests/flow/declaration_files_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap index e10da30ef..e98d04b0a 100644 --- a/tests/flow/declaration_files_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap @@ -1,13 +1,15 @@ -exports[`test nested_test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`nested_test.js 1`] = ` "/* @flow */ -var docblock = require(\'qux/docblock\'); -var min = require(\'d3/min.js\'); -var corge = require(\'qux/corge\'); +var docblock = require('qux/docblock'); +var min = require('d3/min.js'); +var corge = require('qux/corge'); -// make sure we don\'t pick up non-header @providesModule +// make sure we don't pick up non-header @providesModule // annotations - see node_modules/qux/docblock.js -var unreachable = require(\'annotation\'); +var unreachable = require('annotation'); (docblock.fun(): string); (min.fun(): string); @@ -15,13 +17,13 @@ var unreachable = require(\'annotation\'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var docblock = require(\"qux/docblock\"); -var min = require(\"d3/min.js\"); -var corge = require(\"qux/corge\"); +var docblock = require(\\"qux/docblock\\"); +var min = require(\\"d3/min.js\\"); +var corge = require(\\"qux/corge\\"); -// make sure we don\'t pick up non-header @providesModule +// make sure we don't pick up non-header @providesModule // annotations - see node_modules/qux/docblock.js -var unreachable = require(\"annotation\"); +var unreachable = require(\\"annotation\\"); (docblock.fun(): string); (min.fun(): string); diff --git a/tests/flow/declaration_files_haste/ws/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_haste/ws/__snapshots__/jsfmt.spec.js.snap index b53884808..3959b3ee8 100644 --- a/tests/flow/declaration_files_haste/ws/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_haste/ws/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test index.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`index.js 1`] = ` "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " `; diff --git a/tests/flow/declaration_files_haste/ws/test/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_haste/ws/test/__snapshots__/jsfmt.spec.js.snap index 188da2625..551421890 100644 --- a/tests/flow/declaration_files_haste/ws/test/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_haste/ws/test/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test client.js 1`] = ` -"var ws = require(\'../\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`client.js 1`] = ` +"var ws = require('../'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var ws = require(\"../\"); +var ws = require(\\"../\\"); " `; diff --git a/tests/flow/declaration_files_incremental_haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_haste/__snapshots__/jsfmt.spec.js.snap index 5895f278d..9694ecb5d 100644 --- a/tests/flow/declaration_files_incremental_haste/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_incremental_haste/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/* @providesModule A */ class Implementation {} export function foo(): Implementation { return new Implementation; } @@ -11,7 +13,7 @@ export function foo(): Implementation { " `; -exports[`test ExplicitProvidesModuleDifferentName.js 1`] = ` +exports[`ExplicitProvidesModuleDifferentName.js 1`] = ` "/* * @providesModule ExplicitProvidesModuleDifferentName * @flow @@ -30,7 +32,7 @@ module.exports.fun = (): Implementation => new Implementation(); " `; -exports[`test ExplicitProvidesModuleSameName.js 1`] = ` +exports[`ExplicitProvidesModuleSameName.js 1`] = ` "/* * @providesModule ExplicitProvidesModuleSameName * @flow @@ -49,7 +51,7 @@ module.exports.fun = (): Implementation => new Implementation(); " `; -exports[`test ImplicitProvidesModule.js 1`] = ` +exports[`ImplicitProvidesModule.js 1`] = ` "/* * @providesModule ImplicitProvidesModule * @flow @@ -68,34 +70,34 @@ module.exports.fun = (): Implementation => new Implementation(); " `; -exports[`test md5.js 1`] = ` +exports[`md5.js 1`] = ` "/* @providesModule md5 */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule md5 */ " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "/* @flow */ -var Implicit = require(\'ImplicitProvidesModule\'); +var Implicit = require('ImplicitProvidesModule'); (Implicit.fun(): boolean); // Error: Either Implementation ~> boolean or Declaration ~> boolean -var ExplicitSameName = require(\'ExplicitProvidesModuleSameName\'); +var ExplicitSameName = require('ExplicitProvidesModuleSameName'); (ExplicitSameName.fun(): boolean); // Error: Either Implementation ~> boolean or Declaration ~> boolean -var ExplicitDifferentName = require(\'ExplicitProvidesModuleDifferentName\'); +var ExplicitDifferentName = require('ExplicitProvidesModuleDifferentName'); (ExplicitDifferentName.fun(): boolean); // Error: Either Implementation ~> boolean or Declaration ~> boolean ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var Implicit = require(\"ImplicitProvidesModule\"); +var Implicit = require(\\"ImplicitProvidesModule\\"); (Implicit.fun(): boolean); // Error: Either Implementation ~> boolean or Declaration ~> boolean -var ExplicitSameName = require(\"ExplicitProvidesModuleSameName\"); +var ExplicitSameName = require(\\"ExplicitProvidesModuleSameName\\"); (ExplicitSameName.fun(): boolean); // Error: Either Implementation ~> boolean or Declaration ~> boolean -var ExplicitDifferentName = require(\"ExplicitProvidesModuleDifferentName\"); +var ExplicitDifferentName = require(\\"ExplicitProvidesModuleDifferentName\\"); (ExplicitDifferentName.fun(): boolean); // Error: Either Implementation ~> boolean or Declaration ~> boolean " `; diff --git a/tests/flow/declaration_files_incremental_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap index 02bbf30ae..b0cc8249c 100644 --- a/tests/flow/declaration_files_incremental_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_incremental_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test min.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`min.js 1`] = ` "class Implementation {} module.exports.fun = (): Implementation => new Implementation; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/flow/declaration_files_incremental_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap index 540981702..f0d02f704 100644 --- a/tests/flow/declaration_files_incremental_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_incremental_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap @@ -1,9 +1,11 @@ -exports[`test nested_test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`nested_test.js 1`] = ` "/* @flow */ -var docblock = require(\'qux/docblock\'); -var min = require(\'d3/min.js\'); -var corge = require(\'qux/corge\'); +var docblock = require('qux/docblock'); +var min = require('d3/min.js'); +var corge = require('qux/corge'); (docblock.fun(): boolean); // Error: Either Implementation ~> boolean or Declaration ~> boolean (min.fun(): boolean); // Error: Either Implementation ~> boolean or Declaration ~> boolean @@ -11,9 +13,9 @@ var corge = require(\'qux/corge\'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var docblock = require(\"qux/docblock\"); -var min = require(\"d3/min.js\"); -var corge = require(\"qux/corge\"); +var docblock = require(\\"qux/docblock\\"); +var min = require(\\"d3/min.js\\"); +var corge = require(\\"qux/corge\\"); (docblock.fun(): boolean); // Error: Either Implementation ~> boolean or Declaration ~> boolean (min.fun(): boolean); // Error: Either Implementation ~> boolean or Declaration ~> boolean diff --git a/tests/flow/declaration_files_incremental_haste/ws/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_haste/ws/__snapshots__/jsfmt.spec.js.snap index b53884808..3959b3ee8 100644 --- a/tests/flow/declaration_files_incremental_haste/ws/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_incremental_haste/ws/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test index.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`index.js 1`] = ` "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " `; diff --git a/tests/flow/declaration_files_incremental_haste/ws/test/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_haste/ws/test/__snapshots__/jsfmt.spec.js.snap index 188da2625..551421890 100644 --- a/tests/flow/declaration_files_incremental_haste/ws/test/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_incremental_haste/ws/test/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test client.js 1`] = ` -"var ws = require(\'../\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`client.js 1`] = ` +"var ws = require('../'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var ws = require(\"../\"); +var ws = require(\\"../\\"); " `; diff --git a/tests/flow/declaration_files_incremental_node/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_incremental_node/__snapshots__/jsfmt.spec.js.snap index 43d38fc14..6d7ced592 100644 --- a/tests/flow/declaration_files_incremental_node/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_incremental_node/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "class Implementation {} export function foo(): Implementation { return new Implementation; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -9,99 +11,99 @@ export function foo(): Implementation { " `; -exports[`test test_absolute.js 1`] = ` +exports[`test_absolute.js 1`] = ` "/* @flow */ // This will require ./node_modules/B.js.flow -var B1 = require(\'B\'); +var B1 = require('B'); (B1.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean // This will require ./node_modules/B.js.flow -var B2 = require(\'B.js\'); +var B2 = require('B.js'); (B2.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var C = require(\'package_with_full_main\'); +var C = require('package_with_full_main'); (C.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var D = require(\'package_with_partial_main\'); +var D = require('package_with_partial_main'); (D.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var E = require(\'package_with_no_package_json\'); +var E = require('package_with_no_package_json'); (E.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var F = require(\'package_with_dir_main\'); +var F = require('package_with_dir_main'); (F.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean // This will require ./node_modules/B.js.flow -var B1 = require(\'B\'); +var B1 = require('B'); (B1.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean // This will require ./node_modules/B.js.flow -var B2 = require(\'B.js\'); +var B2 = require('B.js'); (B2.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var C = require(\'package_with_full_main\'); +var C = require('package_with_full_main'); (C.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var D = require(\'package_with_partial_main\'); +var D = require('package_with_partial_main'); (D.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var E = require(\'package_with_no_package_json\'); +var E = require('package_with_no_package_json'); (E.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var F = require(\'package_with_dir_main\'); +var F = require('package_with_dir_main'); (F.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ // This will require ./node_modules/B.js.flow -var B1 = require(\"B\"); +var B1 = require(\\"B\\"); (B1.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean // This will require ./node_modules/B.js.flow -var B2 = require(\"B.js\"); +var B2 = require(\\"B.js\\"); (B2.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var C = require(\"package_with_full_main\"); +var C = require(\\"package_with_full_main\\"); (C.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var D = require(\"package_with_partial_main\"); +var D = require(\\"package_with_partial_main\\"); (D.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var E = require(\"package_with_no_package_json\"); +var E = require(\\"package_with_no_package_json\\"); (E.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var F = require(\"package_with_dir_main\"); +var F = require(\\"package_with_dir_main\\"); (F.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean // This will require ./node_modules/B.js.flow -var B1 = require(\"B\"); +var B1 = require(\\"B\\"); (B1.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean // This will require ./node_modules/B.js.flow -var B2 = require(\"B.js\"); +var B2 = require(\\"B.js\\"); (B2.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var C = require(\"package_with_full_main\"); +var C = require(\\"package_with_full_main\\"); (C.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var D = require(\"package_with_partial_main\"); +var D = require(\\"package_with_partial_main\\"); (D.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var E = require(\"package_with_no_package_json\"); +var E = require(\\"package_with_no_package_json\\"); (E.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean -var F = require(\"package_with_dir_main\"); +var F = require(\\"package_with_dir_main\\"); (F.fun(): boolean); // Error either Implementation ~> boolean or Declaration ~> boolean " `; -exports[`test test_relative.js 1`] = ` -"import { foo } from \'./A\'; +exports[`test_relative.js 1`] = ` +"import { foo } from './A'; (foo(): boolean); // Error: either Implementation ~> boolean or Definition ~> boolean ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import { foo } from \"./A\"; +import { foo } from \\"./A\\"; (foo(): boolean); // Error: either Implementation ~> boolean or Definition ~> boolean " diff --git a/tests/flow/declaration_files_node/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declaration_files_node/__snapshots__/jsfmt.spec.js.snap index be4f706ab..091649c06 100644 --- a/tests/flow/declaration_files_node/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declaration_files_node/__snapshots__/jsfmt.spec.js.snap @@ -1,15 +1,17 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/* @flow */ -module.exports.fun = (): string => \'hello there!\'; +module.exports.fun = (): string => 'hello there!'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -module.exports.fun = (): string => \"hello there!\"; +module.exports.fun = (): string => \\"hello there!\\"; " `; -exports[`test CJS.js 1`] = ` +exports[`CJS.js 1`] = ` "// @flow module.exports = 42; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -18,79 +20,79 @@ module.exports = 42; " `; -exports[`test test_absolute.js 1`] = ` +exports[`test_absolute.js 1`] = ` "/* @flow */ // This will require ./node_modules/B.js.flow -var B1 = require(\'B\'); +var B1 = require('B'); (B1.fun(): string); // Error number ~> string // This will require ./node_modules/B.js.flow -var B2 = require(\'B.js\'); +var B2 = require('B.js'); (B2.fun(): string); // Error number ~> string -var C = require(\'package_with_full_main\'); +var C = require('package_with_full_main'); (C.fun(): string); // Error number ~> string -var D = require(\'package_with_partial_main\'); +var D = require('package_with_partial_main'); (D.fun(): string); // Error number ~> string -var E = require(\'package_with_no_package_json\'); +var E = require('package_with_no_package_json'); (E.fun(): string); // Error number ~> string -var F = require(\'package_with_dir_main\'); +var F = require('package_with_dir_main'); (F.fun(): string); // Error number ~> string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ // This will require ./node_modules/B.js.flow -var B1 = require(\"B\"); +var B1 = require(\\"B\\"); (B1.fun(): string); // Error number ~> string // This will require ./node_modules/B.js.flow -var B2 = require(\"B.js\"); +var B2 = require(\\"B.js\\"); (B2.fun(): string); // Error number ~> string -var C = require(\"package_with_full_main\"); +var C = require(\\"package_with_full_main\\"); (C.fun(): string); // Error number ~> string -var D = require(\"package_with_partial_main\"); +var D = require(\\"package_with_partial_main\\"); (D.fun(): string); // Error number ~> string -var E = require(\"package_with_no_package_json\"); +var E = require(\\"package_with_no_package_json\\"); (E.fun(): string); // Error number ~> string -var F = require(\"package_with_dir_main\"); +var F = require(\\"package_with_dir_main\\"); (F.fun(): string); // Error number ~> string " `; -exports[`test test_relative.js 1`] = ` +exports[`test_relative.js 1`] = ` "/* @flow */ // This will require ./A.js.flow -var A1 = require(\'./A\'); +var A1 = require('./A'); (A1.fun(): string); // Error number ~> string // This will require ./A.js.flow -var A2 = require(\'./A.js\'); +var A2 = require('./A.js'); (A2.fun(): string); // Error number ~> string -var CJS = require(\'./CJS.js\'); +var CJS = require('./CJS.js'); (CJS: string); (CJS: number); // Error: string ~> number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ // This will require ./A.js.flow -var A1 = require(\"./A\"); +var A1 = require(\\"./A\\"); (A1.fun(): string); // Error number ~> string // This will require ./A.js.flow -var A2 = require(\"./A.js\"); +var A2 = require(\\"./A.js\\"); (A2.fun(): string); // Error number ~> string -var CJS = require(\"./CJS.js\"); +var CJS = require(\\"./CJS.js\\"); (CJS: string); (CJS: number); // Error: string ~> number " diff --git a/tests/flow/declare_class/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_class/__snapshots__/jsfmt.spec.js.snap index 1153db682..0093346a6 100644 --- a/tests/flow/declare_class/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declare_class/__snapshots__/jsfmt.spec.js.snap @@ -1,24 +1,26 @@ -exports[`test declare_class.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`declare_class.js 1`] = ` "declare class C { static x: number; static foo(x: number): void; } -C.x = \"\"; -C.foo(\"\"); +C.x = \\"\\"; +C.foo(\\"\\"); (C.name: string); -(C.name: number); // error, it\'s a string +(C.name: number); // error, it's a string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare class C { static x: number, static foo(x: number): void } -C.x = \"\"; -C.foo(\"\"); +C.x = \\"\\"; +C.foo(\\"\\"); (C.name: string); -(C.name: number); // error, it\'s a string +(C.name: number); // error, it's a string " `; diff --git a/tests/flow/declare_class/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_class/lib/__snapshots__/jsfmt.spec.js.snap index 288b46ca5..c6d76d684 100644 --- a/tests/flow/declare_class/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declare_class/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "declare class _C { foo(): number; } diff --git a/tests/flow/declare_export/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_export/__snapshots__/jsfmt.spec.js.snap index ecbe3ebe6..148fc4b76 100644 --- a/tests/flow/declare_export/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declare_export/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test B.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`B.js 1`] = ` "/* @flow */ exports.numberValue = 42; @@ -9,14 +11,14 @@ exports.numberValue = 42; " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` "/* @flow */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ " `; -exports[`test CommonJS_Clobbering_Class.js 1`] = ` +exports[`CommonJS_Clobbering_Class.js 1`] = ` "/** * @providesModule CommonJS_Clobbering_Class * @flow @@ -73,7 +75,7 @@ module.exports = Test; " `; -exports[`test CommonJS_Clobbering_Lit.js 1`] = ` +exports[`CommonJS_Clobbering_Lit.js 1`] = ` "/** * @providesModule CommonJS_Clobbering_Lit * @flow @@ -102,7 +104,7 @@ module.exports = { " `; -exports[`test CommonJS_Named.js 1`] = ` +exports[`CommonJS_Named.js 1`] = ` "/** * @providesModule CommonJS_Named * @flow @@ -127,7 +129,7 @@ exports.numberValue5 = 5; " `; -exports[`test ES6_Default_AnonFunction1.js 1`] = ` +exports[`ES6_Default_AnonFunction1.js 1`] = ` "/** * @providesModule ES6_Default_AnonFunction1 * @flow @@ -144,7 +146,7 @@ declare export default () => number " `; -exports[`test ES6_Default_AnonFunction2.js 1`] = ` +exports[`ES6_Default_AnonFunction2.js 1`] = ` "/** * @providesModule ES6_Default_AnonFunction2 * @flow @@ -161,7 +163,7 @@ declare export default () => number " `; -exports[`test ES6_Default_NamedClass1.js 1`] = ` +exports[`ES6_Default_NamedClass1.js 1`] = ` "/** * @providesModule ES6_Default_NamedClass1 * @flow @@ -190,7 +192,7 @@ declare export function getAFoo(): FooImpl; " `; -exports[`test ES6_Default_NamedClass2.js 1`] = ` +exports[`ES6_Default_NamedClass2.js 1`] = ` "/** * @providesModule ES6_Default_NamedClass2 * @flow @@ -207,7 +209,7 @@ declare export default class Foo { givesANum(): number } " `; -exports[`test ES6_Default_NamedFunction1.js 1`] = ` +exports[`ES6_Default_NamedFunction1.js 1`] = ` "/** * @providesModule ES6_Default_NamedFunction1 * @flow @@ -224,7 +226,7 @@ declare export default function foo(): number; " `; -exports[`test ES6_Default_NamedFunction2.js 1`] = ` +exports[`ES6_Default_NamedFunction2.js 1`] = ` "/** * @providesModule ES6_Default_NamedFunction2 * @flow @@ -241,7 +243,7 @@ declare export default function foo(): number; " `; -exports[`test ES6_DefaultAndNamed.js 1`] = ` +exports[`ES6_DefaultAndNamed.js 1`] = ` "/* @flow */ declare export default number; @@ -254,41 +256,41 @@ declare export var str: string; " `; -exports[`test ES6_ExportAllFrom_Intermediary1.js 1`] = ` +exports[`ES6_ExportAllFrom_Intermediary1.js 1`] = ` "/** * @providesModule ES6_ExportAllFrom_Intermediary1 * @flow */ -declare export * from \"ES6_ExportAllFrom_Source1\"; +declare export * from \\"ES6_ExportAllFrom_Source1\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule ES6_ExportAllFrom_Intermediary1 * @flow */ -declare export * from \"ES6_ExportAllFrom_Source1\" +declare export * from \\"ES6_ExportAllFrom_Source1\\" " `; -exports[`test ES6_ExportAllFrom_Intermediary2.js 1`] = ` +exports[`ES6_ExportAllFrom_Intermediary2.js 1`] = ` "/** * @providesModule ES6_ExportAllFrom_Intermediary2 * @flow */ -declare export * from \"ES6_ExportAllFrom_Source2\"; +declare export * from \\"ES6_ExportAllFrom_Source2\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule ES6_ExportAllFrom_Intermediary2 * @flow */ -declare export * from \"ES6_ExportAllFrom_Source2\" +declare export * from \\"ES6_ExportAllFrom_Source2\\" " `; -exports[`test ES6_ExportAllFrom_Source1.js 1`] = ` +exports[`ES6_ExportAllFrom_Source1.js 1`] = ` "/** * @providesModule ES6_ExportAllFrom_Source1 * @flow @@ -305,7 +307,7 @@ declare export var numberValue1: number; " `; -exports[`test ES6_ExportAllFrom_Source2.js 1`] = ` +exports[`ES6_ExportAllFrom_Source2.js 1`] = ` "/** * @providesModule ES6_ExportAllFrom_Source2 * @flow @@ -322,20 +324,20 @@ declare export var numberValue2: number; " `; -exports[`test ES6_ExportAllFromMulti.js 1`] = ` +exports[`ES6_ExportAllFromMulti.js 1`] = ` "// @flow -declare export * from \"./ES6_ExportAllFrom_Source1\"; -declare export * from \"./ES6_ExportAllFrom_Source2\"; +declare export * from \\"./ES6_ExportAllFrom_Source1\\"; +declare export * from \\"./ES6_ExportAllFrom_Source2\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -declare export * from \"./ES6_ExportAllFrom_Source1\" -declare export * from \"./ES6_ExportAllFrom_Source2\" +declare export * from \\"./ES6_ExportAllFrom_Source1\\" +declare export * from \\"./ES6_ExportAllFrom_Source2\\" " `; -exports[`test ES6_ExportFrom_Intermediary1.js 1`] = ` +exports[`ES6_ExportFrom_Intermediary1.js 1`] = ` "/** * @providesModule ES6_ExportFrom_Intermediary1 * @flow @@ -344,7 +346,7 @@ exports[`test ES6_ExportFrom_Intermediary1.js 1`] = ` declare export { numberValue1, numberValue2 as numberValue2_renamed -} from \"ES6_ExportFrom_Source1\"; +} from \\"ES6_ExportFrom_Source1\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule ES6_ExportFrom_Intermediary1 @@ -354,11 +356,11 @@ declare export { declare export { numberValue1, numberValue2 as numberValue2_renamed -} from \"ES6_ExportFrom_Source1\"; +} from \\"ES6_ExportFrom_Source1\\"; " `; -exports[`test ES6_ExportFrom_Intermediary2.js 1`] = ` +exports[`ES6_ExportFrom_Intermediary2.js 1`] = ` "/** * @providesModule ES6_ExportFrom_Intermediary2 * @flow @@ -367,7 +369,7 @@ exports[`test ES6_ExportFrom_Intermediary2.js 1`] = ` declare export { numberValue1, numberValue2 as numberValue2_renamed2 -} from \"ES6_ExportFrom_Source2\"; +} from \\"ES6_ExportFrom_Source2\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule ES6_ExportFrom_Intermediary2 @@ -377,11 +379,11 @@ declare export { declare export { numberValue1, numberValue2 as numberValue2_renamed2 -} from \"ES6_ExportFrom_Source2\"; +} from \\"ES6_ExportFrom_Source2\\"; " `; -exports[`test ES6_ExportFrom_Source1.js 1`] = ` +exports[`ES6_ExportFrom_Source1.js 1`] = ` "/** * @providesModule ES6_ExportFrom_Source1 * @flow @@ -400,7 +402,7 @@ declare export var numberValue2: number; " `; -exports[`test ES6_ExportFrom_Source2.js 1`] = ` +exports[`ES6_ExportFrom_Source2.js 1`] = ` "/** * @providesModule ES6_ExportFrom_Source2 * @flow @@ -419,7 +421,7 @@ declare export var numberValue2: number; " `; -exports[`test ES6_Named1.js 1`] = ` +exports[`ES6_Named1.js 1`] = ` "/** * @providesModule ES6_Named1 * @flow @@ -466,7 +468,7 @@ declare export var varDeclNumber2: number; " `; -exports[`test ES6_Named2.js 1`] = ` +exports[`ES6_Named2.js 1`] = ` "/** * @providesModule ES6_Named2 * @flow @@ -509,7 +511,7 @@ declare export var varDeclNumber4: number; " `; -exports[`test ProvidesModuleA.js 1`] = ` +exports[`ProvidesModuleA.js 1`] = ` "/** * @providesModule A * @flow @@ -519,7 +521,7 @@ exports.numberValue1 = 42; exports.numberValue2 = 42; exports.numberValue3 = 42; exports.numberValue4 = 42; -exports.stringValue = \"str\"; +exports.stringValue = \\"str\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule A @@ -530,11 +532,11 @@ exports.numberValue1 = 42; exports.numberValue2 = 42; exports.numberValue3 = 42; exports.numberValue4 = 42; -exports.stringValue = \"str\"; +exports.stringValue = \\"str\\"; " `; -exports[`test ProvidesModuleCJSDefault.js 1`] = ` +exports[`ProvidesModuleCJSDefault.js 1`] = ` "/** * @providesModule CJSDefault * @flow @@ -555,7 +557,7 @@ module.exports = { " `; -exports[`test ProvidesModuleD.js 1`] = ` +exports[`ProvidesModuleD.js 1`] = ` "/** * @providesModule D * @flow @@ -568,7 +570,7 @@ exports[`test ProvidesModuleD.js 1`] = ` " `; -exports[`test ProvidesModuleES6Default.js 1`] = ` +exports[`ProvidesModuleES6Default.js 1`] = ` "/** * @providesModule ES6Default * @flow @@ -592,14 +594,14 @@ export default { " `; -exports[`test SideEffects.js 1`] = ` +exports[`SideEffects.js 1`] = ` "/* @flow */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ " `; -exports[`test es6modules.js 1`] = ` +exports[`es6modules.js 1`] = ` "/* @flow */ // ===================== // @@ -607,44 +609,44 @@ exports[`test es6modules.js 1`] = ` // ===================== // // @providesModule -import * as DefaultA from \"A\"; +import * as DefaultA from \\"A\\"; var a1: number = DefaultA.numberValue1; var a2: string = DefaultA.numberValue1; // Error: number ~> string // File path -import * as DefaultB from \"./B\"; +import * as DefaultB from \\"./B\\"; var b1: number = DefaultB.numberValue; var b2: string = DefaultB.numberValue; // Error: number ~> string // C.js exists, but not as a providesModule -import DefaultC from \"C\"; // Error: No such module +import DefaultC from \\"C\\"; // Error: No such module // @providesModule D exists, but not as a filename -import DefaultD from \"./D\"; // Error: No such module +import DefaultD from \\"./D\\"; // Error: No such module // ================================================ // // == CommonJS Clobbering Literal Exports -> ES6 == // // ================================================ // -import {doesntExist1} from \"CommonJS_Clobbering_Lit\"; // Error: Not an exported binding +import {doesntExist1} from \\"CommonJS_Clobbering_Lit\\"; // Error: Not an exported binding -import {numberValue1} from \"CommonJS_Clobbering_Lit\"; +import {numberValue1} from \\"CommonJS_Clobbering_Lit\\"; var c1: number = numberValue1; var c2: string = numberValue1; // Error: number ~> string -import {numberValue2 as numVal1} from \"CommonJS_Clobbering_Lit\"; +import {numberValue2 as numVal1} from \\"CommonJS_Clobbering_Lit\\"; var d1: number = numVal1; var d2: string = numVal1; // Error: number ~> string -import CJS_Clobb_Lit from \"CommonJS_Clobbering_Lit\"; +import CJS_Clobb_Lit from \\"CommonJS_Clobbering_Lit\\"; var e1: number = CJS_Clobb_Lit.numberValue3; var e2: string = CJS_Clobb_Lit.numberValue3; // Error: number ~> string -CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn\'t a property +CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn't a property -import * as CJS_Clobb_Lit_NS from \"CommonJS_Clobbering_Lit\"; +import * as CJS_Clobb_Lit_NS from \\"CommonJS_Clobbering_Lit\\"; var f1: number = CJS_Clobb_Lit_NS.numberValue4; var f2: number = CJS_Clobb_Lit_NS.default.numberValue4; -CJS_Clobb_Lit_NS.default.default; // Error: No \'default\' property on the exported obj +CJS_Clobb_Lit_NS.default.default; // Error: No 'default' property on the exported obj var f3: string = CJS_Clobb_Lit_NS.numberValue4; // Error: number ~> string var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> string @@ -652,15 +654,15 @@ var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> stri // == CommonJS Clobbering Class Exports -> ES6 == // // ============================================== // -import {doesntExist2} from \"CommonJS_Clobbering_Class\"; // Error: Not an exported binding +import {doesntExist2} from \\"CommonJS_Clobbering_Class\\"; // Error: Not an exported binding // The following import should error because class statics are not turned into // named exports for now. This avoids complexities with polymorphic static // members (where the polymophism is defined on the class itself rather than the // method). -import {staticNumber1, baseProp, childProp} from \"CommonJS_Clobbering_Class\"; // Error +import {staticNumber1, baseProp, childProp} from \\"CommonJS_Clobbering_Class\\"; // Error -import CJS_Clobb_Class from \"CommonJS_Clobbering_Class\"; +import CJS_Clobb_Class from \\"CommonJS_Clobbering_Class\\"; new CJS_Clobb_Class(); new CJS_Clobb_Class().doesntExist; // Error: Class has no \`doesntExist\` property var h1: number = CJS_Clobb_Class.staticNumber2(); @@ -668,8 +670,8 @@ var h2: string = CJS_Clobb_Class.staticNumber2(); // Error: number ~> string var h3: number = new CJS_Clobb_Class().instNumber1(); var h4: string = new CJS_Clobb_Class().instNumber1(); // Error: number ~> string -import * as CJS_Clobb_Class_NS from \"CommonJS_Clobbering_Class\"; -new CJS_Clobb_Class_NS(); // Error: Namespace object isn\'t constructable +import * as CJS_Clobb_Class_NS from \\"CommonJS_Clobbering_Class\\"; +new CJS_Clobb_Class_NS(); // Error: Namespace object isn't constructable var i1: number = CJS_Clobb_Class_NS.staticNumber3(); // Error: Class statics not copied to Namespace object var i2: number = new CJS_Clobb_Class_NS.default().instNumber2(); var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: number ~> string @@ -678,22 +680,22 @@ var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: numbe // == CommonJS Named Exports -> ES6 == // // =================================== // -import {doesntExist3} from \"CommonJS_Named\"; // Error: Not an exported binding +import {doesntExist3} from \\"CommonJS_Named\\"; // Error: Not an exported binding -import {numberValue2} from \"CommonJS_Named\"; +import {numberValue2} from \\"CommonJS_Named\\"; var j1: number = numberValue2; var j2: string = numberValue2; // Error: number ~> string -import {numberValue3 as numVal3} from \"CommonJS_Named\"; +import {numberValue3 as numVal3} from \\"CommonJS_Named\\"; var k1: number = numVal3; var k2: string = numVal3; // Error: number ~> string -import * as CJS_Named from \"CommonJS_Named\"; +import * as CJS_Named from \\"CommonJS_Named\\"; var l1: number = CJS_Named.numberValue1; var l2: string = CJS_Named.numberValue1; // Error: number ~> string -CJS_Named.doesntExist; // Error: doesntExist isn\'t a property +CJS_Named.doesntExist; // Error: doesntExist isn't a property -import * as CJS_Named_NS from \"CommonJS_Named\"; +import * as CJS_Named_NS from \\"CommonJS_Named\\"; var m1: number = CJS_Named_NS.numberValue4; var m2: string = CJS_Named_NS.default.numberValue4; // Error: CommonJS_Named has no default export var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string @@ -702,13 +704,13 @@ var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string // == ES6 Default -> ES6 == // ////////////////////////////// -import {doesntExist4} from \"ES6_Default_AnonFunction1\"; // Error: Not an exported binding +import {doesntExist4} from \\"ES6_Default_AnonFunction1\\"; // Error: Not an exported binding -import ES6_Def_AnonFunc1 from \"ES6_Default_AnonFunction1\"; +import ES6_Def_AnonFunc1 from \\"ES6_Default_AnonFunction1\\"; var n1: number = ES6_Def_AnonFunc1(); var n2: string = ES6_Def_AnonFunc1(); // Error: number ~> string -import ES6_Def_NamedFunc1 from \"ES6_Default_NamedFunction1\"; +import ES6_Def_NamedFunc1 from \\"ES6_Default_NamedFunction1\\"; var o1: number = ES6_Def_NamedFunc1(); var o2: string = ES6_Def_NamedFunc1(); // Error: number ~> string @@ -716,7 +718,7 @@ var o2: string = ES6_Def_NamedFunc1(); // Error: number ~> string -import ES6_Def_NamedClass1 from \"ES6_Default_NamedClass1\"; +import ES6_Def_NamedClass1 from \\"ES6_Default_NamedClass1\\"; var q1: number = new ES6_Def_NamedClass1().givesANum(); var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> string @@ -724,35 +726,35 @@ var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> stri // == ES6 Named -> ES6 == // //////////////////////////// -import doesntExist5 from \"ES6_Named1\"; // Error: Not an exported binding +import doesntExist5 from \\"ES6_Named1\\"; // Error: Not an exported binding -import {specifierNumber1 as specifierNumber1_1} from \"ES6_Named1\"; +import {specifierNumber1 as specifierNumber1_1} from \\"ES6_Named1\\"; var r1: number = specifierNumber1_1; var r2: string = specifierNumber1_1; // Error: number ~> string -import {specifierNumber2Renamed} from \"ES6_Named1\"; +import {specifierNumber2Renamed} from \\"ES6_Named1\\"; var s1: number = specifierNumber2Renamed; var s2: string = specifierNumber2Renamed; // Error: number ~> string -import {specifierNumber3 as specifierNumber3Renamed} from \"ES6_Named1\"; +import {specifierNumber3 as specifierNumber3Renamed} from \\"ES6_Named1\\"; var t1: number = specifierNumber3Renamed; var t2: string = specifierNumber3Renamed; // Error: number ~> string -import {groupedSpecifierNumber1, groupedSpecifierNumber2} from \"ES6_Named1\"; +import {groupedSpecifierNumber1, groupedSpecifierNumber2} from \\"ES6_Named1\\"; var u1: number = groupedSpecifierNumber1; var u2: number = groupedSpecifierNumber2; var u3: string = groupedSpecifierNumber1; // Error: number ~> string var u4: string = groupedSpecifierNumber2; // Error: number ~> string -import {givesANumber} from \"ES6_Named1\"; +import {givesANumber} from \\"ES6_Named1\\"; var v1: number = givesANumber(); var v2: string = givesANumber(); // Error: number ~> string -import {NumberGenerator} from \"ES6_Named1\"; +import {NumberGenerator} from \\"ES6_Named1\\"; var w1: number = new NumberGenerator().givesANumber(); var w2: string = new NumberGenerator().givesANumber(); // Error: number ~> string -import {varDeclNumber1, varDeclNumber2} from \"ES6_Named1\"; +import {varDeclNumber1, varDeclNumber2} from \\"ES6_Named1\\"; var x1: number = varDeclNumber1; var x2: number = varDeclNumber2; var x3: string = varDeclNumber1; // Error: number ~> string @@ -766,15 +768,15 @@ var x4: string = varDeclNumber2; // Error: number ~> string -import {numberValue1 as numberValue4} from \"ES6_ExportFrom_Intermediary1\"; +import {numberValue1 as numberValue4} from \\"ES6_ExportFrom_Intermediary1\\"; var aa1: number = numberValue4; var aa2: string = numberValue4; // Error: number ~> string -import {numberValue2_renamed} from \"ES6_ExportFrom_Intermediary1\"; +import {numberValue2_renamed} from \\"ES6_ExportFrom_Intermediary1\\"; var ab1: number = numberValue2_renamed; var ab2: string = numberValue2_renamed; // Error: number ~> string -import {numberValue1 as numberValue5} from \"ES6_ExportAllFrom_Intermediary1\"; +import {numberValue1 as numberValue5} from \\"ES6_ExportAllFrom_Intermediary1\\"; var ac1: number = numberValue5; var ac2: string = numberValue5; // Error: number ~> string @@ -782,13 +784,13 @@ var ac2: string = numberValue5; // Error: number ~> string // == ES6 Default -> CommonJS == // /////////////////////////////////// -require(\'ES6_Default_AnonFunction2\').doesntExist; // Error: \'doesntExist\' isn\'t an export +require('ES6_Default_AnonFunction2').doesntExist; // Error: 'doesntExist' isn't an export -var ES6_Def_AnonFunc2 = require(\"ES6_Default_AnonFunction2\").default; +var ES6_Def_AnonFunc2 = require(\\"ES6_Default_AnonFunction2\\").default; var ad1: number = ES6_Def_AnonFunc2(); var ad2: string = ES6_Def_AnonFunc2(); // Error: number ~> string -var ES6_Def_NamedFunc2 = require(\"ES6_Default_NamedFunction2\").default; +var ES6_Def_NamedFunc2 = require(\\"ES6_Default_NamedFunction2\\").default; var ae1: number = ES6_Def_NamedFunc2(); var ae2: string = ES6_Def_NamedFunc2(); // Error: number ~> string @@ -796,7 +798,7 @@ var ae2: string = ES6_Def_NamedFunc2(); // Error: number ~> string -var ES6_Def_NamedClass2 = require(\"ES6_Default_NamedClass2\").default; +var ES6_Def_NamedClass2 = require(\\"ES6_Default_NamedClass2\\").default; var ag1: number = new ES6_Def_NamedClass2().givesANum(); var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> string @@ -804,31 +806,31 @@ var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> str // == ES6 Named -> CommonJS == // ///////////////////////////////// -var specifierNumber4 = require(\"ES6_Named2\").specifierNumber4; +var specifierNumber4 = require(\\"ES6_Named2\\").specifierNumber4; var ah1: number = specifierNumber4; var ah2: string = specifierNumber4; // Error: number ~> string -var specifierNumber5Renamed = require(\"ES6_Named2\").specifierNumber5Renamed; +var specifierNumber5Renamed = require(\\"ES6_Named2\\").specifierNumber5Renamed; var ai1: number = specifierNumber5Renamed; var ai2: string = specifierNumber5Renamed; // Error: number ~> string -var groupedSpecifierNumber3 = require(\"ES6_Named2\").groupedSpecifierNumber3; -var groupedSpecifierNumber4 = require(\"ES6_Named2\").groupedSpecifierNumber4; +var groupedSpecifierNumber3 = require(\\"ES6_Named2\\").groupedSpecifierNumber3; +var groupedSpecifierNumber4 = require(\\"ES6_Named2\\").groupedSpecifierNumber4; var aj1: number = groupedSpecifierNumber3; var aj2: number = groupedSpecifierNumber4; var aj3: string = groupedSpecifierNumber3; // Error: number ~> string var aj4: string = groupedSpecifierNumber4; // Error: number ~> string -var givesANumber2 = require(\"ES6_Named2\").givesANumber2; +var givesANumber2 = require(\\"ES6_Named2\\").givesANumber2; var ak1: number = givesANumber2(); var ak2: string = givesANumber2(); // Error: number ~> string -var NumberGenerator2 = require(\"ES6_Named2\").NumberGenerator2; +var NumberGenerator2 = require(\\"ES6_Named2\\").NumberGenerator2; var al1: number = new NumberGenerator2().givesANumber(); var al2: string = new NumberGenerator2().givesANumber(); // Error: number ~> string -var varDeclNumber3 = require(\"ES6_Named2\").varDeclNumber3; -var varDeclNumber4 = require(\"ES6_Named2\").varDeclNumber4; +var varDeclNumber3 = require(\\"ES6_Named2\\").varDeclNumber3; +var varDeclNumber4 = require(\\"ES6_Named2\\").varDeclNumber4; var am1: number = varDeclNumber3; var am2: number = varDeclNumber4; var am3: string = varDeclNumber3; // Error: number ~> string @@ -842,15 +844,15 @@ var am4: string = varDeclNumber4; // Error: number ~> string -var numberValue6 = require(\"ES6_ExportFrom_Intermediary2\").numberValue1; +var numberValue6 = require(\\"ES6_ExportFrom_Intermediary2\\").numberValue1; var ap1: number = numberValue6; var ap2: string = numberValue6; // Error: number ~> string -var numberValue2_renamed2 = require(\"ES6_ExportFrom_Intermediary2\").numberValue2_renamed2; +var numberValue2_renamed2 = require(\\"ES6_ExportFrom_Intermediary2\\").numberValue2_renamed2; var aq1: number = numberValue2_renamed2; var aq2: string = numberValue2_renamed2; // Error: number ~> string -var numberValue7 = require(\"ES6_ExportAllFrom_Intermediary2\").numberValue2; +var numberValue7 = require(\\"ES6_ExportAllFrom_Intermediary2\\").numberValue2; var ar1: number = numberValue7; var ar2: string = numberValue7; // Error: number ~> string @@ -858,7 +860,7 @@ var ar2: string = numberValue7; // Error: number ~> string // == ES6 Default+Named -> ES6 import Default+Named== // //////////////////////////////////////////////////////// -import defaultNum, {str as namedStr} from \"./ES6_DefaultAndNamed\"; +import defaultNum, {str as namedStr} from \\"./ES6_DefaultAndNamed\\"; var as1: number = defaultNum; var as2: string = defaultNum; // Error: number ~> string @@ -870,13 +872,13 @@ var as4: number = namedStr; // Error: string ~> number // == Side-effect only ES6 imports == // //////////////////////////////////////// -import \"./SideEffects\"; +import \\"./SideEffects\\"; ////////////////////////////////////////////// // == Suggest export name on likely typo == // ////////////////////////////////////////////// -import specifierNumber1 from \"ES6_Named1\"; // Error: Did you mean \`import {specifierNumber1} from ...\`? -import {specifierNumber} from \"ES6_Named1\"; // Error: Did you mean \`specifierNumber1\`? +import specifierNumber1 from \\"ES6_Named1\\"; // Error: Did you mean \`import {specifierNumber1} from ...\`? +import {specifierNumber} from \\"ES6_Named1\\"; // Error: Did you mean \`specifierNumber1\`? /////////////////////////////////////////////////// // == Multi \`export *\` should combine exports == // @@ -884,7 +886,7 @@ import {specifierNumber} from \"ES6_Named1\"; // Error: Did you mean \`specifier import { numberValue1 as numberValue8, numberValue2 as numberValue9 -} from \"./ES6_ExportAllFromMulti\"; +} from \\"./ES6_ExportAllFromMulti\\"; var at1: number = numberValue8; var at2: string = numberValue8; // Error: number ~> string @@ -899,44 +901,44 @@ var at4: string = numberValue9; // Error: number ~> string // ===================== // // @providesModule -import * as DefaultA from \"A\"; +import * as DefaultA from \\"A\\"; var a1: number = DefaultA.numberValue1; var a2: string = DefaultA.numberValue1; // Error: number ~> string // File path -import * as DefaultB from \"./B\"; +import * as DefaultB from \\"./B\\"; var b1: number = DefaultB.numberValue; var b2: string = DefaultB.numberValue; // Error: number ~> string // C.js exists, but not as a providesModule -import DefaultC from \"C\"; // Error: No such module +import DefaultC from \\"C\\"; // Error: No such module // @providesModule D exists, but not as a filename -import DefaultD from \"./D\"; // Error: No such module +import DefaultD from \\"./D\\"; // Error: No such module // ================================================ // // == CommonJS Clobbering Literal Exports -> ES6 == // // ================================================ // -import { doesntExist1 } from \"CommonJS_Clobbering_Lit\"; // Error: Not an exported binding +import { doesntExist1 } from \\"CommonJS_Clobbering_Lit\\"; // Error: Not an exported binding -import { numberValue1 } from \"CommonJS_Clobbering_Lit\"; +import { numberValue1 } from \\"CommonJS_Clobbering_Lit\\"; var c1: number = numberValue1; var c2: string = numberValue1; // Error: number ~> string -import { numberValue2 as numVal1 } from \"CommonJS_Clobbering_Lit\"; +import { numberValue2 as numVal1 } from \\"CommonJS_Clobbering_Lit\\"; var d1: number = numVal1; var d2: string = numVal1; // Error: number ~> string -import CJS_Clobb_Lit from \"CommonJS_Clobbering_Lit\"; +import CJS_Clobb_Lit from \\"CommonJS_Clobbering_Lit\\"; var e1: number = CJS_Clobb_Lit.numberValue3; var e2: string = CJS_Clobb_Lit.numberValue3; // Error: number ~> string -CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn\'t a property +CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn't a property -import * as CJS_Clobb_Lit_NS from \"CommonJS_Clobbering_Lit\"; +import * as CJS_Clobb_Lit_NS from \\"CommonJS_Clobbering_Lit\\"; var f1: number = CJS_Clobb_Lit_NS.numberValue4; var f2: number = CJS_Clobb_Lit_NS.default.numberValue4; -CJS_Clobb_Lit_NS.default.default; // Error: No \'default\' property on the exported obj +CJS_Clobb_Lit_NS.default.default; // Error: No 'default' property on the exported obj var f3: string = CJS_Clobb_Lit_NS.numberValue4; // Error: number ~> string var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> string @@ -944,15 +946,15 @@ var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> stri // == CommonJS Clobbering Class Exports -> ES6 == // // ============================================== // -import { doesntExist2 } from \"CommonJS_Clobbering_Class\"; // Error: Not an exported binding +import { doesntExist2 } from \\"CommonJS_Clobbering_Class\\"; // Error: Not an exported binding // The following import should error because class statics are not turned into // named exports for now. This avoids complexities with polymorphic static // members (where the polymophism is defined on the class itself rather than the // method). -import { staticNumber1, baseProp, childProp } from \"CommonJS_Clobbering_Class\"; // Error +import { staticNumber1, baseProp, childProp } from \\"CommonJS_Clobbering_Class\\"; // Error -import CJS_Clobb_Class from \"CommonJS_Clobbering_Class\"; +import CJS_Clobb_Class from \\"CommonJS_Clobbering_Class\\"; new CJS_Clobb_Class(); new CJS_Clobb_Class().doesntExist; // Error: Class has no \`doesntExist\` property var h1: number = CJS_Clobb_Class.staticNumber2(); @@ -960,8 +962,8 @@ var h2: string = CJS_Clobb_Class.staticNumber2(); // Error: number ~> string var h3: number = new CJS_Clobb_Class().instNumber1(); var h4: string = new CJS_Clobb_Class().instNumber1(); // Error: number ~> string -import * as CJS_Clobb_Class_NS from \"CommonJS_Clobbering_Class\"; -new CJS_Clobb_Class_NS(); // Error: Namespace object isn\'t constructable +import * as CJS_Clobb_Class_NS from \\"CommonJS_Clobbering_Class\\"; +new CJS_Clobb_Class_NS(); // Error: Namespace object isn't constructable var i1: number = CJS_Clobb_Class_NS.staticNumber3(); // Error: Class statics not copied to Namespace object var i2: number = new CJS_Clobb_Class_NS.default().instNumber2(); var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: number ~> string @@ -970,22 +972,22 @@ var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: numbe // == CommonJS Named Exports -> ES6 == // // =================================== // -import { doesntExist3 } from \"CommonJS_Named\"; // Error: Not an exported binding +import { doesntExist3 } from \\"CommonJS_Named\\"; // Error: Not an exported binding -import { numberValue2 } from \"CommonJS_Named\"; +import { numberValue2 } from \\"CommonJS_Named\\"; var j1: number = numberValue2; var j2: string = numberValue2; // Error: number ~> string -import { numberValue3 as numVal3 } from \"CommonJS_Named\"; +import { numberValue3 as numVal3 } from \\"CommonJS_Named\\"; var k1: number = numVal3; var k2: string = numVal3; // Error: number ~> string -import * as CJS_Named from \"CommonJS_Named\"; +import * as CJS_Named from \\"CommonJS_Named\\"; var l1: number = CJS_Named.numberValue1; var l2: string = CJS_Named.numberValue1; // Error: number ~> string -CJS_Named.doesntExist; // Error: doesntExist isn\'t a property +CJS_Named.doesntExist; // Error: doesntExist isn't a property -import * as CJS_Named_NS from \"CommonJS_Named\"; +import * as CJS_Named_NS from \\"CommonJS_Named\\"; var m1: number = CJS_Named_NS.numberValue4; var m2: string = CJS_Named_NS.default.numberValue4; // Error: CommonJS_Named has no default export var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string @@ -994,17 +996,17 @@ var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string // == ES6 Default -> ES6 == // ////////////////////////////// -import { doesntExist4 } from \"ES6_Default_AnonFunction1\"; // Error: Not an exported binding +import { doesntExist4 } from \\"ES6_Default_AnonFunction1\\"; // Error: Not an exported binding -import ES6_Def_AnonFunc1 from \"ES6_Default_AnonFunction1\"; +import ES6_Def_AnonFunc1 from \\"ES6_Default_AnonFunction1\\"; var n1: number = ES6_Def_AnonFunc1(); var n2: string = ES6_Def_AnonFunc1(); // Error: number ~> string -import ES6_Def_NamedFunc1 from \"ES6_Default_NamedFunction1\"; +import ES6_Def_NamedFunc1 from \\"ES6_Default_NamedFunction1\\"; var o1: number = ES6_Def_NamedFunc1(); var o2: string = ES6_Def_NamedFunc1(); // Error: number ~> string -import ES6_Def_NamedClass1 from \"ES6_Default_NamedClass1\"; +import ES6_Def_NamedClass1 from \\"ES6_Default_NamedClass1\\"; var q1: number = new ES6_Def_NamedClass1().givesANum(); var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> string @@ -1012,49 +1014,49 @@ var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> stri // == ES6 Named -> ES6 == // //////////////////////////// -import doesntExist5 from \"ES6_Named1\"; // Error: Not an exported binding +import doesntExist5 from \\"ES6_Named1\\"; // Error: Not an exported binding -import { specifierNumber1 as specifierNumber1_1 } from \"ES6_Named1\"; +import { specifierNumber1 as specifierNumber1_1 } from \\"ES6_Named1\\"; var r1: number = specifierNumber1_1; var r2: string = specifierNumber1_1; // Error: number ~> string -import { specifierNumber2Renamed } from \"ES6_Named1\"; +import { specifierNumber2Renamed } from \\"ES6_Named1\\"; var s1: number = specifierNumber2Renamed; var s2: string = specifierNumber2Renamed; // Error: number ~> string -import { specifierNumber3 as specifierNumber3Renamed } from \"ES6_Named1\"; +import { specifierNumber3 as specifierNumber3Renamed } from \\"ES6_Named1\\"; var t1: number = specifierNumber3Renamed; var t2: string = specifierNumber3Renamed; // Error: number ~> string -import { groupedSpecifierNumber1, groupedSpecifierNumber2 } from \"ES6_Named1\"; +import { groupedSpecifierNumber1, groupedSpecifierNumber2 } from \\"ES6_Named1\\"; var u1: number = groupedSpecifierNumber1; var u2: number = groupedSpecifierNumber2; var u3: string = groupedSpecifierNumber1; // Error: number ~> string var u4: string = groupedSpecifierNumber2; // Error: number ~> string -import { givesANumber } from \"ES6_Named1\"; +import { givesANumber } from \\"ES6_Named1\\"; var v1: number = givesANumber(); var v2: string = givesANumber(); // Error: number ~> string -import { NumberGenerator } from \"ES6_Named1\"; +import { NumberGenerator } from \\"ES6_Named1\\"; var w1: number = new NumberGenerator().givesANumber(); var w2: string = new NumberGenerator().givesANumber(); // Error: number ~> string -import { varDeclNumber1, varDeclNumber2 } from \"ES6_Named1\"; +import { varDeclNumber1, varDeclNumber2 } from \\"ES6_Named1\\"; var x1: number = varDeclNumber1; var x2: number = varDeclNumber2; var x3: string = varDeclNumber1; // Error: number ~> string var x4: string = varDeclNumber2; // Error: number ~> string -import { numberValue1 as numberValue4 } from \"ES6_ExportFrom_Intermediary1\"; +import { numberValue1 as numberValue4 } from \\"ES6_ExportFrom_Intermediary1\\"; var aa1: number = numberValue4; var aa2: string = numberValue4; // Error: number ~> string -import { numberValue2_renamed } from \"ES6_ExportFrom_Intermediary1\"; +import { numberValue2_renamed } from \\"ES6_ExportFrom_Intermediary1\\"; var ab1: number = numberValue2_renamed; var ab2: string = numberValue2_renamed; // Error: number ~> string -import { numberValue1 as numberValue5 } from \"ES6_ExportAllFrom_Intermediary1\"; +import { numberValue1 as numberValue5 } from \\"ES6_ExportAllFrom_Intermediary1\\"; var ac1: number = numberValue5; var ac2: string = numberValue5; // Error: number ~> string @@ -1062,17 +1064,17 @@ var ac2: string = numberValue5; // Error: number ~> string // == ES6 Default -> CommonJS == // /////////////////////////////////// -require(\"ES6_Default_AnonFunction2\").doesntExist; // Error: \'doesntExist\' isn\'t an export +require(\\"ES6_Default_AnonFunction2\\").doesntExist; // Error: 'doesntExist' isn't an export -var ES6_Def_AnonFunc2 = require(\"ES6_Default_AnonFunction2\").default; +var ES6_Def_AnonFunc2 = require(\\"ES6_Default_AnonFunction2\\").default; var ad1: number = ES6_Def_AnonFunc2(); var ad2: string = ES6_Def_AnonFunc2(); // Error: number ~> string -var ES6_Def_NamedFunc2 = require(\"ES6_Default_NamedFunction2\").default; +var ES6_Def_NamedFunc2 = require(\\"ES6_Default_NamedFunction2\\").default; var ae1: number = ES6_Def_NamedFunc2(); var ae2: string = ES6_Def_NamedFunc2(); // Error: number ~> string -var ES6_Def_NamedClass2 = require(\"ES6_Default_NamedClass2\").default; +var ES6_Def_NamedClass2 = require(\\"ES6_Default_NamedClass2\\").default; var ag1: number = new ES6_Def_NamedClass2().givesANum(); var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> string @@ -1080,47 +1082,47 @@ var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> str // == ES6 Named -> CommonJS == // ///////////////////////////////// -var specifierNumber4 = require(\"ES6_Named2\").specifierNumber4; +var specifierNumber4 = require(\\"ES6_Named2\\").specifierNumber4; var ah1: number = specifierNumber4; var ah2: string = specifierNumber4; // Error: number ~> string -var specifierNumber5Renamed = require(\"ES6_Named2\").specifierNumber5Renamed; +var specifierNumber5Renamed = require(\\"ES6_Named2\\").specifierNumber5Renamed; var ai1: number = specifierNumber5Renamed; var ai2: string = specifierNumber5Renamed; // Error: number ~> string -var groupedSpecifierNumber3 = require(\"ES6_Named2\").groupedSpecifierNumber3; -var groupedSpecifierNumber4 = require(\"ES6_Named2\").groupedSpecifierNumber4; +var groupedSpecifierNumber3 = require(\\"ES6_Named2\\").groupedSpecifierNumber3; +var groupedSpecifierNumber4 = require(\\"ES6_Named2\\").groupedSpecifierNumber4; var aj1: number = groupedSpecifierNumber3; var aj2: number = groupedSpecifierNumber4; var aj3: string = groupedSpecifierNumber3; // Error: number ~> string var aj4: string = groupedSpecifierNumber4; // Error: number ~> string -var givesANumber2 = require(\"ES6_Named2\").givesANumber2; +var givesANumber2 = require(\\"ES6_Named2\\").givesANumber2; var ak1: number = givesANumber2(); var ak2: string = givesANumber2(); // Error: number ~> string -var NumberGenerator2 = require(\"ES6_Named2\").NumberGenerator2; +var NumberGenerator2 = require(\\"ES6_Named2\\").NumberGenerator2; var al1: number = new NumberGenerator2().givesANumber(); var al2: string = new NumberGenerator2().givesANumber(); // Error: number ~> string -var varDeclNumber3 = require(\"ES6_Named2\").varDeclNumber3; -var varDeclNumber4 = require(\"ES6_Named2\").varDeclNumber4; +var varDeclNumber3 = require(\\"ES6_Named2\\").varDeclNumber3; +var varDeclNumber4 = require(\\"ES6_Named2\\").varDeclNumber4; var am1: number = varDeclNumber3; var am2: number = varDeclNumber4; var am3: string = varDeclNumber3; // Error: number ~> string var am4: string = varDeclNumber4; // Error: number ~> string -var numberValue6 = require(\"ES6_ExportFrom_Intermediary2\").numberValue1; +var numberValue6 = require(\\"ES6_ExportFrom_Intermediary2\\").numberValue1; var ap1: number = numberValue6; var ap2: string = numberValue6; // Error: number ~> string var numberValue2_renamed2 = require( - \"ES6_ExportFrom_Intermediary2\" + \\"ES6_ExportFrom_Intermediary2\\" ).numberValue2_renamed2; var aq1: number = numberValue2_renamed2; var aq2: string = numberValue2_renamed2; // Error: number ~> string -var numberValue7 = require(\"ES6_ExportAllFrom_Intermediary2\").numberValue2; +var numberValue7 = require(\\"ES6_ExportAllFrom_Intermediary2\\").numberValue2; var ar1: number = numberValue7; var ar2: string = numberValue7; // Error: number ~> string @@ -1128,7 +1130,7 @@ var ar2: string = numberValue7; // Error: number ~> string // == ES6 Default+Named -> ES6 import Default+Named== // //////////////////////////////////////////////////////// -import defaultNum, { str as namedStr } from \"./ES6_DefaultAndNamed\"; +import defaultNum, { str as namedStr } from \\"./ES6_DefaultAndNamed\\"; var as1: number = defaultNum; var as2: string = defaultNum; // Error: number ~> string @@ -1140,13 +1142,13 @@ var as4: number = namedStr; // Error: string ~> number // == Side-effect only ES6 imports == // //////////////////////////////////////// -import \"./SideEffects\"; +import \\"./SideEffects\\"; ////////////////////////////////////////////// // == Suggest export name on likely typo == // ////////////////////////////////////////////// -import specifierNumber1 from \"ES6_Named1\"; // Error: Did you mean \`import {specifierNumber1} from ...\`? -import { specifierNumber } from \"ES6_Named1\"; // Error: Did you mean \`specifierNumber1\`? +import specifierNumber1 from \\"ES6_Named1\\"; // Error: Did you mean \`import {specifierNumber1} from ...\`? +import { specifierNumber } from \\"ES6_Named1\\"; // Error: Did you mean \`specifierNumber1\`? /////////////////////////////////////////////////// // == Multi \`export *\` should combine exports == // @@ -1154,7 +1156,7 @@ import { specifierNumber } from \"ES6_Named1\"; // Error: Did you mean \`specifi import { numberValue1 as numberValue8, numberValue2 as numberValue9 -} from \"./ES6_ExportAllFromMulti\"; +} from \\"./ES6_ExportAllFromMulti\\"; var at1: number = numberValue8; var at2: string = numberValue8; // Error: number ~> string diff --git a/tests/flow/declare_fun/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_fun/__snapshots__/jsfmt.spec.js.snap index e06355ffc..aca6289e3 100644 --- a/tests/flow/declare_fun/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declare_fun/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "declare function foo(x: number): string; declare function foo(x: string): number; declare function foo(x: X): X; (foo(0): string); // OK -(foo(\"hello\"): number); // OK +(foo(\\"hello\\"): number); // OK (foo(false): void); // error, boolean ~/~ undefined ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare function foo(x: number): string; @@ -12,7 +14,7 @@ declare function foo(x: string): number; declare function foo(x: X): X; (foo(0): string); // OK -(foo(\"hello\"): number); // OK +(foo(\\"hello\\"): number); // OK (foo(false): void); // error, boolean ~/~ undefined " `; diff --git a/tests/flow/declare_module_exports/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_module_exports/__snapshots__/jsfmt.spec.js.snap index 2f36e14c0..2d2bdd266 100644 --- a/tests/flow/declare_module_exports/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declare_module_exports/__snapshots__/jsfmt.spec.js.snap @@ -1,15 +1,17 @@ -exports[`test main.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`main.js 1`] = ` "// @flow -import declare_module_exports from \"declare_module_exports\"; +import declare_module_exports from \\"declare_module_exports\\"; (declare_module_exports: number); (declare_module_exports: string); // Error: number ~> string -// Error: Has no named export \"str\"! -import {str} from \"declare_m_e_with_other_value_declares\"; +// Error: Has no named export \\"str\\"! +import {str} from \\"declare_m_e_with_other_value_declares\\"; -import type {str2} from \"declare_m_e_with_other_type_declares\"; -(\"asdf\": str2); +import type {str2} from \\"declare_m_e_with_other_type_declares\\"; +(\\"asdf\\": str2); (42: str2); // Error: number ~> string /** @@ -17,25 +19,25 @@ import type {str2} from \"declare_m_e_with_other_type_declares\"; * syntaxes will work. */ -import DEPRECATED__declare_var_exports from \"DEPRECATED__declare_var_exports\"; +import DEPRECATED__declare_var_exports from \\"DEPRECATED__declare_var_exports\\"; (DEPRECATED__declare_var_exports: number); (DEPRECATED__declare_var_exports: string); // Error: number ~> string -import declare_m_e_with_declare_var_e from \"declare_m_e_with_declare_var_e\"; +import declare_m_e_with_declare_var_e from \\"declare_m_e_with_declare_var_e\\"; (declare_m_e_with_declare_var_e: number); (declare_m_e_with_declare_var_e: string); // Error: number ~> string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import declare_module_exports from \"declare_module_exports\"; +import declare_module_exports from \\"declare_module_exports\\"; (declare_module_exports: number); (declare_module_exports: string); // Error: number ~> string -// Error: Has no named export \"str\"! -import { str } from \"declare_m_e_with_other_value_declares\"; +// Error: Has no named export \\"str\\"! +import { str } from \\"declare_m_e_with_other_value_declares\\"; -import type { str2 } from \"declare_m_e_with_other_type_declares\"; -(\"asdf\": str2); +import type { str2 } from \\"declare_m_e_with_other_type_declares\\"; +(\\"asdf\\": str2); (42: str2); // Error: number ~> string /** @@ -43,11 +45,11 @@ import type { str2 } from \"declare_m_e_with_other_type_declares\"; * syntaxes will work. */ -import DEPRECATED__declare_var_exports from \"DEPRECATED__declare_var_exports\"; +import DEPRECATED__declare_var_exports from \\"DEPRECATED__declare_var_exports\\"; (DEPRECATED__declare_var_exports: number); (DEPRECATED__declare_var_exports: string); // Error: number ~> string -import declare_m_e_with_declare_var_e from \"declare_m_e_with_declare_var_e\"; +import declare_m_e_with_declare_var_e from \\"declare_m_e_with_declare_var_e\\"; (declare_m_e_with_declare_var_e: number); (declare_m_e_with_declare_var_e: string); // Error: number ~> string " diff --git a/tests/flow/declare_module_exports/flow-typed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_module_exports/flow-typed/__snapshots__/jsfmt.spec.js.snap index 9e17ec1f7..6191c0856 100644 --- a/tests/flow/declare_module_exports/flow-typed/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declare_module_exports/flow-typed/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test libs.js 1`] = ` -"declare module \"declare_module_exports\" { +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`libs.js 1`] = ` +"declare module \\"declare_module_exports\\" { declare module.exports: number; } -declare module \"declare_m_e_with_other_value_declares\" { +declare module \\"declare_m_e_with_other_value_declares\\" { declare module.exports: number; declare var str: string; } -declare module \"declare_m_e_with_other_type_declares\" { +declare module \\"declare_m_e_with_other_type_declares\\" { declare module.exports: number; declare type str2 = string; } @@ -18,26 +20,26 @@ declare module \"declare_m_e_with_other_type_declares\" { * syntaxes will work. */ -declare module \"DEPRECATED__declare_var_exports\" { +declare module \\"DEPRECATED__declare_var_exports\\" { declare var exports: number; } /** * Ensure that, if both are present, \`declare module.exports\` wins */ -declare module \"declare_m_e_with_declare_var_e\" { +declare module \\"declare_m_e_with_declare_var_e\\" { declare module.exports: number; declare var exports: string; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -declare module \"declare_module_exports\" { +declare module \\"declare_module_exports\\" { declare module.exports: number; } -declare module \"declare_m_e_with_other_value_declares\" { +declare module \\"declare_m_e_with_other_value_declares\\" { declare module.exports: number; declare var str: string; } -declare module \"declare_m_e_with_other_type_declares\" { +declare module \\"declare_m_e_with_other_type_declares\\" { declare module.exports: number; declare type str2 = string; } @@ -46,14 +48,14 @@ declare module \"declare_m_e_with_other_type_declares\" { * syntaxes will work. */ -declare module \"DEPRECATED__declare_var_exports\" { +declare module \\"DEPRECATED__declare_var_exports\\" { declare var exports: number; /** * Ensure that, if both are present, \`declare module.exports\` wins */ } -declare module \"declare_m_e_with_declare_var_e\" { +declare module \\"declare_m_e_with_declare_var_e\\" { declare module.exports: number; declare var exports: string; } diff --git a/tests/flow/declare_type/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_type/__snapshots__/jsfmt.spec.js.snap index 5a87f7bfd..db1fd1fb5 100644 --- a/tests/flow/declare_type/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declare_type/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test import_declare_type.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`import_declare_type.js 1`] = ` "/** * @flow */ @@ -6,21 +8,21 @@ exports[`test import_declare_type.js 1`] = ` //////////////////////////////////////////////////////////// // == Import Declared Type Alias From Declared Module == // ////////////////////////////////////////////////////////// -import type {baz} from \"ModuleAliasFoo\"; -import {foo} from \"ModuleAliasFoo\"; +import type {baz} from \\"ModuleAliasFoo\\"; +import {foo} from \\"ModuleAliasFoo\\"; var k1: baz = 42; -var k2: baz = \"shab\"; // Error: string to int +var k2: baz = \\"shab\\"; // Error: string to int var k3: toz = foo(k1); // works -import type {toz} from \"ModuleAliasFoo\"; +import type {toz} from \\"ModuleAliasFoo\\"; var k4: toz = foo(k1); // works ////////////////////////////////////////////////////////// // == Declared Module with exports prop (issue 880) == // //////////////////////////////////////////////////////// -import blah from \'foo\'; -import type { Foo, Bar, Id } from \'foo\'; +import blah from 'foo'; +import type { Foo, Bar, Id } from 'foo'; blah(0, 0); @@ -28,7 +30,7 @@ blah(0, 0); (3 : Bar); // error : number ~> A -(\"lol\" : Id); // error : string ~> number +(\\"lol\\" : Id); // error : string ~> number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow @@ -37,21 +39,21 @@ blah(0, 0); //////////////////////////////////////////////////////////// // == Import Declared Type Alias From Declared Module == // ////////////////////////////////////////////////////////// -import type { baz } from \"ModuleAliasFoo\"; -import { foo } from \"ModuleAliasFoo\"; +import type { baz } from \\"ModuleAliasFoo\\"; +import { foo } from \\"ModuleAliasFoo\\"; var k1: baz = 42; -var k2: baz = \"shab\"; // Error: string to int +var k2: baz = \\"shab\\"; // Error: string to int var k3: toz = foo(k1); // works -import type { toz } from \"ModuleAliasFoo\"; +import type { toz } from \\"ModuleAliasFoo\\"; var k4: toz = foo(k1); // works ////////////////////////////////////////////////////////// // == Declared Module with exports prop (issue 880) == // //////////////////////////////////////////////////////// -import blah from \"foo\"; -import type { Foo, Bar, Id } from \"foo\"; +import blah from \\"foo\\"; +import type { Foo, Bar, Id } from \\"foo\\"; blah(0, 0); @@ -59,6 +61,6 @@ blah(0, 0); (3: Bar); // error : number ~> A -(\"lol\": Id); // error : string ~> number +(\\"lol\\": Id); // error : string ~> number " `; diff --git a/tests/flow/declare_type/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/declare_type/lib/__snapshots__/jsfmt.spec.js.snap index f2c6c921a..c9893e33f 100644 --- a/tests/flow/declare_type/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/declare_type/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test declare_module_type_alias.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`declare_module_type_alias.js 1`] = ` "/** * @flow */ @@ -27,10 +29,10 @@ declare type Foo = string; " `; -exports[`test declare_type_exports.js 1`] = ` +exports[`declare_type_exports.js 1`] = ` "/* @flow */ -declare module \'foo\' { +declare module 'foo' { declare class A { toz : number } @@ -48,7 +50,7 @@ declare module \'foo\' { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -declare module \"foo\" { +declare module \\"foo\\" { declare class A { toz: number } diff --git a/tests/flow/def_site_variance/__snapshots__/jsfmt.spec.js.snap b/tests/flow/def_site_variance/__snapshots__/jsfmt.spec.js.snap index 0eb20a261..954911aa7 100644 --- a/tests/flow/def_site_variance/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/def_site_variance/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "class Variance<+Out,-In> { foo(x: Out): Out { return x; } bar(y: In): In { return y; } diff --git a/tests/flow/demo/1/__snapshots__/jsfmt.spec.js.snap b/tests/flow/demo/1/__snapshots__/jsfmt.spec.js.snap index fc46c2e70..1ced68b34 100644 --- a/tests/flow/demo/1/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/demo/1/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test f.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`f.js 1`] = ` "/* demo */ function f(x) { return 42/x; } diff --git a/tests/flow/demo/2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/demo/2/__snapshots__/jsfmt.spec.js.snap index 96d1db97a..db4f0b420 100644 --- a/tests/flow/demo/2/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/demo/2/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/* @providesModule Demo */ class A { @@ -47,13 +49,13 @@ module.exports = A; " `; -exports[`test B.js 1`] = ` -"var A = require(\'Demo\'); +exports[`B.js 1`] = ` +"var A = require('Demo'); -var z = new A(\"42\").getX(); +var z = new A(\\"42\\").getX(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var A = require(\"Demo\"); +var A = require(\\"Demo\\"); -var z = new A(\"42\").getX(); +var z = new A(\\"42\\").getX(); " `; diff --git a/tests/flow/deps/__snapshots__/jsfmt.spec.js.snap b/tests/flow/deps/__snapshots__/jsfmt.spec.js.snap index 2034af1ac..eb15a925a 100644 --- a/tests/flow/deps/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/deps/__snapshots__/jsfmt.spec.js.snap @@ -1,68 +1,70 @@ -exports[`test A.js 1`] = ` -"require(\'./C\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` +"require('./C'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require(\"./C\"); +require(\\"./C\\"); " `; -exports[`test B.js 1`] = ` -"require(\'./C\'); +exports[`B.js 1`] = ` +"require('./C'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require(\"./C\"); +require(\\"./C\\"); " `; -exports[`test C.js 1`] = ` -"require(\'./D\'); -require(\'./E\'); -require(\'./F\'); -require(\'./G\'); +exports[`C.js 1`] = ` +"require('./D'); +require('./E'); +require('./F'); +require('./G'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require(\"./D\"); -require(\"./E\"); -require(\"./F\"); -require(\"./G\"); +require(\\"./D\\"); +require(\\"./E\\"); +require(\\"./F\\"); +require(\\"./G\\"); " `; -exports[`test D.js 1`] = ` -"require(\'./I\'); +exports[`D.js 1`] = ` +"require('./I'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require(\"./I\"); +require(\\"./I\\"); " `; -exports[`test E.js 1`] = ` -"require(\'./I\'); +exports[`E.js 1`] = ` +"require('./I'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require(\"./I\"); +require(\\"./I\\"); " `; -exports[`test F.js 1`] = ` +exports[`F.js 1`] = ` "// empty ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // empty " `; -exports[`test G.js 1`] = ` -"require(\'./H\'); +exports[`G.js 1`] = ` +"require('./H'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require(\"./H\"); +require(\\"./H\\"); " `; -exports[`test H.js 1`] = ` +exports[`H.js 1`] = ` "// empty ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // empty " `; -exports[`test I.js 1`] = ` -"require(\'./A\'); +exports[`I.js 1`] = ` +"require('./A'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -require(\"./A\"); +require(\\"./A\\"); " `; diff --git a/tests/flow/destructuring/__snapshots__/jsfmt.spec.js.snap b/tests/flow/destructuring/__snapshots__/jsfmt.spec.js.snap index aef73dd80..243d6408a 100644 --- a/tests/flow/destructuring/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/destructuring/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,7 @@ -exports[`test array_rest.js 1`] = ` -"let xs = [0, \"\", true]; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`array_rest.js 1`] = ` +"let xs = [0, \\"\\", true]; let [a, ...ys] = xs; let [b, ...zs] = ys; let c = zs[0]; // retain tuple info @@ -12,7 +14,7 @@ let d = zs[1]; // run off the end let [...e] = 0; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -let xs = [0, \"\", true]; +let xs = [0, \\"\\", true]; let [a, ...ys] = xs; let [b, ...zs] = ys; let c = zs[0]; // retain tuple info @@ -27,33 +29,33 @@ let [...e] = 0; " `; -exports[`test computed.js 1`] = ` -"var { [\"key\"]: val1 } = { key: \"val\" }; +exports[`computed.js 1`] = ` +"var { [\\"key\\"]: val1 } = { key: \\"val\\" }; (val1: void); // error: string ~> void -var key: string = \"key\"; -var { [key]: val2 } = { key: \"val\" }; +var key: string = \\"key\\"; +var { [key]: val2 } = { key: \\"val\\" }; (val2: void); // ok (gasp!) by existing StrT -> ElemT rule -var { [\"key\"]: val3, ...spread } = { key: \"val\" }; -(spread.key: void); // error (gasp!) in general we don\'t know if a computed prop should be excluded from spread +var { [\\"key\\"]: val3, ...spread } = { key: \\"val\\" }; +(spread.key: void); // error (gasp!) in general we don't know if a computed prop should be excluded from spread ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var { [\"key\"]: val1 } = { key: \"val\" }; +var { [\\"key\\"]: val1 } = { key: \\"val\\" }; (val1: void); // error: string ~> void -var key: string = \"key\"; -var { [key]: val2 } = { key: \"val\" }; +var key: string = \\"key\\"; +var { [key]: val2 } = { key: \\"val\\" }; (val2: void); // ok (gasp!) by existing StrT -> ElemT rule -var { [\"key\"]: val3, ...spread } = { key: \"val\" }; -(spread.key: void); // error (gasp!) in general we don\'t know if a computed prop should be excluded from spread +var { [\\"key\\"]: val3, ...spread } = { key: \\"val\\" }; +(spread.key: void); // error (gasp!) in general we don't know if a computed prop should be excluded from spread " `; -exports[`test defaults.js 1`] = ` +exports[`defaults.js 1`] = ` "/* @flow */ -function obj_prop_fun({p:{q=0}={q:true}}={p:{q:\"\"}}) { +function obj_prop_fun({p:{q=0}={q:true}}={p:{q:\\"\\"}}) { // errors: // * number ~> void, from default on _.p.q // * boolean ~> void, from default on _.p @@ -64,9 +66,9 @@ function obj_prop_fun({p:{q=0}={q:true}}={p:{q:\"\"}}) { obj_prop_fun(); // ok obj_prop_fun({}); // ok obj_prop_fun({p:{}}); // ok -obj_prop_fun({p:{q:null}}); // ok, provides add\'l lower bound +obj_prop_fun({p:{q:null}}); // ok, provides add'l lower bound -function obj_prop_var(o={p:{q:\"\"}}) { +function obj_prop_var(o={p:{q:\\"\\"}}) { var {p:{q=0}={q:true}} = o; // errors: // * number ~> void, from default on o.p.q @@ -78,9 +80,9 @@ function obj_prop_var(o={p:{q:\"\"}}) { obj_prop_var(); // ok obj_prop_var({}); // ok obj_prop_var({p:{}}); // ok -obj_prop_var({p:{q:null}}); // ok, provides add\'l lower bound +obj_prop_var({p:{q:null}}); // ok, provides add'l lower bound -function obj_rest({p:{q,...o}={q:0,r:0}}={p:{q:0,r:\"\"}}) { +function obj_rest({p:{q,...o}={q:0,r:0}}={p:{q:0,r:\\"\\"}}) { // errors: // * number ~> void, from default on _.p // * string ~> void, from default on _ @@ -136,7 +138,7 @@ function default_expr_scope({a, b = a}) {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -function obj_prop_fun({ p: { q = 0 } = { q: true } } = { p: { q: \"\" } }) { +function obj_prop_fun({ p: { q = 0 } = { q: true } } = { p: { q: \\"\\" } }) { // errors: // * number ~> void, from default on _.p.q // * boolean ~> void, from default on _.p @@ -147,9 +149,9 @@ function obj_prop_fun({ p: { q = 0 } = { q: true } } = { p: { q: \"\" } }) { obj_prop_fun(); // ok obj_prop_fun({}); // ok obj_prop_fun({ p: {} }); // ok -obj_prop_fun({ p: { q: null } }); // ok, provides add\'l lower bound +obj_prop_fun({ p: { q: null } }); // ok, provides add'l lower bound -function obj_prop_var(o = { p: { q: \"\" } }) { +function obj_prop_var(o = { p: { q: \\"\\" } }) { var { p: { q = 0 } = { q: true } } = o; // errors: // * number ~> void, from default on o.p.q @@ -161,10 +163,10 @@ function obj_prop_var(o = { p: { q: \"\" } }) { obj_prop_var(); // ok obj_prop_var({}); // ok obj_prop_var({ p: {} }); // ok -obj_prop_var({ p: { q: null } }); // ok, provides add\'l lower bound +obj_prop_var({ p: { q: null } }); // ok, provides add'l lower bound function obj_rest( - { p: { q, ...o } = { q: 0, r: 0 } } = { p: { q: 0, r: \"\" } } + { p: { q, ...o } = { q: 0, r: 0 } } = { p: { q: 0, r: \\"\\" } } ) { // errors: // * number ~> void, from default on _.p @@ -223,7 +225,7 @@ function default_expr_scope({ a, b = a }) {} " `; -exports[`test destructuring.js 1`] = ` +exports[`destructuring.js 1`] = ` "declare var a:string; declare var b:string; declare var c:string; @@ -234,7 +236,7 @@ var {m} = {m:0}; var obj; ({n: obj.x} = {n:3}); -[obj.x] = [\'foo\']; +[obj.x] = ['foo']; function foo({p, z:[r]}) { a = p; @@ -248,17 +250,17 @@ foo({p:0, z:[1,2]}); function bar({x, ...z}) { var o:{x: string; y: number;} = z; } -bar({x:\"\",y:0}); +bar({x:\\"\\",y:0}); -var spread = {y:\"\"}; +var spread = {y:\\"\\"}; var extend: {x:number; y:string; z: boolean} = {x:0, ...spread}; function qux(_: {a:number}) { } -qux({a:\"\"}); +qux({a:\\"\\"}); function corge({b}: {b:string}) { } corge({b:0}); -var {n}:{n: number} = {n: \"\"} +var {n}:{n: number} = {n: \\"\\"} function test() { var {foo} = {bar: 123}; // error on foo @@ -266,9 +268,9 @@ function test() { } function test() { - var x = {foo: \'abc\', bar: 123}; + var x = {foo: 'abc', bar: 123}; var {foo, ...rest} = x; - (x.baz: string); // error, baz doesn\'t exist + (x.baz: string); // error, baz doesn't exist (rest.baz: string); // no error, rest is unsealed } @@ -306,7 +308,7 @@ var { m } = { m: 0 }; var obj; ({ n: obj.x } = { n: 3 }); -[obj.x] = [\"foo\"]; +[obj.x] = [\\"foo\\"]; function foo({ p, z: [r] }) { a = p; @@ -320,17 +322,17 @@ foo({ p: 0, z: [1, 2] }); function bar({ x, ...z }) { var o: { x: string, y: number } = z; } -bar({ x: \"\", y: 0 }); +bar({ x: \\"\\", y: 0 }); -var spread = { y: \"\" }; +var spread = { y: \\"\\" }; var extend: { x: number, y: string, z: boolean } = { x: 0, ...spread }; function qux(_: { a: number }) {} -qux({ a: \"\" }); +qux({ a: \\"\\" }); function corge({ b }: { b: string }) {} corge({ b: 0 }); -var { n }: { n: number } = { n: \"\" }; +var { n }: { n: number } = { n: \\"\\" }; function test() { var { foo } = { bar: 123 }; // error on foo @@ -338,9 +340,9 @@ function test() { } function test() { - var x = { foo: \"abc\", bar: 123 }; + var x = { foo: \\"abc\\", bar: 123 }; var { foo, ...rest } = x; - (x.baz: string); // error, baz doesn\'t exist + (x.baz: string); // error, baz doesn't exist (rest.baz: string); // no error, rest is unsealed } @@ -370,12 +372,12 @@ var cp2_err: string = others.childprop2; // Error: number ~> string " `; -exports[`test destructuring_param.js 1`] = ` +exports[`destructuring_param.js 1`] = ` "function f(a, { b }) { return a + b; } -// Doesn\'t parse right now +// Doesn't parse right now // function g(a, { a }) { // return a; @@ -389,7 +391,7 @@ function f(a, { b }) { return a + b; } -// Doesn\'t parse right now +// Doesn't parse right now // function g(a, { a }) { // return a; @@ -401,7 +403,7 @@ function f(a, { b }) { " `; -exports[`test eager.js 1`] = ` +exports[`eager.js 1`] = ` "var x; ({x} = null); // error, property \`x\` can not be accessed on \`null\` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -410,7 +412,7 @@ var x; " `; -exports[`test poly.js 1`] = ` +exports[`poly.js 1`] = ` "// @flow function obj_pattern({ prop } : { prop: X }) {} // prop: X @@ -483,10 +485,10 @@ function arr_rest_pattern([_, ...a]: ArrRest) { " `; -exports[`test rec.js 1`] = ` +exports[`rec.js 1`] = ` "// @flow -// Make sure that destructuring doesn\'t cause infinite loops when combined with +// Make sure that destructuring doesn't cause infinite loops when combined with // funny doses of repositioning let foo = (i: number) => [i]; @@ -500,14 +502,14 @@ foo = (i: number) => { return bar(i); }; -// Also make sure that the following doesn\'t loop +// Also make sure that the following doesn't loop declare var o; var { x: o } = o; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -// Make sure that destructuring doesn\'t cause infinite loops when combined with +// Make sure that destructuring doesn't cause infinite loops when combined with // funny doses of repositioning let foo = (i: number) => [i]; @@ -521,33 +523,33 @@ foo = (i: number) => { return bar(i); }; -// Also make sure that the following doesn\'t loop +// Also make sure that the following doesn't loop declare var o; var { x: o } = o; " `; -exports[`test string_lit.js 1`] = ` -"var { \"key\": val } = { key: \"val\" }; +exports[`string_lit.js 1`] = ` +"var { \\"key\\": val } = { key: \\"val\\" }; (val: void); // error: string ~> void -var { \"with-dash\": with_dash } = { \"with-dash\": \"motivating example\" }; -(with_dash: \"motivating example\"); // ok +var { \\"with-dash\\": with_dash } = { \\"with-dash\\": \\"motivating example\\" }; +(with_dash: \\"motivating example\\"); // ok ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var { key: val } = { key: \"val\" }; +var { key: val } = { key: \\"val\\" }; (val: void); // error: string ~> void -var { \"with-dash\": with_dash } = { \"with-dash\": \"motivating example\" }; -(with_dash: \"motivating example\"); // ok +var { \\"with-dash\\": with_dash } = { \\"with-dash\\": \\"motivating example\\" }; +(with_dash: \\"motivating example\\"); // ok " `; -exports[`test unannotated.js 1`] = ` +exports[`unannotated.js 1`] = ` "// @flow var { x } = { - x: { foo: \"foo\" } + x: { foo: \\"foo\\" } }; function bar() { @@ -557,7 +559,7 @@ function bar() { // @flow var { x } = { - x: { foo: \"foo\" } + x: { foo: \\"foo\\" } }; function bar() { diff --git a/tests/flow/dictionary/__snapshots__/jsfmt.spec.js.snap b/tests/flow/dictionary/__snapshots__/jsfmt.spec.js.snap index 82cc9540c..e73ef3f1e 100644 --- a/tests/flow/dictionary/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/dictionary/__snapshots__/jsfmt.spec.js.snap @@ -1,32 +1,34 @@ -exports[`test any.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`any.js 1`] = ` "/* @flow */ const dict: {[key: string]: number} = {} -const k: any = \'foo\' +const k: any = 'foo' const val: string = dict[k] // error: number incompatible with string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ const dict: { [key: string]: number } = {}; -const k: any = \"foo\"; +const k: any = \\"foo\\"; const val: string = dict[k]; // error: number incompatible with string " `; -exports[`test compatible.js 1`] = ` +exports[`compatible.js 1`] = ` "/* @flow */ function foo0(x: Array<{[key: string]: mixed}>): Array<{[key: string]: mixed}> { // this adds a fooBar property to the param type, which should NOT cause // an error in the return type because it is a dictionary. - x[0].fooBar = \'foobar\'; + x[0].fooBar = 'foobar'; return x; } function foo2( x: {[key: string]: number} ): {[key: string]: number, +toString: () => string} { - // x\'s prototype has a toString method + // x's prototype has a toString method return x; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -37,20 +39,20 @@ function foo0( ): Array<{ [key: string]: mixed }> { // this adds a fooBar property to the param type, which should NOT cause // an error in the return type because it is a dictionary. - x[0].fooBar = \"foobar\"; + x[0].fooBar = \\"foobar\\"; return x; } function foo2( x: { [key: string]: number } ): { [key: string]: number, +toString: () => string } { - // x\'s prototype has a toString method + // x's prototype has a toString method return x; } " `; -exports[`test dictionary.js 1`] = ` +exports[`dictionary.js 1`] = ` "/* Dictionary types are object types that include an indexer, which specifies a * key type and a value type. The presence of an indexer makes the object type * unsealed, but all added properties must be consistent with the indexer @@ -60,7 +62,7 @@ exports[`test dictionary.js 1`] = ` * maps. They can also be used to represent array-like objects, e.g., NodeList * from the DOM API. * - * A dictionary is assumed to have every property described by it\'s key type. + * A dictionary is assumed to have every property described by it's key type. * This behavior is similar to the behavior of arrays, which are assumed to have * a value at every index. * @@ -80,17 +82,17 @@ class Y {} function set_prop_to_string_key( o: {[k:string]:any}, ) { - o.prop = \"ok\"; + o.prop = \\"ok\\"; } // **UNSOUND** -// This is allowed by design. We don\'t track get/set and we don\'t wrap the +// This is allowed by design. We don't track get/set and we don't wrap the // return type in a maybe. function unsound_dict_has_every_key( o: {[k:string]:X}, ) { (o.p: X); // ok - (o[\"p\"]: X); // ok + (o[\\"p\\"]: X); // ok } // As with any object type, we can assign subtypes to properties. @@ -102,7 +104,7 @@ function set_prop_covariant( o.p = new C; // ok } -// This isn\'t specific behavior to dictionaries, but for completeness... +// This isn't specific behavior to dictionaries, but for completeness... function get_prop_contravariant( o: {[k:string]:B}, ) { @@ -116,7 +118,7 @@ function get_prop_contravariant( function add_prop_to_nonstring_key_dot( o: {[k:number]:any}, ) { - o.prop = \"err\"; // error: string ~> number + o.prop = \\"err\\"; // error: string ~> number } // Bracket notation can be used to add properties to dictionaries with @@ -125,7 +127,7 @@ function add_prop_to_nonstring_key_dot( function add_prop_to_nonstring_key_bracket( o: {[k:number]:any}, ) { - o[0] = \"ok\"; + o[0] = \\"ok\\"; } // Objects can be part dict, part not by mixing an indexer with declared props. @@ -149,12 +151,12 @@ function object_prototype( } // **UNSOUND** -// Because we support non-string props w/ bracket notation, it\'s possible to +// Because we support non-string props w/ bracket notation, it's possible to // write into a declared prop unsoundly. function unsound_string_conversion_alias_declared_prop( - o: {[k:number]:any, \"0\":X}, + o: {[k:number]:any, \\"0\\":X}, ) { - o[0] = \"not-x\"; // a[\"0\"] no longer X + o[0] = \\"not-x\\"; // a[\\"0\\"] no longer X } function unification_dict_values_invariant( @@ -202,7 +204,7 @@ function subtype_dict_values_fresh_exception() { } // Actually, unsound_string_conversion_alias_declared_prop behavior makes an -// argument that we shouldn\'t really care about this, since we ignore the fact +// argument that we shouldn't really care about this, since we ignore the fact // that coercing values to string keys can cause unintended aliasing in general. // Barring some compelling use case for that in this context, though, we choose // to be strict. @@ -381,7 +383,7 @@ function subtype_optional_c_to_dict( * maps. They can also be used to represent array-like objects, e.g., NodeList * from the DOM API. * - * A dictionary is assumed to have every property described by it\'s key type. + * A dictionary is assumed to have every property described by it's key type. * This behavior is similar to the behavior of arrays, which are assumed to have * a value at every index. * @@ -399,15 +401,15 @@ class Y {} // Any property can be set on a dict with string keys. function set_prop_to_string_key(o: { [k: string]: any }) { - o.prop = \"ok\"; + o.prop = \\"ok\\"; } // **UNSOUND** -// This is allowed by design. We don\'t track get/set and we don\'t wrap the +// This is allowed by design. We don't track get/set and we don't wrap the // return type in a maybe. function unsound_dict_has_every_key(o: { [k: string]: X }) { (o.p: X); // ok - (o[\"p\"]: X); // ok + (o[\\"p\\"]: X); // ok } // As with any object type, we can assign subtypes to properties. @@ -417,7 +419,7 @@ function set_prop_covariant(o: { [k: string]: B }) { o.p = new C(); // ok } -// This isn\'t specific behavior to dictionaries, but for completeness... +// This isn't specific behavior to dictionaries, but for completeness... function get_prop_contravariant(o: { [k: string]: B }) { (o.p: A); // ok (o.p: B); // ok @@ -427,14 +429,14 @@ function get_prop_contravariant(o: { [k: string]: B }) { // Dot-notation can not be used to add properties to dictionaries with // non-string keys, because keys are strings. function add_prop_to_nonstring_key_dot(o: { [k: number]: any }) { - o.prop = \"err\"; // error: string ~> number + o.prop = \\"err\\"; // error: string ~> number } // Bracket notation can be used to add properties to dictionaries with // non-string keys, even though all keys are strings. This is a convenient // affordance. function add_prop_to_nonstring_key_bracket(o: { [k: number]: any }) { - o[0] = \"ok\"; + o[0] = \\"ok\\"; } // Objects can be part dict, part not by mixing an indexer with declared props. @@ -454,12 +456,12 @@ function object_prototype( } // **UNSOUND** -// Because we support non-string props w/ bracket notation, it\'s possible to +// Because we support non-string props w/ bracket notation, it's possible to // write into a declared prop unsoundly. function unsound_string_conversion_alias_declared_prop( - o: { [k: number]: any, \"0\": X } + o: { [k: number]: any, \\"0\\": X } ) { - o[0] = \"not-x\"; // a[\"0\"] no longer X + o[0] = \\"not-x\\"; // a[\\"0\\"] no longer X } function unification_dict_values_invariant(x: Array<{ [k: string]: B }>) { @@ -503,7 +505,7 @@ function subtype_dict_values_fresh_exception() { } // Actually, unsound_string_conversion_alias_declared_prop behavior makes an -// argument that we shouldn\'t really care about this, since we ignore the fact +// argument that we shouldn't really care about this, since we ignore the fact // that coercing values to string keys can cause unintended aliasing in general. // Barring some compelling use case for that in this context, though, we choose // to be strict. @@ -650,7 +652,7 @@ function subtype_optional_c_to_dict(x: { p?: C }): { [k: string]: B } { " `; -exports[`test incompatible.js 1`] = ` +exports[`incompatible.js 1`] = ` "/* @flow */ var x : {[key: string]: string} = {}; @@ -659,14 +661,14 @@ var z : {[key: number]: string} = x; // 2 errors, string !~> number & vice versa var a : {[key: string]: ?string} = {}; var b : {[key: string]: string} = a; // 2 errors (null & undefined) -var c : {[key: string]: ?string} = b; // 2 errors, since c[\'x\'] = null updates b +var c : {[key: string]: ?string} = b; // 2 errors, since c['x'] = null updates b // 2 errors (number !~> string, string !~> number) function foo0(x: Array<{[key: string]: number}>): Array<{[key: string]: string}> { return x; } -// error, fooBar:string !~> number (x\'s dictionary) +// error, fooBar:string !~> number (x's dictionary) function foo1( x: Array<{[key: string]: number}> ): Array<{[key: string]: number, fooBar: string}> { @@ -676,7 +678,7 @@ function foo1( function foo2( x: Array<{[key: string]: mixed}> ): Array<{[key: string]: mixed, fooBar: string}> { - x[0].fooBar = 123; // OK, since number ~> mixed (x elem\'s dictionary) + x[0].fooBar = 123; // OK, since number ~> mixed (x elem's dictionary) return x; // error: mixed ~> string } @@ -685,7 +687,7 @@ function foo3(x: {[key: string]: number}): {foo: number} { return x; } -// error: foo can\'t exist in x +// error: foo can't exist in x function foo4(x: {[key: string]: number}): {[key: string]: number, foo: string} { return x; } @@ -717,7 +719,7 @@ var z: { [key: number]: string } = x; // 2 errors, string !~> number & vice vers var a: { [key: string]: ?string } = {}; var b: { [key: string]: string } = a; // 2 errors (null & undefined) -var c: { [key: string]: ?string } = b; // 2 errors, since c[\'x\'] = null updates b +var c: { [key: string]: ?string } = b; // 2 errors, since c['x'] = null updates b // 2 errors (number !~> string, string !~> number) function foo0( @@ -726,7 +728,7 @@ function foo0( return x; } -// error, fooBar:string !~> number (x\'s dictionary) +// error, fooBar:string !~> number (x's dictionary) function foo1( x: Array<{ [key: string]: number }> ): Array<{ [key: string]: number, fooBar: string }> { @@ -736,7 +738,7 @@ function foo1( function foo2( x: Array<{ [key: string]: mixed }> ): Array<{ [key: string]: mixed, fooBar: string }> { - x[0].fooBar = 123; // OK, since number ~> mixed (x elem\'s dictionary) + x[0].fooBar = 123; // OK, since number ~> mixed (x elem's dictionary) return x; // error: mixed ~> string } @@ -745,7 +747,7 @@ function foo3(x: { [key: string]: number }): { foo: number } { return x; } -// error: foo can\'t exist in x +// error: foo can't exist in x function foo4( x: { [key: string]: number } ): { [key: string]: number, foo: string } { @@ -773,7 +775,7 @@ function foo8(x: { [key: string]: number }) { " `; -exports[`test issue-1745.js 1`] = ` +exports[`issue-1745.js 1`] = ` "/* @flow */ class A { @@ -828,7 +830,7 @@ class B { " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "type Params = {count: number; [name: string]: string}; type QueryFunction = (params: Params) => string; @@ -853,14 +855,14 @@ module.exports = o; " `; -exports[`test test_client.js 1`] = ` -"var o = require(\'./test\'); +exports[`test_client.js 1`] = ` +"var o = require('./test'); o.foo = function (params) { return params.count; // error, number ~/~ string } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var o = require(\"./test\"); +var o = require(\\"./test\\"); o.foo = function(params) { return params.count; // error, number ~/~ string diff --git a/tests/flow/disjoint-union-perf/__snapshots__/jsfmt.spec.js.snap b/tests/flow/disjoint-union-perf/__snapshots__/jsfmt.spec.js.snap index c830a4f52..0c9fdedde 100644 --- a/tests/flow/disjoint-union-perf/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/disjoint-union-perf/__snapshots__/jsfmt.spec.js.snap @@ -1,16 +1,18 @@ -exports[`test ast.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ast.js 1`] = ` "/** * @flow */ export type InferredType = - | \'unknown\' - | \'gender\' - | \'enum\' - | \'number-or-string\' - | \'number\' - | \'string\' - | \'error\' + | 'unknown' + | 'gender' + | 'enum' + | 'number-or-string' + | 'number' + | 'string' + | 'error' ; export type Pos = { @@ -21,8 +23,8 @@ export type Pos = { }; export type TypedBinaryOpNode = { - exprNodeType: \'binary_op\', - binaryOp: \'plus\' | \'multiply\' | \'divide\' | \'minus\', + exprNodeType: 'binary_op', + binaryOp: 'plus' | 'multiply' | 'divide' | 'minus', lhs: TypedNode, rhs: TypedNode, pos: Pos, @@ -31,7 +33,7 @@ export type TypedBinaryOpNode = { } export type TypedUnaryMinusNode = { - exprNodeType: \'unary_minus\', + exprNodeType: 'unary_minus', op: TypedNode, pos: Pos, exprType: InferredType, @@ -39,23 +41,23 @@ export type TypedUnaryMinusNode = { } export type TypedNumberNode = { - exprNodeType: \'number\', + exprNodeType: 'number', value: number, pos: Pos, - exprType: \'number\', + exprType: 'number', typed: true, } export type TypedStringLiteralNode = { - exprNodeType: \'string_literal\', + exprNodeType: 'string_literal', value: string, pos: Pos, - exprType: \'string\', + exprType: 'string', typed: true, } export type TypedVariableNode = { - exprNodeType: \'variable\', + exprNodeType: 'variable', name: string, pos: Pos, exprType: InferredType, @@ -63,11 +65,11 @@ export type TypedVariableNode = { }; export type TypedFunctionInvocationNode = { - exprNodeType: \'function_invocation\', + exprNodeType: 'function_invocation', name: string, parameters: TypedNode[], pos: Pos, - exprType: \'error\' | \'string\', + exprType: 'error' | 'string', typed: true, } @@ -85,13 +87,13 @@ export type TypedNode = */ export type InferredType = - | \"unknown\" - | \"gender\" - | \"enum\" - | \"number-or-string\" - | \"number\" - | \"string\" - | \"error\"; + | \\"unknown\\" + | \\"gender\\" + | \\"enum\\" + | \\"number-or-string\\" + | \\"number\\" + | \\"string\\" + | \\"error\\"; export type Pos = { firstLine: number, @@ -101,8 +103,8 @@ export type Pos = { }; export type TypedBinaryOpNode = { - exprNodeType: \"binary_op\", - binaryOp: \"plus\" | \"multiply\" | \"divide\" | \"minus\", + exprNodeType: \\"binary_op\\", + binaryOp: \\"plus\\" | \\"multiply\\" | \\"divide\\" | \\"minus\\", lhs: TypedNode, rhs: TypedNode, pos: Pos, @@ -111,7 +113,7 @@ export type TypedBinaryOpNode = { }; export type TypedUnaryMinusNode = { - exprNodeType: \"unary_minus\", + exprNodeType: \\"unary_minus\\", op: TypedNode, pos: Pos, exprType: InferredType, @@ -119,23 +121,23 @@ export type TypedUnaryMinusNode = { }; export type TypedNumberNode = { - exprNodeType: \"number\", + exprNodeType: \\"number\\", value: number, pos: Pos, - exprType: \"number\", + exprType: \\"number\\", typed: true }; export type TypedStringLiteralNode = { - exprNodeType: \"string_literal\", + exprNodeType: \\"string_literal\\", value: string, pos: Pos, - exprType: \"string\", + exprType: \\"string\\", typed: true }; export type TypedVariableNode = { - exprNodeType: \"variable\", + exprNodeType: \\"variable\\", name: string, pos: Pos, exprType: InferredType, @@ -143,11 +145,11 @@ export type TypedVariableNode = { }; export type TypedFunctionInvocationNode = { - exprNodeType: \"function_invocation\", + exprNodeType: \\"function_invocation\\", name: string, parameters: TypedNode[], pos: Pos, - exprType: \"error\" | \"string\", + exprType: \\"error\\" | \\"string\\", typed: true }; @@ -161,58 +163,58 @@ export type TypedNode = " `; -exports[`test emit.js 1`] = ` +exports[`emit.js 1`] = ` "/** * @flow */ -import * as t from \'./jsAst\'; +import * as t from './jsAst'; const b = t.builders; import type { TypedNode -} from \'./ast\'; +} from './ast'; -function getBinaryOp(op: \'plus\' | \'minus\' | \'divide\' | \'multiply\') : \'+\' | \'-\' | \'*\' | \'/\' { +function getBinaryOp(op: 'plus' | 'minus' | 'divide' | 'multiply') : '+' | '-' | '*' | '/' { switch (op) { - case \'plus\': - return \'+\'; - case \'minus\': - return \'-\'; - case \'divide\': - return \'/\'; - case \'multiply\': - return \'*\'; + case 'plus': + return '+'; + case 'minus': + return '-'; + case 'divide': + return '/'; + case 'multiply': + return '*'; default: - throw new Error(\'Invalid binary operator: \' + op); + throw new Error('Invalid binary operator: ' + op); } } export function emitExpression(node: TypedNode) : t.Expression { switch (node.exprNodeType) { - case \'string_literal\': // FALLTHROUGH - case \'number\': + case 'string_literal': // FALLTHROUGH + case 'number': return b.literal(node.value); - case \'variable\': + case 'variable': return b.memberExpression( - b.identifier(\'vars\'), + b.identifier('vars'), b.identifier(node.name), false ); - case \'binary_op\': { + case 'binary_op': { const lhs = emitExpression(node.lhs); const rhs = emitExpression(node.rhs); const op = getBinaryOp(node.binaryOp); return b.binaryExpression(op, lhs, rhs); } - case \'unary_minus\': { + case 'unary_minus': { const operand = emitExpression(node.op); - return b.unaryExpression(\'-\', operand, true); + return b.unaryExpression('-', operand, true); } - case \'function_invocation\': { + case 'function_invocation': { const callee = b.memberExpression( - b.identifier(\'fns\'), + b.identifier('fns'), b.identifier(node.name), false ); @@ -224,61 +226,61 @@ export function emitExpression(node: TypedNode) : t.Expression { return b.callExpression(callee, args); } default: - throw new Error(\'Unknown expression type: \' + node.type); + throw new Error('Unknown expression type: ' + node.type); } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow */ -import * as t from \"./jsAst\"; +import * as t from \\"./jsAst\\"; const b = t.builders; -import type { TypedNode } from \"./ast\"; +import type { TypedNode } from \\"./ast\\"; function getBinaryOp( - op: \"plus\" | \"minus\" | \"divide\" | \"multiply\" -): \"+\" | \"-\" | \"*\" | \"/\" { + op: \\"plus\\" | \\"minus\\" | \\"divide\\" | \\"multiply\\" +): \\"+\\" | \\"-\\" | \\"*\\" | \\"/\\" { switch (op) { - case \"plus\": - return \"+\"; - case \"minus\": - return \"-\"; - case \"divide\": - return \"/\"; - case \"multiply\": - return \"*\"; + case \\"plus\\": + return \\"+\\"; + case \\"minus\\": + return \\"-\\"; + case \\"divide\\": + return \\"/\\"; + case \\"multiply\\": + return \\"*\\"; default: - throw new Error(\"Invalid binary operator: \" + op); + throw new Error(\\"Invalid binary operator: \\" + op); } } export function emitExpression(node: TypedNode): t.Expression { switch (node.exprNodeType) { - case \"string_literal\": // FALLTHROUGH - case \"number\": + case \\"string_literal\\": // FALLTHROUGH + case \\"number\\": return b.literal(node.value); - case \"variable\": + case \\"variable\\": return b.memberExpression( - b.identifier(\"vars\"), + b.identifier(\\"vars\\"), b.identifier(node.name), false ); - case \"binary_op\": { + case \\"binary_op\\": { const lhs = emitExpression(node.lhs); const rhs = emitExpression(node.rhs); const op = getBinaryOp(node.binaryOp); return b.binaryExpression(op, lhs, rhs); } - case \"unary_minus\": { + case \\"unary_minus\\": { const operand = emitExpression(node.op); - return b.unaryExpression(\"-\", operand, true); + return b.unaryExpression(\\"-\\", operand, true); } - case \"function_invocation\": { + case \\"function_invocation\\": { const callee = b.memberExpression( - b.identifier(\"fns\"), + b.identifier(\\"fns\\"), b.identifier(node.name), false ); @@ -288,13 +290,13 @@ export function emitExpression(node: TypedNode): t.Expression { return b.callExpression(callee, args); } default: - throw new Error(\"Unknown expression type: \" + node.type); + throw new Error(\\"Unknown expression type: \\" + node.type); } } " `; -exports[`test jsAst.js 1`] = ` +exports[`jsAst.js 1`] = ` "/** * @flow */ @@ -321,7 +323,7 @@ export type File = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'File\', + type: 'File', program: Program, } @@ -330,68 +332,68 @@ export type Program = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'Program\', + type: 'Program', body: Statement[], } export type BinaryOperator = - |\'==\' - | \'!=\' - | \'===\' - | \'!==\' - | \'<\' - | \'<=\' - | \'>\' - | \'>=\' - | \'<<\' - | \'>>\' - | \'>>>\' - | \'+\' - | \'-\' - | \'*\' - | \'/\' - | \'%\' - | \'&\' // TODO Missing from the Parser API. - | \'|\' - | \'^\' - | \'in\' - | \'instanceof\' - | \'..\' + |'==' + | '!=' + | '===' + | '!==' + | '<' + | '<=' + | '>' + | '>=' + | '<<' + | '>>' + | '>>>' + | '+' + | '-' + | '*' + | '/' + | '%' + | '&' // TODO Missing from the Parser API. + | '|' + | '^' + | 'in' + | 'instanceof' + | '..' ; export type UnaryOperator = - | \'-\' - | \'+\' - | \'!\' - | \'~\' - | \'typeof\' - | \'void\' - | \'delete\' + | '-' + | '+' + | '!' + | '~' + | 'typeof' + | 'void' + | 'delete' ; export type AssignmentOperator = - | \'=\' - | \'+=\' - | \'-=\' - | \'*=\' - | \'/=\' - | \'%=\' - | \'<<=\' - | \'>>=\' - | \'>>>=\' - | \'|=\' - | \'^=\' - | \'&=\' + | '=' + | '+=' + | '-=' + | '*=' + | '/=' + | '%=' + | '<<=' + | '>>=' + | '>>>=' + | '|=' + | '^=' + | '&=' ; export type UpdateOperator = - | \'++\' - | \'--\' + | '++' + | '--' ; export type LogicalOperator = - | \'&&\' - | \'||\' + | '&&' + | '||' ; export type Node = @@ -450,7 +452,7 @@ export type EmptyStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'EmptyStatement\', + type: 'EmptyStatement', } export type BlockStatement = { @@ -458,7 +460,7 @@ export type BlockStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'BlockStatement\', + type: 'BlockStatement', body: Statement[], } @@ -467,7 +469,7 @@ export type ExpressionStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'ExpressionStatement\', + type: 'ExpressionStatement', expression: Expression, } @@ -476,7 +478,7 @@ export type IfStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'IfStatement\', + type: 'IfStatement', test: Expression, consequent: Statement, alternate: ?Statement, @@ -487,7 +489,7 @@ export type BreakStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'BreakStatement\', + type: 'BreakStatement', label: ?Identifier, } @@ -496,7 +498,7 @@ export type ContinueStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'ContinueStatement\', + type: 'ContinueStatement', label: ?Identifier, } @@ -505,7 +507,7 @@ export type ReturnStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'ReturnStatement\', + type: 'ReturnStatement', argument: ?Expression, } @@ -514,7 +516,7 @@ export type ThrowStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'ThrowStatement\', + type: 'ThrowStatement', argument: ?Expression, } @@ -523,7 +525,7 @@ export type WhileStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'WhileStatement\', + type: 'WhileStatement', test: Expression, body: Statement, } @@ -533,7 +535,7 @@ export type ForStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'ForStatement\', + type: 'ForStatement', init: ?(VariableDeclaration | Expression), test: ?Expression, update: ?Expression, @@ -545,7 +547,7 @@ export type ForInStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'ForInStatement\', + type: 'ForInStatement', left: VariableDeclaration | Expression, right: Expression, body: Statement, @@ -556,7 +558,7 @@ export type TryStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'TryStatement\', + type: 'TryStatement', block: BlockStatement, handler: ?CatchClause, handlers: CatchClause[], @@ -568,7 +570,7 @@ export type CatchClause = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'CatchClause\', + type: 'CatchClause', param: Pattern, guard: ?Expression, body: BlockStatement, @@ -597,7 +599,7 @@ export type Identifier = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'Identifier\', + type: 'Identifier', name: string, } @@ -606,7 +608,7 @@ export type Literal = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'Literal\', + type: 'Literal', value: ?(string | boolean | number | RegExp), regex: ?{ pattern: string, flags: string }, } @@ -616,7 +618,7 @@ export type ThisExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'ThisExpression\', + type: 'ThisExpression', } export type ArrayExpression = { @@ -624,7 +626,7 @@ export type ArrayExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'ArrayExpression\', + type: 'ArrayExpression', elements: Expression[], } @@ -633,7 +635,7 @@ export type ObjectExpreession = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'ObjectExpression\', + type: 'ObjectExpression', properties: Property[], } @@ -642,8 +644,8 @@ export type Property = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'Property\', - kind: \'init\' | \'get\' | \'set\', + type: 'Property', + kind: 'init' | 'get' | 'set', key: Literal | Identifier, value: Expression, }; @@ -653,7 +655,7 @@ export type FunctionExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'FunctionExpression\', + type: 'FunctionExpression', id: ?Identifier, params: Pattern[], body: BlockStatement, @@ -664,7 +666,7 @@ export type BinaryExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'BinaryExpression\', + type: 'BinaryExpression', operator: BinaryOperator, left: Expression, right: Expression, @@ -675,7 +677,7 @@ export type UnaryExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'UnaryExpression\', + type: 'UnaryExpression', operator: UnaryOperator, argument: Expression, prefix: boolean, @@ -686,7 +688,7 @@ export type AssignmentExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'AssignmentExpression\', + type: 'AssignmentExpression', operator: AssignmentOperator, left: Pattern, right: Expression, @@ -697,7 +699,7 @@ export type UpdateExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'UpdateExpression\', + type: 'UpdateExpression', operator: UpdateOperator, argument: Expression, prefix: boolean, @@ -708,7 +710,7 @@ export type LogicalExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'LogicalExpression\', + type: 'LogicalExpression', operator: LogicalOperator, left: Expression, right: Expression, @@ -719,7 +721,7 @@ export type ConditionalExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'ConditionalExpression\', + type: 'ConditionalExpression', test: Expression, consequent: Expression, alternate: Expression, @@ -730,7 +732,7 @@ export type NewExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'NewExpression\', + type: 'NewExpression', callee: Expression, arguments: Expression[], }; @@ -740,7 +742,7 @@ export type CallExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'CallExpression\', + type: 'CallExpression', callee: Expression, arguments: Expression[], }; @@ -750,7 +752,7 @@ export type MemberExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'MemberExpression\', + type: 'MemberExpression', object: Expression, property: Identifier | Expression, computed: bool, @@ -771,8 +773,8 @@ export type VariableDeclaration = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'VariableDeclaration\', - kind: \'var\' | \'let\' | \'const\', + type: 'VariableDeclaration', + kind: 'var' | 'let' | 'const', declarations: VariableDeclarator[], } @@ -781,7 +783,7 @@ export type FunctionDeclaration = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'FunctionDeclaration\', + type: 'FunctionDeclaration', id: Identifier, body: BlockStatement, params: Pattern[], @@ -792,7 +794,7 @@ export type VariableDeclarator = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \'VariableDeclarator\', + type: 'VariableDeclarator', id: Pattern, init: ?Expression, } @@ -865,7 +867,7 @@ export const builders : { properties: Property[] ) : ObjectExpreession, property( - kind: \'init\' | \'get\' | \'set\', + kind: 'init' | 'get' | 'set', key: Literal | Identifier, value: Expression ) : Property, @@ -918,7 +920,7 @@ export const builders : { computed: bool ) : MemberExpression, variableDeclaration( - kind: \'var\' | \'let\' | \'const\', + kind: 'var' | 'let' | 'const', declarations: VariableDeclarator[] ) : VariableDeclaration, functionDeclaration( @@ -958,7 +960,7 @@ export type File = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"File\", + type: \\"File\\", program: Program }; @@ -967,60 +969,60 @@ export type Program = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"Program\", + type: \\"Program\\", body: Statement[] }; export type BinaryOperator = - | \"==\" - | \"!=\" - | \"===\" - | \"!==\" - | \"<\" - | \"<=\" - | \">\" - | \">=\" - | \"<<\" - | \">>\" - | \">>>\" - | \"+\" - | \"-\" - | \"*\" - | \"/\" - | \"%\" - | \"&\" /* TODO Missing from the Parser API.*/ - | \"|\" - | \"^\" - | \"in\" - | \"instanceof\" - | \"..\"; + | \\"==\\" + | \\"!=\\" + | \\"===\\" + | \\"!==\\" + | \\"<\\" + | \\"<=\\" + | \\">\\" + | \\">=\\" + | \\"<<\\" + | \\">>\\" + | \\">>>\\" + | \\"+\\" + | \\"-\\" + | \\"*\\" + | \\"/\\" + | \\"%\\" + | \\"&\\" /* TODO Missing from the Parser API.*/ + | \\"|\\" + | \\"^\\" + | \\"in\\" + | \\"instanceof\\" + | \\"..\\"; export type UnaryOperator = - | \"-\" - | \"+\" - | \"!\" - | \"~\" - | \"typeof\" - | \"void\" - | \"delete\"; + | \\"-\\" + | \\"+\\" + | \\"!\\" + | \\"~\\" + | \\"typeof\\" + | \\"void\\" + | \\"delete\\"; export type AssignmentOperator = - | \"=\" - | \"+=\" - | \"-=\" - | \"*=\" - | \"/=\" - | \"%=\" - | \"<<=\" - | \">>=\" - | \">>>=\" - | \"|=\" - | \"^=\" - | \"&=\"; + | \\"=\\" + | \\"+=\\" + | \\"-=\\" + | \\"*=\\" + | \\"/=\\" + | \\"%=\\" + | \\"<<=\\" + | \\">>=\\" + | \\">>>=\\" + | \\"|=\\" + | \\"^=\\" + | \\"&=\\"; -export type UpdateOperator = \"++\" | \"--\"; +export type UpdateOperator = \\"++\\" | \\"--\\"; -export type LogicalOperator = \"&&\" | \"||\"; +export type LogicalOperator = \\"&&\\" | \\"||\\"; export type Node = | EmptyStatement @@ -1076,7 +1078,7 @@ export type EmptyStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"EmptyStatement\" + type: \\"EmptyStatement\\" }; export type BlockStatement = { @@ -1084,7 +1086,7 @@ export type BlockStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"BlockStatement\", + type: \\"BlockStatement\\", body: Statement[] }; @@ -1093,7 +1095,7 @@ export type ExpressionStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"ExpressionStatement\", + type: \\"ExpressionStatement\\", expression: Expression }; @@ -1102,7 +1104,7 @@ export type IfStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"IfStatement\", + type: \\"IfStatement\\", test: Expression, consequent: Statement, alternate: ?Statement @@ -1113,7 +1115,7 @@ export type BreakStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"BreakStatement\", + type: \\"BreakStatement\\", label: ?Identifier }; @@ -1122,7 +1124,7 @@ export type ContinueStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"ContinueStatement\", + type: \\"ContinueStatement\\", label: ?Identifier }; @@ -1131,7 +1133,7 @@ export type ReturnStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"ReturnStatement\", + type: \\"ReturnStatement\\", argument: ?Expression }; @@ -1140,7 +1142,7 @@ export type ThrowStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"ThrowStatement\", + type: \\"ThrowStatement\\", argument: ?Expression }; @@ -1149,7 +1151,7 @@ export type WhileStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"WhileStatement\", + type: \\"WhileStatement\\", test: Expression, body: Statement }; @@ -1159,7 +1161,7 @@ export type ForStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"ForStatement\", + type: \\"ForStatement\\", init: ?(VariableDeclaration | Expression), test: ?Expression, update: ?Expression, @@ -1171,7 +1173,7 @@ export type ForInStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"ForInStatement\", + type: \\"ForInStatement\\", left: VariableDeclaration | Expression, right: Expression, body: Statement @@ -1182,7 +1184,7 @@ export type TryStatement = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"TryStatement\", + type: \\"TryStatement\\", block: BlockStatement, handler: ?CatchClause, handlers: CatchClause[], @@ -1194,7 +1196,7 @@ export type CatchClause = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"CatchClause\", + type: \\"CatchClause\\", param: Pattern, guard: ?Expression, body: BlockStatement @@ -1222,7 +1224,7 @@ export type Identifier = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"Identifier\", + type: \\"Identifier\\", name: string }; @@ -1231,7 +1233,7 @@ export type Literal = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"Literal\", + type: \\"Literal\\", value: ?(string | boolean | number | RegExp), regex: ?{ pattern: string, flags: string } }; @@ -1241,7 +1243,7 @@ export type ThisExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"ThisExpression\" + type: \\"ThisExpression\\" }; export type ArrayExpression = { @@ -1249,7 +1251,7 @@ export type ArrayExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"ArrayExpression\", + type: \\"ArrayExpression\\", elements: Expression[] }; @@ -1258,7 +1260,7 @@ export type ObjectExpreession = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"ObjectExpression\", + type: \\"ObjectExpression\\", properties: Property[] }; @@ -1267,8 +1269,8 @@ export type Property = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"Property\", - kind: \"init\" | \"get\" | \"set\", + type: \\"Property\\", + kind: \\"init\\" | \\"get\\" | \\"set\\", key: Literal | Identifier, value: Expression }; @@ -1278,7 +1280,7 @@ export type FunctionExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"FunctionExpression\", + type: \\"FunctionExpression\\", id: ?Identifier, params: Pattern[], body: BlockStatement @@ -1289,7 +1291,7 @@ export type BinaryExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"BinaryExpression\", + type: \\"BinaryExpression\\", operator: BinaryOperator, left: Expression, right: Expression @@ -1300,7 +1302,7 @@ export type UnaryExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"UnaryExpression\", + type: \\"UnaryExpression\\", operator: UnaryOperator, argument: Expression, prefix: boolean @@ -1311,7 +1313,7 @@ export type AssignmentExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"AssignmentExpression\", + type: \\"AssignmentExpression\\", operator: AssignmentOperator, left: Pattern, right: Expression @@ -1322,7 +1324,7 @@ export type UpdateExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"UpdateExpression\", + type: \\"UpdateExpression\\", operator: UpdateOperator, argument: Expression, prefix: boolean @@ -1333,7 +1335,7 @@ export type LogicalExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"LogicalExpression\", + type: \\"LogicalExpression\\", operator: LogicalOperator, left: Expression, right: Expression @@ -1344,7 +1346,7 @@ export type ConditionalExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"ConditionalExpression\", + type: \\"ConditionalExpression\\", test: Expression, consequent: Expression, alternate: Expression @@ -1355,7 +1357,7 @@ export type NewExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"NewExpression\", + type: \\"NewExpression\\", callee: Expression, arguments: Expression[] }; @@ -1365,7 +1367,7 @@ export type CallExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"CallExpression\", + type: \\"CallExpression\\", callee: Expression, arguments: Expression[] }; @@ -1375,7 +1377,7 @@ export type MemberExpression = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"MemberExpression\", + type: \\"MemberExpression\\", object: Expression, property: Identifier | Expression, computed: boolean @@ -1391,8 +1393,8 @@ export type VariableDeclaration = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"VariableDeclaration\", - kind: \"var\" | \"let\" | \"const\", + type: \\"VariableDeclaration\\", + kind: \\"var\\" | \\"let\\" | \\"const\\", declarations: VariableDeclarator[] }; @@ -1401,7 +1403,7 @@ export type FunctionDeclaration = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"FunctionDeclaration\", + type: \\"FunctionDeclaration\\", id: Identifier, body: BlockStatement, params: Pattern[] @@ -1412,7 +1414,7 @@ export type VariableDeclarator = { start: SourcePosition, end: SourcePosition, comments: ?Array, - type: \"VariableDeclarator\", + type: \\"VariableDeclarator\\", id: Pattern, init: ?Expression }; @@ -1464,7 +1466,7 @@ export const builders: { arrayExpression(elements: Expression[]): ArrayExpression, objectExpreession(properties: Property[]): ObjectExpreession, property( - kind: \"init\" | \"get\" | \"set\", + kind: \\"init\\" | \\"get\\" | \\"set\\", key: Literal | Identifier, value: Expression ): Property, @@ -1511,7 +1513,7 @@ export const builders: { computed: boolean ): MemberExpression, variableDeclaration( - kind: \"var\" | \"let\" | \"const\", + kind: \\"var\\" | \\"let\\" | \\"const\\", declarations: VariableDeclarator[] ): VariableDeclaration, functionDeclaration( diff --git a/tests/flow/docblock_flow/__snapshots__/jsfmt.spec.js.snap b/tests/flow/docblock_flow/__snapshots__/jsfmt.spec.js.snap index af6a16406..c8eff340b 100644 --- a/tests/flow/docblock_flow/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/docblock_flow/__snapshots__/jsfmt.spec.js.snap @@ -1,17 +1,19 @@ -exports[`test license_with_flow.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`license_with_flow.js 1`] = ` "/* Copyright example */ /* @flow */ -(\"\": void); // error +(\\"\\": void); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* Copyright example */ /* @flow */ -(\"\": void); // error +(\\"\\": void); // error " `; -exports[`test max_header_tokens.js 1`] = ` +exports[`max_header_tokens.js 1`] = ` "/* @flow */ /* second token */ /* third token */ @@ -32,7 +34,7 @@ exports[`test max_header_tokens.js 1`] = ` " `; -exports[`test multiple_flows_1.js 1`] = ` +exports[`multiple_flows_1.js 1`] = ` "/* @flow */ /* @flow */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -41,7 +43,7 @@ exports[`test multiple_flows_1.js 1`] = ` " `; -exports[`test multiple_flows_2.js 1`] = ` +exports[`multiple_flows_2.js 1`] = ` "/** * @flow * @noflow @@ -54,7 +56,7 @@ exports[`test multiple_flows_2.js 1`] = ` " `; -exports[`test multiple_providesModule_1.js 1`] = ` +exports[`multiple_providesModule_1.js 1`] = ` "/** * @providesModule Foo * @providesModule Bar @@ -69,7 +71,7 @@ exports[`test multiple_providesModule_1.js 1`] = ` " `; -exports[`test multiple_providesModule_2.js 1`] = ` +exports[`multiple_providesModule_2.js 1`] = ` "/** * @providesModule Foo * @flow @@ -88,37 +90,37 @@ exports[`test multiple_providesModule_2.js 1`] = ` " `; -exports[`test use_strict_with_flow.js 1`] = ` -"\"use strict\"; +exports[`use_strict_with_flow.js 1`] = ` +"\\"use strict\\"; /* @flow */ -(\"\": void); // error +(\\"\\": void); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use strict\"; +\\"use strict\\"; /* @flow */ -(\"\": void); // error +(\\"\\": void); // error " `; -exports[`test with_flow.js 1`] = ` +exports[`with_flow.js 1`] = ` "/* @flow */ -(\"\": void); // error +(\\"\\": void); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -(\"\": void); // error +(\\"\\": void); // error " `; -exports[`test without_flow.js 1`] = ` +exports[`without_flow.js 1`] = ` "/* some other comment */ -(\"\": void); // no error +(\\"\\": void); // no error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* some other comment */ -(\"\": void); // no error +(\\"\\": void); // no error " `; diff --git a/tests/flow/dom/__snapshots__/jsfmt.spec.js.snap b/tests/flow/dom/__snapshots__/jsfmt.spec.js.snap index 2ed4d1546..8376fc12f 100644 --- a/tests/flow/dom/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/dom/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test CanvasRenderingContext2D.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CanvasRenderingContext2D.js 1`] = ` "// @flow let tests = [ @@ -9,7 +11,7 @@ let tests = [ // moveTo function(ctx: CanvasRenderingContext2D) { - ctx.moveTo(\'0\', \'1\'); // error: should be numbers + ctx.moveTo('0', '1'); // error: should be numbers }, ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -23,20 +25,20 @@ let tests = [ // moveTo function(ctx: CanvasRenderingContext2D) { - ctx.moveTo(\"0\", \"1\"); // error: should be numbers + ctx.moveTo(\\"0\\", \\"1\\"); // error: should be numbers } ]; " `; -exports[`test CustomEvent.js 1`] = ` +exports[`CustomEvent.js 1`] = ` "// @flow let tests = [ // CustomEvent function(document: Document) { - const event = document.createEvent(\'CustomEvent\'); - event.initCustomEvent(\'butts\', true, false, { nice: 42 }); + const event = document.createEvent('CustomEvent'); + event.initCustomEvent('butts', true, false, { nice: 42 }); } ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -45,23 +47,23 @@ let tests = [ let tests = [ // CustomEvent function(document: Document) { - const event = document.createEvent(\"CustomEvent\"); - event.initCustomEvent(\"butts\", true, false, { nice: 42 }); + const event = document.createEvent(\\"CustomEvent\\"); + event.initCustomEvent(\\"butts\\", true, false, { nice: 42 }); } ]; " `; -exports[`test Document.js 1`] = ` +exports[`Document.js 1`] = ` "// @flow let tests = [ // createElement function(document: Document) { - (document.createElement(\'canvas\'): HTMLCanvasElement); - (document.createElement(\'link\'): HTMLLinkElement); - (document.createElement(\'option\'): HTMLOptionElement); - (document.createElement(\'select\'): HTMLSelectElement); + (document.createElement('canvas'): HTMLCanvasElement); + (document.createElement('link'): HTMLLinkElement); + (document.createElement('option'): HTMLOptionElement); + (document.createElement('select'): HTMLSelectElement); } ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -70,16 +72,16 @@ let tests = [ let tests = [ // createElement function(document: Document) { - (document.createElement(\"canvas\"): HTMLCanvasElement); - (document.createElement(\"link\"): HTMLLinkElement); - (document.createElement(\"option\"): HTMLOptionElement); - (document.createElement(\"select\"): HTMLSelectElement); + (document.createElement(\\"canvas\\"): HTMLCanvasElement); + (document.createElement(\\"link\\"): HTMLLinkElement); + (document.createElement(\\"option\\"): HTMLOptionElement); + (document.createElement(\\"select\\"): HTMLSelectElement); } ]; " `; -exports[`test Element.js 1`] = ` +exports[`Element.js 1`] = ` "// @flow let tests = [ @@ -88,13 +90,13 @@ let tests = [ element.scrollIntoView(); element.scrollIntoView(false); element.scrollIntoView({}); - element.scrollIntoView({ behavior: \'smooth\', block: \'end\' }); - element.scrollIntoView({ block: \'end\' }); - element.scrollIntoView({ behavior: \'smooth\' }); + element.scrollIntoView({ behavior: 'smooth', block: 'end' }); + element.scrollIntoView({ block: 'end' }); + element.scrollIntoView({ behavior: 'smooth' }); // fails - element.scrollIntoView({ behavior: \'invalid\' }); - element.scrollIntoView({ block: \'invalid\' }); + element.scrollIntoView({ behavior: 'invalid' }); + element.scrollIntoView({ block: 'invalid' }); element.scrollIntoView(1); } ]; @@ -107,26 +109,26 @@ let tests = [ element.scrollIntoView(); element.scrollIntoView(false); element.scrollIntoView({}); - element.scrollIntoView({ behavior: \"smooth\", block: \"end\" }); - element.scrollIntoView({ block: \"end\" }); - element.scrollIntoView({ behavior: \"smooth\" }); + element.scrollIntoView({ behavior: \\"smooth\\", block: \\"end\\" }); + element.scrollIntoView({ block: \\"end\\" }); + element.scrollIntoView({ behavior: \\"smooth\\" }); // fails - element.scrollIntoView({ behavior: \"invalid\" }); - element.scrollIntoView({ block: \"invalid\" }); + element.scrollIntoView({ behavior: \\"invalid\\" }); + element.scrollIntoView({ block: \\"invalid\\" }); element.scrollIntoView(1); } ]; " `; -exports[`test HTMLCanvasElement.js 1`] = ` +exports[`HTMLCanvasElement.js 1`] = ` "// @flow let tests = [ // getContext function(el: HTMLCanvasElement) { - (el.getContext(\'2d\'): ?CanvasRenderingContext2D); + (el.getContext('2d'): ?CanvasRenderingContext2D); } ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -135,13 +137,13 @@ let tests = [ let tests = [ // getContext function(el: HTMLCanvasElement) { - (el.getContext(\"2d\"): ?CanvasRenderingContext2D); + (el.getContext(\\"2d\\"): ?CanvasRenderingContext2D); } ]; " `; -exports[`test HTMLElement.js 1`] = ` +exports[`HTMLElement.js 1`] = ` "// @flow let tests = [ @@ -150,13 +152,13 @@ let tests = [ element.scrollIntoView(); element.scrollIntoView(false); element.scrollIntoView({}); - element.scrollIntoView({ behavior: \'smooth\', block: \'end\' }); - element.scrollIntoView({ block: \'end\' }); - element.scrollIntoView({ behavior: \'smooth\' }); + element.scrollIntoView({ behavior: 'smooth', block: 'end' }); + element.scrollIntoView({ block: 'end' }); + element.scrollIntoView({ behavior: 'smooth' }); // fails - element.scrollIntoView({ behavior: \'invalid\' }); - element.scrollIntoView({ block: \'invalid\' }); + element.scrollIntoView({ behavior: 'invalid' }); + element.scrollIntoView({ block: 'invalid' }); element.scrollIntoView(1); } ]; @@ -169,30 +171,30 @@ let tests = [ element.scrollIntoView(); element.scrollIntoView(false); element.scrollIntoView({}); - element.scrollIntoView({ behavior: \"smooth\", block: \"end\" }); - element.scrollIntoView({ block: \"end\" }); - element.scrollIntoView({ behavior: \"smooth\" }); + element.scrollIntoView({ behavior: \\"smooth\\", block: \\"end\\" }); + element.scrollIntoView({ block: \\"end\\" }); + element.scrollIntoView({ behavior: \\"smooth\\" }); // fails - element.scrollIntoView({ behavior: \"invalid\" }); - element.scrollIntoView({ block: \"invalid\" }); + element.scrollIntoView({ behavior: \\"invalid\\" }); + element.scrollIntoView({ block: \\"invalid\\" }); element.scrollIntoView(1); } ]; " `; -exports[`test HTMLInputElement.js 1`] = ` +exports[`HTMLInputElement.js 1`] = ` "// @flow let tests = [ // setRangeText function(el: HTMLInputElement) { - el.setRangeText(\'foo\'); - el.setRangeText(\'foo\', 123); // end is required - el.setRangeText(\'foo\', 123, 234); - el.setRangeText(\'foo\', 123, 234, \'select\'); - el.setRangeText(\'foo\', 123, 234, \'bogus\'); // invalid value + el.setRangeText('foo'); + el.setRangeText('foo', 123); // end is required + el.setRangeText('foo', 123, 234); + el.setRangeText('foo', 123, 234, 'select'); + el.setRangeText('foo', 123, 234, 'bogus'); // invalid value } ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -201,22 +203,22 @@ let tests = [ let tests = [ // setRangeText function(el: HTMLInputElement) { - el.setRangeText(\"foo\"); - el.setRangeText(\"foo\", 123); // end is required - el.setRangeText(\"foo\", 123, 234); - el.setRangeText(\"foo\", 123, 234, \"select\"); - el.setRangeText(\"foo\", 123, 234, \"bogus\"); // invalid value + el.setRangeText(\\"foo\\"); + el.setRangeText(\\"foo\\", 123); // end is required + el.setRangeText(\\"foo\\", 123, 234); + el.setRangeText(\\"foo\\", 123, 234, \\"select\\"); + el.setRangeText(\\"foo\\", 123, 234, \\"bogus\\"); // invalid value } ]; " `; -exports[`test URL.js 1`] = ` +exports[`URL.js 1`] = ` "/* @flow */ -const a = new URL(\'http://flowtype.org/\'); // correct -const b = new URL(\'/docs\', a); // correct -const c = new URL(\'/docs\', \'http://flowtype.org/\'); // correct +const a = new URL('http://flowtype.org/'); // correct +const b = new URL('/docs', a); // correct +const c = new URL('/docs', 'http://flowtype.org/'); // correct const d: URLSearchParams = c.searchParams; // correct const e: string = c.path; // not correct @@ -235,9 +237,9 @@ const r: string = c.username; // correct ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -const a = new URL(\"http://flowtype.org/\"); // correct -const b = new URL(\"/docs\", a); // correct -const c = new URL(\"/docs\", \"http://flowtype.org/\"); // correct +const a = new URL(\\"http://flowtype.org/\\"); // correct +const b = new URL(\\"/docs\\", a); // correct +const c = new URL(\\"/docs\\", \\"http://flowtype.org/\\"); // correct const d: URLSearchParams = c.searchParams; // correct const e: string = c.path; // not correct @@ -256,7 +258,7 @@ const r: string = c.username; // correct " `; -exports[`test eventtarget.js 1`] = ` +exports[`eventtarget.js 1`] = ` "// @flow let listener: EventListener = function (event: Event) :void {}; @@ -265,15 +267,15 @@ let tests = [ // attachEvent function() { let target = new EventTarget(); - (target.attachEvent(\'foo\', listener): void); // invalid, may be undefined - (target.attachEvent && target.attachEvent(\'foo\', listener): void); // valid + (target.attachEvent('foo', listener): void); // invalid, may be undefined + (target.attachEvent && target.attachEvent('foo', listener): void); // valid }, // detachEvent function() { let target = new EventTarget(); - (target.detachEvent(\'foo\', listener): void); // invalid, may be undefined - (target.detachEvent && target.detachEvent(\'foo\', listener): void); // valid + (target.detachEvent('foo', listener): void); // invalid, may be undefined + (target.detachEvent && target.detachEvent('foo', listener): void); // valid }, function() { @@ -291,15 +293,15 @@ let tests = [ // attachEvent function() { let target = new EventTarget(); - (target.attachEvent(\"foo\", listener): void); // invalid, may be undefined - (target.attachEvent && target.attachEvent(\"foo\", listener): void); // valid + (target.attachEvent(\\"foo\\", listener): void); // invalid, may be undefined + (target.attachEvent && target.attachEvent(\\"foo\\", listener): void); // valid }, // detachEvent function() { let target = new EventTarget(); - (target.detachEvent(\"foo\", listener): void); // invalid, may be undefined - (target.detachEvent && target.detachEvent(\"foo\", listener): void); // valid + (target.detachEvent(\\"foo\\", listener): void); // invalid, may be undefined + (target.detachEvent && target.detachEvent(\\"foo\\", listener): void); // valid }, function() { @@ -311,7 +313,7 @@ let tests = [ " `; -exports[`test path2d.js 1`] = ` +exports[`path2d.js 1`] = ` "// @flow let tests = [ @@ -320,7 +322,7 @@ let tests = [ let path = new Path2D(); (path.arcTo(0, 0, 0, 0, 10): void); // valid (path.arcTo(0, 0, 0, 0, 10, 20, 5): void); // valid - (path.arcTo(0, 0, 0, 0, 10, \'20\', 5): void); // invalid + (path.arcTo(0, 0, 0, 0, 10, '20', 5): void); // invalid }, ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -332,19 +334,19 @@ let tests = [ let path = new Path2D(); (path.arcTo(0, 0, 0, 0, 10): void); // valid (path.arcTo(0, 0, 0, 0, 10, 20, 5): void); // valid - (path.arcTo(0, 0, 0, 0, 10, \"20\", 5): void); // invalid + (path.arcTo(0, 0, 0, 0, 10, \\"20\\", 5): void); // invalid } ]; " `; -exports[`test registerElement.js 1`] = ` +exports[`registerElement.js 1`] = ` "// @flow let tests = [ // should work with Object.create() function() { - document.registerElement(\'custom-element\', { + document.registerElement('custom-element', { prototype: Object.create(HTMLElement.prototype, { createdCallback: { value: function createdCallback () { }}, @@ -366,7 +368,7 @@ let tests = [ }, // or with Object.assign() function() { - document.registerElement(\'custom-element\', { + document.registerElement('custom-element', { prototype: Object.assign(Object.create(HTMLElement.prototype), { createdCallback () { }, @@ -386,7 +388,7 @@ let tests = [ }, // should complain about invalid callback parameters function() { - document.registerElement(\'custom-element\', { + document.registerElement('custom-element', { prototype: { attributeChangedCallback( localName: string, @@ -403,7 +405,7 @@ let tests = [ let tests = [ // should work with Object.create() function() { - document.registerElement(\"custom-element\", { + document.registerElement(\\"custom-element\\", { prototype: Object.create(HTMLElement.prototype, { createdCallback: { value: function createdCallback() {} @@ -427,7 +429,7 @@ let tests = [ }, // or with Object.assign() function() { - document.registerElement(\"custom-element\", { + document.registerElement(\\"custom-element\\", { prototype: Object.assign(Object.create(HTMLElement.prototype), { createdCallback() {}, attachedCallback() {}, @@ -443,7 +445,7 @@ let tests = [ }, // should complain about invalid callback parameters function() { - document.registerElement(\"custom-element\", { + document.registerElement(\\"custom-element\\", { prototype: { attributeChangedCallback( localName: string, @@ -458,7 +460,7 @@ let tests = [ " `; -exports[`test traversal.js 1`] = ` +exports[`traversal.js 1`] = ` "// @flow let tests = [ @@ -641,16 +643,16 @@ let tests = [ // NodeFilterInterface function() { document.createNodeIterator(document.body, -1, node => NodeFilter.FILTER_ACCEPT); // valid - document.createNodeIterator(document.body, -1, node => \'accept\'); // invalid + document.createNodeIterator(document.body, -1, node => 'accept'); // invalid document.createNodeIterator(document.body, -1, { accept: node => NodeFilter.FILTER_ACCEPT }); // valid - document.createNodeIterator(document.body, -1, { accept: node => \'accept\' }); // invalid + document.createNodeIterator(document.body, -1, { accept: node => 'accept' }); // invalid document.createNodeIterator(document.body, -1, {}); // invalid }, function() { document.createTreeWalker(document.body, -1, node => NodeFilter.FILTER_ACCEPT); // valid - document.createTreeWalker(document.body, -1, node => \'accept\'); // invalid + document.createTreeWalker(document.body, -1, node => 'accept'); // invalid document.createTreeWalker(document.body, -1, { accept: node => NodeFilter.FILTER_ACCEPT }); // valid - document.createTreeWalker(document.body, -1, { accept: node => \'accept\' }); // invalid + document.createTreeWalker(document.body, -1, { accept: node => 'accept' }); // invalid document.createTreeWalker(document.body, -1, {}); // invalid }, ]; @@ -845,12 +847,12 @@ let tests = [ -1, node => NodeFilter.FILTER_ACCEPT ); // valid - document.createNodeIterator(document.body, -1, node => \"accept\"); // invalid + document.createNodeIterator(document.body, -1, node => \\"accept\\"); // invalid document.createNodeIterator(document.body, -1, { accept: node => NodeFilter.FILTER_ACCEPT }); // valid document.createNodeIterator(document.body, -1, { - accept: node => \"accept\" + accept: node => \\"accept\\" }); // invalid document.createNodeIterator(document.body, -1, {}); // invalid }, @@ -860,11 +862,11 @@ let tests = [ -1, node => NodeFilter.FILTER_ACCEPT ); // valid - document.createTreeWalker(document.body, -1, node => \"accept\"); // invalid + document.createTreeWalker(document.body, -1, node => \\"accept\\"); // invalid document.createTreeWalker(document.body, -1, { accept: node => NodeFilter.FILTER_ACCEPT }); // valid - document.createTreeWalker(document.body, -1, { accept: node => \"accept\" }); // invalid + document.createTreeWalker(document.body, -1, { accept: node => \\"accept\\" }); // invalid document.createTreeWalker(document.body, -1, {}); // invalid } ]; diff --git a/tests/flow/dump-types/__snapshots__/jsfmt.spec.js.snap b/tests/flow/dump-types/__snapshots__/jsfmt.spec.js.snap index 4a861550a..5b3ab1fe6 100644 --- a/tests/flow/dump-types/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/dump-types/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test import.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`import.js 1`] = ` "// @flow var num = 42; function bar() { } @@ -13,9 +15,9 @@ module.exports = num; " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "// @flow -var num = require(\'./import\'); +var num = require('./import'); function foo(x) { } foo(0); var a:string = num; @@ -37,7 +39,7 @@ declare var obj: {a?: {b: ?{c: null | {d: number}}}}; const idxResult = idx(obj, obj => obj.a.b.c.d); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var num = require(\"./import\"); +var num = require(\\"./import\\"); function foo(x) {} foo(0); var a: string = num; diff --git a/tests/flow/duplicate_methods/__snapshots__/jsfmt.spec.js.snap b/tests/flow/duplicate_methods/__snapshots__/jsfmt.spec.js.snap index 8eb108bc9..9d10f5e3e 100644 --- a/tests/flow/duplicate_methods/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/duplicate_methods/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "class C1 { m() { } m() { } diff --git a/tests/flow/encaps/__snapshots__/jsfmt.spec.js.snap b/tests/flow/encaps/__snapshots__/jsfmt.spec.js.snap index ba839d6c8..70121e3e6 100644 --- a/tests/flow/encaps/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/encaps/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test encaps.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`encaps.js 1`] = ` "class A { } var a = new A(); var s1 = \`l\${a.x}r\`; // error: no prop x in A @@ -10,7 +12,7 @@ function tag(strings,...values) { var s2 = tag \`l\${42}r\`; function tag2(strings,...values) { - return { foo: \"\" }; // ok: tagged templates can return whatever + return { foo: \\"\\" }; // ok: tagged templates can return whatever } var s3 = tag2 \`la la la\`; @@ -27,7 +29,7 @@ function tag(strings, ...values) { var s2 = tag\`l\${42}r\`; function tag2(strings, ...values) { - return { foo: \"\" }; // ok: tagged templates can return whatever + return { foo: \\"\\" }; // ok: tagged templates can return whatever } var s3 = tag2\`la la la\`; diff --git a/tests/flow/enumerror/__snapshots__/jsfmt.spec.js.snap b/tests/flow/enumerror/__snapshots__/jsfmt.spec.js.snap index a56114e74..31ad91ff3 100644 --- a/tests/flow/enumerror/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/enumerror/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test enumerror.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`enumerror.js 1`] = ` "/** @flow */ function isActive(ad: {state: $Keys<{ @@ -6,22 +8,22 @@ function isActive(ad: {state: $Keys<{ ACTIVE: string; DELETED: string; }>}): boolean { - return ad.state === \'ACTIVE\'; + return ad.state === 'ACTIVE'; }; -isActive({state: \'PAUSE\'}); +isActive({state: 'PAUSE'}); var MyStates = { - PAUSED: \'PAUSED\', - ACTIVE: \'ACTIVE\', - DELETED: \'DELETED\', + PAUSED: 'PAUSED', + ACTIVE: 'ACTIVE', + DELETED: 'DELETED', }; function isActive2(ad: {state: $Keys}): boolean { return ad.state === MyStates.ACTIVE; }; -isActive2({state: \'PAUSE\'}); +isActive2({state: 'PAUSE'}); type Keys = $Keys<{ x: any, y: any }>; -type Union = \"x\" | \"y\" +type Union = \\"x\\" | \\"y\\" function keys2union(s: Keys): Union { return s; } // ok function union2keys(s: Union): Keys { return s; } // ok @@ -37,22 +39,22 @@ function isActive( }> } ): boolean { - return ad.state === \"ACTIVE\"; + return ad.state === \\"ACTIVE\\"; } -isActive({ state: \"PAUSE\" }); +isActive({ state: \\"PAUSE\\" }); var MyStates = { - PAUSED: \"PAUSED\", - ACTIVE: \"ACTIVE\", - DELETED: \"DELETED\" + PAUSED: \\"PAUSED\\", + ACTIVE: \\"ACTIVE\\", + DELETED: \\"DELETED\\" }; function isActive2(ad: { state: $Keys }): boolean { return ad.state === MyStates.ACTIVE; } -isActive2({ state: \"PAUSE\" }); +isActive2({ state: \\"PAUSE\\" }); type Keys = $Keys<{ x: any, y: any }>; -type Union = \"x\" | \"y\"; +type Union = \\"x\\" | \\"y\\"; function keys2union(s: Keys): Union { return s; diff --git a/tests/flow/equals/__snapshots__/jsfmt.spec.js.snap b/tests/flow/equals/__snapshots__/jsfmt.spec.js.snap index a8a281c99..b792f8646 100644 --- a/tests/flow/equals/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/equals/__snapshots__/jsfmt.spec.js.snap @@ -1,12 +1,14 @@ -exports[`test equals.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`equals.js 1`] = ` "/* @flow */ (1 == 1); -(\"foo\" == \"bar\"); +(\\"foo\\" == \\"bar\\"); (1 == null); (null == 1); -(1 == \"\"); // error -(\"\" == 1); // error +(1 == \\"\\"); // error +(\\"\\" == 1); // error var x = (null : ?number); (x == 1); @@ -15,11 +17,11 @@ var x = (null : ?number); /* @flow */ 1 == 1; -\"foo\" == \"bar\"; +\\"foo\\" == \\"bar\\"; 1 == null; null == 1; -1 == \"\"; // error -\"\" == 1; // error +1 == \\"\\"; // error +\\"\\" == 1; // error var x = (null: ?number); x == 1; diff --git a/tests/flow/error_messages/__snapshots__/jsfmt.spec.js.snap b/tests/flow/error_messages/__snapshots__/jsfmt.spec.js.snap index 586bafed0..e542499ac 100644 --- a/tests/flow/error_messages/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/error_messages/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,9 @@ -exports[`test errors.js 1`] = ` -"if (typeof define === \'function\' && define.amd) { } +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`errors.js 1`] = ` +"if (typeof define === 'function' && define.amd) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -if (typeof define === \"function\" && define.amd) { +if (typeof define === \\"function\\" && define.amd) { } " `; diff --git a/tests/flow/es6modules/__snapshots__/jsfmt.spec.js.snap b/tests/flow/es6modules/__snapshots__/jsfmt.spec.js.snap index 595f5abab..081bbe6c5 100644 --- a/tests/flow/es6modules/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/es6modules/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test B.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`B.js 1`] = ` "/* @flow */ exports.numberValue = 42; @@ -9,14 +11,14 @@ exports.numberValue = 42; " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` "/* @flow */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ " `; -exports[`test CommonJS_Clobbering_Class.js 1`] = ` +exports[`CommonJS_Clobbering_Class.js 1`] = ` "/** * @providesModule CommonJS_Clobbering_Class * @flow @@ -73,7 +75,7 @@ module.exports = Test; " `; -exports[`test CommonJS_Clobbering_Frozen.js 1`] = ` +exports[`CommonJS_Clobbering_Frozen.js 1`] = ` "/** * @providesModule CommonJS_Clobbering_Frozen * @flow @@ -94,7 +96,7 @@ module.exports = Object.freeze({ " `; -exports[`test CommonJS_Clobbering_Lit.js 1`] = ` +exports[`CommonJS_Clobbering_Lit.js 1`] = ` "/** * @providesModule CommonJS_Clobbering_Lit * @flow @@ -123,7 +125,7 @@ module.exports = { " `; -exports[`test CommonJS_Named.js 1`] = ` +exports[`CommonJS_Named.js 1`] = ` "/** * @providesModule CommonJS_Named * @flow @@ -148,7 +150,7 @@ exports.numberValue5 = 5; " `; -exports[`test ES6_Default_AnonClass1.js 1`] = ` +exports[`ES6_Default_AnonClass1.js 1`] = ` "/** * @providesModule ES6_Default_AnonClass1 * @flow @@ -169,7 +171,7 @@ export default class { " `; -exports[`test ES6_Default_AnonClass2.js 1`] = ` +exports[`ES6_Default_AnonClass2.js 1`] = ` "/** * @providesModule ES6_Default_AnonClass2 * @flow @@ -190,7 +192,7 @@ export default class { " `; -exports[`test ES6_Default_AnonFunction1.js 1`] = ` +exports[`ES6_Default_AnonFunction1.js 1`] = ` "/** * @providesModule ES6_Default_AnonFunction1 * @flow @@ -209,7 +211,7 @@ export default function(): number { " `; -exports[`test ES6_Default_AnonFunction2.js 1`] = ` +exports[`ES6_Default_AnonFunction2.js 1`] = ` "/** * @providesModule ES6_Default_AnonFunction2 * @flow @@ -228,7 +230,7 @@ export default function(): number { " `; -exports[`test ES6_Default_NamedClass1.js 1`] = ` +exports[`ES6_Default_NamedClass1.js 1`] = ` "/** * @providesModule ES6_Default_NamedClass1 * @flow @@ -259,7 +261,7 @@ new Foo(); " `; -exports[`test ES6_Default_NamedClass2.js 1`] = ` +exports[`ES6_Default_NamedClass2.js 1`] = ` "/** * @providesModule ES6_Default_NamedClass2 * @flow @@ -280,7 +282,7 @@ export default class Foo { " `; -exports[`test ES6_Default_NamedFunction1.js 1`] = ` +exports[`ES6_Default_NamedFunction1.js 1`] = ` "/** * @providesModule ES6_Default_NamedFunction1 * @flow @@ -299,7 +301,7 @@ export default function foo(): number { " `; -exports[`test ES6_Default_NamedFunction2.js 1`] = ` +exports[`ES6_Default_NamedFunction2.js 1`] = ` "/** * @providesModule ES6_Default_NamedFunction2 * @flow @@ -318,54 +320,54 @@ export default function foo(): number { " `; -exports[`test ES6_DefaultAndNamed.js 1`] = ` +exports[`ES6_DefaultAndNamed.js 1`] = ` "/* @flow */ export default 42; -export var str = \'asdf\'; +export var str = 'asdf'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ export default 42; -export var str = \"asdf\"; +export var str = \\"asdf\\"; " `; -exports[`test ES6_ExportAllFrom_Intermediary1.js 1`] = ` +exports[`ES6_ExportAllFrom_Intermediary1.js 1`] = ` "/** * @providesModule ES6_ExportAllFrom_Intermediary1 * @flow */ -export * from \"ES6_ExportAllFrom_Source1\"; +export * from \\"ES6_ExportAllFrom_Source1\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule ES6_ExportAllFrom_Intermediary1 * @flow */ -export * from \"ES6_ExportAllFrom_Source1\"; +export * from \\"ES6_ExportAllFrom_Source1\\"; " `; -exports[`test ES6_ExportAllFrom_Intermediary2.js 1`] = ` +exports[`ES6_ExportAllFrom_Intermediary2.js 1`] = ` "/** * @providesModule ES6_ExportAllFrom_Intermediary2 * @flow */ -export * from \"ES6_ExportAllFrom_Source2\"; +export * from \\"ES6_ExportAllFrom_Source2\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule ES6_ExportAllFrom_Intermediary2 * @flow */ -export * from \"ES6_ExportAllFrom_Source2\"; +export * from \\"ES6_ExportAllFrom_Source2\\"; " `; -exports[`test ES6_ExportAllFrom_Source1.js 1`] = ` +exports[`ES6_ExportAllFrom_Source1.js 1`] = ` "/** * @providesModule ES6_ExportAllFrom_Source1 * @flow @@ -382,7 +384,7 @@ export var numberValue1 = 1; " `; -exports[`test ES6_ExportAllFrom_Source2.js 1`] = ` +exports[`ES6_ExportAllFrom_Source2.js 1`] = ` "/** * @providesModule ES6_ExportAllFrom_Source2 * @flow @@ -399,20 +401,20 @@ export var numberValue2 = 1; " `; -exports[`test ES6_ExportAllFromMulti.js 1`] = ` +exports[`ES6_ExportAllFromMulti.js 1`] = ` "// @flow -export * from \"./ES6_ExportAllFrom_Source1\"; -export * from \"./ES6_ExportAllFrom_Source2\"; +export * from \\"./ES6_ExportAllFrom_Source1\\"; +export * from \\"./ES6_ExportAllFrom_Source2\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -export * from \"./ES6_ExportAllFrom_Source1\"; -export * from \"./ES6_ExportAllFrom_Source2\"; +export * from \\"./ES6_ExportAllFrom_Source1\\"; +export * from \\"./ES6_ExportAllFrom_Source2\\"; " `; -exports[`test ES6_ExportFrom_Intermediary1.js 1`] = ` +exports[`ES6_ExportFrom_Intermediary1.js 1`] = ` "/** * @providesModule ES6_ExportFrom_Intermediary1 * @flow @@ -421,7 +423,7 @@ exports[`test ES6_ExportFrom_Intermediary1.js 1`] = ` export { numberValue1, numberValue2 as numberValue2_renamed -} from \"ES6_ExportFrom_Source1\"; +} from \\"ES6_ExportFrom_Source1\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule ES6_ExportFrom_Intermediary1 @@ -431,11 +433,11 @@ export { export { numberValue1, numberValue2 as numberValue2_renamed -} from \"ES6_ExportFrom_Source1\"; +} from \\"ES6_ExportFrom_Source1\\"; " `; -exports[`test ES6_ExportFrom_Intermediary2.js 1`] = ` +exports[`ES6_ExportFrom_Intermediary2.js 1`] = ` "/** * @providesModule ES6_ExportFrom_Intermediary2 * @flow @@ -444,7 +446,7 @@ exports[`test ES6_ExportFrom_Intermediary2.js 1`] = ` export { numberValue1, numberValue2 as numberValue2_renamed2 -} from \"ES6_ExportFrom_Source2\"; +} from \\"ES6_ExportFrom_Source2\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule ES6_ExportFrom_Intermediary2 @@ -454,11 +456,11 @@ export { export { numberValue1, numberValue2 as numberValue2_renamed2 -} from \"ES6_ExportFrom_Source2\"; +} from \\"ES6_ExportFrom_Source2\\"; " `; -exports[`test ES6_ExportFrom_Source1.js 1`] = ` +exports[`ES6_ExportFrom_Source1.js 1`] = ` "/** * @providesModule ES6_ExportFrom_Source1 * @flow @@ -475,7 +477,7 @@ export var numberValue1 = 1, numberValue2 = 2; " `; -exports[`test ES6_ExportFrom_Source2.js 1`] = ` +exports[`ES6_ExportFrom_Source2.js 1`] = ` "/** * @providesModule ES6_ExportFrom_Source2 * @flow @@ -492,7 +494,7 @@ export var numberValue1 = 1, numberValue2 = 2; " `; -exports[`test ES6_Named1.js 1`] = ` +exports[`ES6_Named1.js 1`] = ` "/** * @providesModule ES6_Named1 * @flow @@ -547,7 +549,7 @@ export var [destructuredArrNumber] = [1]; " `; -exports[`test ES6_Named2.js 1`] = ` +exports[`ES6_Named2.js 1`] = ` "/** * @providesModule ES6_Named2 * @flow @@ -598,7 +600,7 @@ export var [destructuredArrNumber2] = [1]; " `; -exports[`test ExportType.js 1`] = ` +exports[`ExportType.js 1`] = ` "// @flow export type typeAlias = number; @@ -609,7 +611,7 @@ export type typeAlias = number; " `; -exports[`test ProvidesModuleA.js 1`] = ` +exports[`ProvidesModuleA.js 1`] = ` "/** * @providesModule A * @flow @@ -619,7 +621,7 @@ exports.numberValue1 = 42; exports.numberValue2 = 42; exports.numberValue3 = 42; exports.numberValue4 = 42; -exports.stringValue = \"str\"; +exports.stringValue = \\"str\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule A @@ -630,11 +632,11 @@ exports.numberValue1 = 42; exports.numberValue2 = 42; exports.numberValue3 = 42; exports.numberValue4 = 42; -exports.stringValue = \"str\"; +exports.stringValue = \\"str\\"; " `; -exports[`test ProvidesModuleCJSDefault.js 1`] = ` +exports[`ProvidesModuleCJSDefault.js 1`] = ` "/** * @providesModule CJSDefault * @flow @@ -655,7 +657,7 @@ module.exports = { " `; -exports[`test ProvidesModuleD.js 1`] = ` +exports[`ProvidesModuleD.js 1`] = ` "/** * @providesModule D * @flow @@ -668,7 +670,7 @@ exports[`test ProvidesModuleD.js 1`] = ` " `; -exports[`test ProvidesModuleES6Default.js 1`] = ` +exports[`ProvidesModuleES6Default.js 1`] = ` "/** * @providesModule ES6Default * @flow @@ -692,14 +694,14 @@ export default { " `; -exports[`test SideEffects.js 1`] = ` +exports[`SideEffects.js 1`] = ` "/* @flow */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ " `; -exports[`test es6modules.js 1`] = ` +exports[`es6modules.js 1`] = ` "/* @flow */ // ===================== // @@ -707,44 +709,44 @@ exports[`test es6modules.js 1`] = ` // ===================== // // @providesModule -import * as DefaultA from \"A\"; +import * as DefaultA from \\"A\\"; var a1: number = DefaultA.numberValue1; var a2: string = DefaultA.numberValue1; // Error: number ~> string // File path -import * as DefaultB from \"./B\"; +import * as DefaultB from \\"./B\\"; var b1: number = DefaultB.numberValue; var b2: string = DefaultB.numberValue; // Error: number ~> string // C.js exists, but not as a providesModule -import DefaultC from \"C\"; // Error: No such module +import DefaultC from \\"C\\"; // Error: No such module // @providesModule D exists, but not as a filename -import DefaultD from \"./D\"; // Error: No such module +import DefaultD from \\"./D\\"; // Error: No such module // ================================================ // // == CommonJS Clobbering Literal Exports -> ES6 == // // ================================================ // -import {doesntExist1} from \"CommonJS_Clobbering_Lit\"; // Error: Not an exported binding +import {doesntExist1} from \\"CommonJS_Clobbering_Lit\\"; // Error: Not an exported binding -import {numberValue1} from \"CommonJS_Clobbering_Lit\"; +import {numberValue1} from \\"CommonJS_Clobbering_Lit\\"; var c1: number = numberValue1; var c2: string = numberValue1; // Error: number ~> string -import {numberValue2 as numVal1} from \"CommonJS_Clobbering_Lit\"; +import {numberValue2 as numVal1} from \\"CommonJS_Clobbering_Lit\\"; var d1: number = numVal1; var d2: string = numVal1; // Error: number ~> string -import CJS_Clobb_Lit from \"CommonJS_Clobbering_Lit\"; +import CJS_Clobb_Lit from \\"CommonJS_Clobbering_Lit\\"; var e1: number = CJS_Clobb_Lit.numberValue3; var e2: string = CJS_Clobb_Lit.numberValue3; // Error: number ~> string -CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn\'t a property +CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn't a property -import * as CJS_Clobb_Lit_NS from \"CommonJS_Clobbering_Lit\"; +import * as CJS_Clobb_Lit_NS from \\"CommonJS_Clobbering_Lit\\"; var f1: number = CJS_Clobb_Lit_NS.numberValue4; var f2: number = CJS_Clobb_Lit_NS.default.numberValue4; -CJS_Clobb_Lit_NS.default.default; // Error: No \'default\' property on the exported obj +CJS_Clobb_Lit_NS.default.default; // Error: No 'default' property on the exported obj var f3: string = CJS_Clobb_Lit_NS.numberValue4; // Error: number ~> string var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> string @@ -752,15 +754,15 @@ var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> stri // == CommonJS Clobbering Class Exports -> ES6 == // // ============================================== // -import {doesntExist2} from \"CommonJS_Clobbering_Class\"; // Error: Not an exported binding +import {doesntExist2} from \\"CommonJS_Clobbering_Class\\"; // Error: Not an exported binding // The following import should error because class statics are not turned into // named exports for now. This avoids complexities with polymorphic static // members (where the polymophism is defined on the class itself rather than the // method). -import {staticNumber1, baseProp, childProp} from \"CommonJS_Clobbering_Class\"; // Error +import {staticNumber1, baseProp, childProp} from \\"CommonJS_Clobbering_Class\\"; // Error -import CJS_Clobb_Class from \"CommonJS_Clobbering_Class\"; +import CJS_Clobb_Class from \\"CommonJS_Clobbering_Class\\"; new CJS_Clobb_Class(); new CJS_Clobb_Class().doesntExist; // Error: Class has no \`doesntExist\` property var h1: number = CJS_Clobb_Class.staticNumber2(); @@ -768,8 +770,8 @@ var h2: string = CJS_Clobb_Class.staticNumber2(); // Error: number ~> string var h3: number = new CJS_Clobb_Class().instNumber1(); var h4: string = new CJS_Clobb_Class().instNumber1(); // Error: number ~> string -import * as CJS_Clobb_Class_NS from \"CommonJS_Clobbering_Class\"; -new CJS_Clobb_Class_NS(); // Error: Namespace object isn\'t constructable +import * as CJS_Clobb_Class_NS from \\"CommonJS_Clobbering_Class\\"; +new CJS_Clobb_Class_NS(); // Error: Namespace object isn't constructable var i1: number = CJS_Clobb_Class_NS.staticNumber3(); // Error: Class statics not copied to Namespace object var i2: number = new CJS_Clobb_Class_NS.default().instNumber2(); var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: number ~> string @@ -778,22 +780,22 @@ var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: numbe // == CommonJS Named Exports -> ES6 == // // =================================== // -import {doesntExist3} from \"CommonJS_Named\"; // Error: Not an exported binding +import {doesntExist3} from \\"CommonJS_Named\\"; // Error: Not an exported binding -import {numberValue2} from \"CommonJS_Named\"; +import {numberValue2} from \\"CommonJS_Named\\"; var j1: number = numberValue2; var j2: string = numberValue2; // Error: number ~> string -import {numberValue3 as numVal3} from \"CommonJS_Named\"; +import {numberValue3 as numVal3} from \\"CommonJS_Named\\"; var k1: number = numVal3; var k2: string = numVal3; // Error: number ~> string -import * as CJS_Named from \"CommonJS_Named\"; +import * as CJS_Named from \\"CommonJS_Named\\"; var l1: number = CJS_Named.numberValue1; var l2: string = CJS_Named.numberValue1; // Error: number ~> string -CJS_Named.doesntExist; // Error: doesntExist isn\'t a property +CJS_Named.doesntExist; // Error: doesntExist isn't a property -import * as CJS_Named_NS from \"CommonJS_Named\"; +import * as CJS_Named_NS from \\"CommonJS_Named\\"; var m1: number = CJS_Named_NS.numberValue4; var m2: string = CJS_Named_NS.default.numberValue4; // Error: CommonJS_Named has no default export var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string @@ -802,21 +804,21 @@ var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string // == ES6 Default -> ES6 == // ////////////////////////////// -import {doesntExist4} from \"ES6_Default_AnonFunction1\"; // Error: Not an exported binding +import {doesntExist4} from \\"ES6_Default_AnonFunction1\\"; // Error: Not an exported binding -import ES6_Def_AnonFunc1 from \"ES6_Default_AnonFunction1\"; +import ES6_Def_AnonFunc1 from \\"ES6_Default_AnonFunction1\\"; var n1: number = ES6_Def_AnonFunc1(); var n2: string = ES6_Def_AnonFunc1(); // Error: number ~> string -import ES6_Def_NamedFunc1 from \"ES6_Default_NamedFunction1\"; +import ES6_Def_NamedFunc1 from \\"ES6_Default_NamedFunction1\\"; var o1: number = ES6_Def_NamedFunc1(); var o2: string = ES6_Def_NamedFunc1(); // Error: number ~> string -import ES6_Def_AnonClass1 from \"ES6_Default_AnonClass1\"; +import ES6_Def_AnonClass1 from \\"ES6_Default_AnonClass1\\"; var p1: number = new ES6_Def_AnonClass1().givesANum(); var p2: string = new ES6_Def_AnonClass1().givesANum(); // Error: number ~> string -import ES6_Def_NamedClass1 from \"ES6_Default_NamedClass1\"; +import ES6_Def_NamedClass1 from \\"ES6_Default_NamedClass1\\"; var q1: number = new ES6_Def_NamedClass1().givesANum(); var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> string @@ -824,57 +826,57 @@ var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> stri // == ES6 Named -> ES6 == // //////////////////////////// -import doesntExist5 from \"ES6_Named1\"; // Error: Not an exported binding +import doesntExist5 from \\"ES6_Named1\\"; // Error: Not an exported binding -import {specifierNumber1 as specifierNumber1_1} from \"ES6_Named1\"; +import {specifierNumber1 as specifierNumber1_1} from \\"ES6_Named1\\"; var r1: number = specifierNumber1_1; var r2: string = specifierNumber1_1; // Error: number ~> string -import {specifierNumber2Renamed} from \"ES6_Named1\"; +import {specifierNumber2Renamed} from \\"ES6_Named1\\"; var s1: number = specifierNumber2Renamed; var s2: string = specifierNumber2Renamed; // Error: number ~> string -import {specifierNumber3 as specifierNumber3Renamed} from \"ES6_Named1\"; +import {specifierNumber3 as specifierNumber3Renamed} from \\"ES6_Named1\\"; var t1: number = specifierNumber3Renamed; var t2: string = specifierNumber3Renamed; // Error: number ~> string -import {groupedSpecifierNumber1, groupedSpecifierNumber2} from \"ES6_Named1\"; +import {groupedSpecifierNumber1, groupedSpecifierNumber2} from \\"ES6_Named1\\"; var u1: number = groupedSpecifierNumber1; var u2: number = groupedSpecifierNumber2; var u3: string = groupedSpecifierNumber1; // Error: number ~> string var u4: string = groupedSpecifierNumber2; // Error: number ~> string -import {givesANumber} from \"ES6_Named1\"; +import {givesANumber} from \\"ES6_Named1\\"; var v1: number = givesANumber(); var v2: string = givesANumber(); // Error: number ~> string -import {NumberGenerator} from \"ES6_Named1\"; +import {NumberGenerator} from \\"ES6_Named1\\"; var w1: number = new NumberGenerator().givesANumber(); var w2: string = new NumberGenerator().givesANumber(); // Error: number ~> string -import {varDeclNumber1, varDeclNumber2} from \"ES6_Named1\"; +import {varDeclNumber1, varDeclNumber2} from \\"ES6_Named1\\"; var x1: number = varDeclNumber1; var x2: number = varDeclNumber2; var x3: string = varDeclNumber1; // Error: number ~> string var x4: string = varDeclNumber2; // Error: number ~> string -import {destructuredObjNumber} from \"ES6_Named1\"; +import {destructuredObjNumber} from \\"ES6_Named1\\"; var y1: number = destructuredObjNumber; var y2: string = destructuredObjNumber; // Error: number ~> string -import {destructuredArrNumber} from \"ES6_Named1\"; +import {destructuredArrNumber} from \\"ES6_Named1\\"; var z1: number = destructuredArrNumber; var z2: string = destructuredArrNumber; // Error: number ~> string -import {numberValue1 as numberValue4} from \"ES6_ExportFrom_Intermediary1\"; +import {numberValue1 as numberValue4} from \\"ES6_ExportFrom_Intermediary1\\"; var aa1: number = numberValue4; var aa2: string = numberValue4; // Error: number ~> string -import {numberValue2_renamed} from \"ES6_ExportFrom_Intermediary1\"; +import {numberValue2_renamed} from \\"ES6_ExportFrom_Intermediary1\\"; var ab1: number = numberValue2_renamed; var ab2: string = numberValue2_renamed; // Error: number ~> string -import {numberValue1 as numberValue5} from \"ES6_ExportAllFrom_Intermediary1\"; +import {numberValue1 as numberValue5} from \\"ES6_ExportAllFrom_Intermediary1\\"; var ac1: number = numberValue5; var ac2: string = numberValue5; // Error: number ~> string @@ -882,21 +884,21 @@ var ac2: string = numberValue5; // Error: number ~> string // == ES6 Default -> CommonJS == // /////////////////////////////////// -require(\'ES6_Default_AnonFunction2\').doesntExist; // Error: \'doesntExist\' isn\'t an export +require('ES6_Default_AnonFunction2').doesntExist; // Error: 'doesntExist' isn't an export -var ES6_Def_AnonFunc2 = require(\"ES6_Default_AnonFunction2\").default; +var ES6_Def_AnonFunc2 = require(\\"ES6_Default_AnonFunction2\\").default; var ad1: number = ES6_Def_AnonFunc2(); var ad2: string = ES6_Def_AnonFunc2(); // Error: number ~> string -var ES6_Def_NamedFunc2 = require(\"ES6_Default_NamedFunction2\").default; +var ES6_Def_NamedFunc2 = require(\\"ES6_Default_NamedFunction2\\").default; var ae1: number = ES6_Def_NamedFunc2(); var ae2: string = ES6_Def_NamedFunc2(); // Error: number ~> string -var ES6_Def_AnonClass2 = require(\"ES6_Default_AnonClass2\").default; +var ES6_Def_AnonClass2 = require(\\"ES6_Default_AnonClass2\\").default; var af1: number = new ES6_Def_AnonClass2().givesANum(); var af2: string = new ES6_Def_AnonClass2().givesANum(); // Error: number ~> string -var ES6_Def_NamedClass2 = require(\"ES6_Default_NamedClass2\").default; +var ES6_Def_NamedClass2 = require(\\"ES6_Default_NamedClass2\\").default; var ag1: number = new ES6_Def_NamedClass2().givesANum(); var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> string @@ -904,53 +906,53 @@ var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> str // == ES6 Named -> CommonJS == // ///////////////////////////////// -var specifierNumber4 = require(\"ES6_Named2\").specifierNumber4; +var specifierNumber4 = require(\\"ES6_Named2\\").specifierNumber4; var ah1: number = specifierNumber4; var ah2: string = specifierNumber4; // Error: number ~> string -var specifierNumber5Renamed = require(\"ES6_Named2\").specifierNumber5Renamed; +var specifierNumber5Renamed = require(\\"ES6_Named2\\").specifierNumber5Renamed; var ai1: number = specifierNumber5Renamed; var ai2: string = specifierNumber5Renamed; // Error: number ~> string -var groupedSpecifierNumber3 = require(\"ES6_Named2\").groupedSpecifierNumber3; -var groupedSpecifierNumber4 = require(\"ES6_Named2\").groupedSpecifierNumber4; +var groupedSpecifierNumber3 = require(\\"ES6_Named2\\").groupedSpecifierNumber3; +var groupedSpecifierNumber4 = require(\\"ES6_Named2\\").groupedSpecifierNumber4; var aj1: number = groupedSpecifierNumber3; var aj2: number = groupedSpecifierNumber4; var aj3: string = groupedSpecifierNumber3; // Error: number ~> string var aj4: string = groupedSpecifierNumber4; // Error: number ~> string -var givesANumber2 = require(\"ES6_Named2\").givesANumber2; +var givesANumber2 = require(\\"ES6_Named2\\").givesANumber2; var ak1: number = givesANumber2(); var ak2: string = givesANumber2(); // Error: number ~> string -var NumberGenerator2 = require(\"ES6_Named2\").NumberGenerator2; +var NumberGenerator2 = require(\\"ES6_Named2\\").NumberGenerator2; var al1: number = new NumberGenerator2().givesANumber(); var al2: string = new NumberGenerator2().givesANumber(); // Error: number ~> string -var varDeclNumber3 = require(\"ES6_Named2\").varDeclNumber3; -var varDeclNumber4 = require(\"ES6_Named2\").varDeclNumber4; +var varDeclNumber3 = require(\\"ES6_Named2\\").varDeclNumber3; +var varDeclNumber4 = require(\\"ES6_Named2\\").varDeclNumber4; var am1: number = varDeclNumber3; var am2: number = varDeclNumber4; var am3: string = varDeclNumber3; // Error: number ~> string var am4: string = varDeclNumber4; // Error: number ~> string -var destructuredObjNumber2 = require(\"ES6_Named2\").destructuredObjNumber2; +var destructuredObjNumber2 = require(\\"ES6_Named2\\").destructuredObjNumber2; var an1: number = destructuredObjNumber2; var an2: string = destructuredObjNumber2; // Error: number ~> string -var destructuredArrNumber2 = require(\"ES6_Named2\").destructuredArrNumber2; +var destructuredArrNumber2 = require(\\"ES6_Named2\\").destructuredArrNumber2; var ao1: number = destructuredArrNumber2; var ao2: string = destructuredArrNumber2; // Error: number ~> string -var numberValue6 = require(\"ES6_ExportFrom_Intermediary2\").numberValue1; +var numberValue6 = require(\\"ES6_ExportFrom_Intermediary2\\").numberValue1; var ap1: number = numberValue6; var ap2: string = numberValue6; // Error: number ~> string -var numberValue2_renamed2 = require(\"ES6_ExportFrom_Intermediary2\").numberValue2_renamed2; +var numberValue2_renamed2 = require(\\"ES6_ExportFrom_Intermediary2\\").numberValue2_renamed2; var aq1: number = numberValue2_renamed2; var aq2: string = numberValue2_renamed2; // Error: number ~> string -var numberValue7 = require(\"ES6_ExportAllFrom_Intermediary2\").numberValue2; +var numberValue7 = require(\\"ES6_ExportAllFrom_Intermediary2\\").numberValue2; var ar1: number = numberValue7; var ar2: string = numberValue7; // Error: number ~> string @@ -958,7 +960,7 @@ var ar2: string = numberValue7; // Error: number ~> string // == ES6 Default+Named -> ES6 import Default+Named== // //////////////////////////////////////////////////////// -import defaultNum, {str as namedStr} from \"./ES6_DefaultAndNamed\"; +import defaultNum, {str as namedStr} from \\"./ES6_DefaultAndNamed\\"; var as1: number = defaultNum; var as2: string = defaultNum; // Error: number ~> string @@ -970,13 +972,13 @@ var as4: number = namedStr; // Error: string ~> number // == Side-effect only ES6 imports == // //////////////////////////////////////// -import \"./SideEffects\"; +import \\"./SideEffects\\"; ////////////////////////////////////////////// // == Suggest export name on likely typo == // ////////////////////////////////////////////// -import specifierNumber1 from \"ES6_Named1\"; // Error: Did you mean \`import {specifierNumber1} from ...\`? -import {specifierNumber} from \"ES6_Named1\"; // Error: Did you mean \`specifierNumber1\`? +import specifierNumber1 from \\"ES6_Named1\\"; // Error: Did you mean \`import {specifierNumber1} from ...\`? +import {specifierNumber} from \\"ES6_Named1\\"; // Error: Did you mean \`specifierNumber1\`? /////////////////////////////////////////////////// // == Multi \`export *\` should combine exports == // @@ -984,7 +986,7 @@ import {specifierNumber} from \"ES6_Named1\"; // Error: Did you mean \`specifier import { numberValue1 as numberValue8, numberValue2 as numberValue9 -} from \"./ES6_ExportAllFromMulti\"; +} from \\"./ES6_ExportAllFromMulti\\"; var at1: number = numberValue8; var at2: string = numberValue8; // Error: number ~> string @@ -995,7 +997,7 @@ var at4: string = numberValue9; // Error: number ~> string ///////////////////////////////////////////////////////////// // == Vanilla \`import\` cannot import a type-only export == // ///////////////////////////////////////////////////////////// -import {typeAlias} from \"./ExportType\"; // Error: Cannot vanilla-import a type alias! +import {typeAlias} from \\"./ExportType\\"; // Error: Cannot vanilla-import a type alias! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -1004,44 +1006,44 @@ import {typeAlias} from \"./ExportType\"; // Error: Cannot vanilla-import a type // ===================== // // @providesModule -import * as DefaultA from \"A\"; +import * as DefaultA from \\"A\\"; var a1: number = DefaultA.numberValue1; var a2: string = DefaultA.numberValue1; // Error: number ~> string // File path -import * as DefaultB from \"./B\"; +import * as DefaultB from \\"./B\\"; var b1: number = DefaultB.numberValue; var b2: string = DefaultB.numberValue; // Error: number ~> string // C.js exists, but not as a providesModule -import DefaultC from \"C\"; // Error: No such module +import DefaultC from \\"C\\"; // Error: No such module // @providesModule D exists, but not as a filename -import DefaultD from \"./D\"; // Error: No such module +import DefaultD from \\"./D\\"; // Error: No such module // ================================================ // // == CommonJS Clobbering Literal Exports -> ES6 == // // ================================================ // -import { doesntExist1 } from \"CommonJS_Clobbering_Lit\"; // Error: Not an exported binding +import { doesntExist1 } from \\"CommonJS_Clobbering_Lit\\"; // Error: Not an exported binding -import { numberValue1 } from \"CommonJS_Clobbering_Lit\"; +import { numberValue1 } from \\"CommonJS_Clobbering_Lit\\"; var c1: number = numberValue1; var c2: string = numberValue1; // Error: number ~> string -import { numberValue2 as numVal1 } from \"CommonJS_Clobbering_Lit\"; +import { numberValue2 as numVal1 } from \\"CommonJS_Clobbering_Lit\\"; var d1: number = numVal1; var d2: string = numVal1; // Error: number ~> string -import CJS_Clobb_Lit from \"CommonJS_Clobbering_Lit\"; +import CJS_Clobb_Lit from \\"CommonJS_Clobbering_Lit\\"; var e1: number = CJS_Clobb_Lit.numberValue3; var e2: string = CJS_Clobb_Lit.numberValue3; // Error: number ~> string -CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn\'t a property +CJS_Clobb_Lit.doesntExist; // Error: doesntExist isn't a property -import * as CJS_Clobb_Lit_NS from \"CommonJS_Clobbering_Lit\"; +import * as CJS_Clobb_Lit_NS from \\"CommonJS_Clobbering_Lit\\"; var f1: number = CJS_Clobb_Lit_NS.numberValue4; var f2: number = CJS_Clobb_Lit_NS.default.numberValue4; -CJS_Clobb_Lit_NS.default.default; // Error: No \'default\' property on the exported obj +CJS_Clobb_Lit_NS.default.default; // Error: No 'default' property on the exported obj var f3: string = CJS_Clobb_Lit_NS.numberValue4; // Error: number ~> string var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> string @@ -1049,15 +1051,15 @@ var f4: string = CJS_Clobb_Lit_NS.default.numberValue5; // Error: number ~> stri // == CommonJS Clobbering Class Exports -> ES6 == // // ============================================== // -import { doesntExist2 } from \"CommonJS_Clobbering_Class\"; // Error: Not an exported binding +import { doesntExist2 } from \\"CommonJS_Clobbering_Class\\"; // Error: Not an exported binding // The following import should error because class statics are not turned into // named exports for now. This avoids complexities with polymorphic static // members (where the polymophism is defined on the class itself rather than the // method). -import { staticNumber1, baseProp, childProp } from \"CommonJS_Clobbering_Class\"; // Error +import { staticNumber1, baseProp, childProp } from \\"CommonJS_Clobbering_Class\\"; // Error -import CJS_Clobb_Class from \"CommonJS_Clobbering_Class\"; +import CJS_Clobb_Class from \\"CommonJS_Clobbering_Class\\"; new CJS_Clobb_Class(); new CJS_Clobb_Class().doesntExist; // Error: Class has no \`doesntExist\` property var h1: number = CJS_Clobb_Class.staticNumber2(); @@ -1065,8 +1067,8 @@ var h2: string = CJS_Clobb_Class.staticNumber2(); // Error: number ~> string var h3: number = new CJS_Clobb_Class().instNumber1(); var h4: string = new CJS_Clobb_Class().instNumber1(); // Error: number ~> string -import * as CJS_Clobb_Class_NS from \"CommonJS_Clobbering_Class\"; -new CJS_Clobb_Class_NS(); // Error: Namespace object isn\'t constructable +import * as CJS_Clobb_Class_NS from \\"CommonJS_Clobbering_Class\\"; +new CJS_Clobb_Class_NS(); // Error: Namespace object isn't constructable var i1: number = CJS_Clobb_Class_NS.staticNumber3(); // Error: Class statics not copied to Namespace object var i2: number = new CJS_Clobb_Class_NS.default().instNumber2(); var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: number ~> string @@ -1075,22 +1077,22 @@ var i3: string = new CJS_Clobb_Class_NS.default().instNumber2(); // Error: numbe // == CommonJS Named Exports -> ES6 == // // =================================== // -import { doesntExist3 } from \"CommonJS_Named\"; // Error: Not an exported binding +import { doesntExist3 } from \\"CommonJS_Named\\"; // Error: Not an exported binding -import { numberValue2 } from \"CommonJS_Named\"; +import { numberValue2 } from \\"CommonJS_Named\\"; var j1: number = numberValue2; var j2: string = numberValue2; // Error: number ~> string -import { numberValue3 as numVal3 } from \"CommonJS_Named\"; +import { numberValue3 as numVal3 } from \\"CommonJS_Named\\"; var k1: number = numVal3; var k2: string = numVal3; // Error: number ~> string -import * as CJS_Named from \"CommonJS_Named\"; +import * as CJS_Named from \\"CommonJS_Named\\"; var l1: number = CJS_Named.numberValue1; var l2: string = CJS_Named.numberValue1; // Error: number ~> string -CJS_Named.doesntExist; // Error: doesntExist isn\'t a property +CJS_Named.doesntExist; // Error: doesntExist isn't a property -import * as CJS_Named_NS from \"CommonJS_Named\"; +import * as CJS_Named_NS from \\"CommonJS_Named\\"; var m1: number = CJS_Named_NS.numberValue4; var m2: string = CJS_Named_NS.default.numberValue4; // Error: CommonJS_Named has no default export var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string @@ -1099,21 +1101,21 @@ var m3: string = CJS_Named_NS.numberValue4; // Error: number ~> string // == ES6 Default -> ES6 == // ////////////////////////////// -import { doesntExist4 } from \"ES6_Default_AnonFunction1\"; // Error: Not an exported binding +import { doesntExist4 } from \\"ES6_Default_AnonFunction1\\"; // Error: Not an exported binding -import ES6_Def_AnonFunc1 from \"ES6_Default_AnonFunction1\"; +import ES6_Def_AnonFunc1 from \\"ES6_Default_AnonFunction1\\"; var n1: number = ES6_Def_AnonFunc1(); var n2: string = ES6_Def_AnonFunc1(); // Error: number ~> string -import ES6_Def_NamedFunc1 from \"ES6_Default_NamedFunction1\"; +import ES6_Def_NamedFunc1 from \\"ES6_Default_NamedFunction1\\"; var o1: number = ES6_Def_NamedFunc1(); var o2: string = ES6_Def_NamedFunc1(); // Error: number ~> string -import ES6_Def_AnonClass1 from \"ES6_Default_AnonClass1\"; +import ES6_Def_AnonClass1 from \\"ES6_Default_AnonClass1\\"; var p1: number = new ES6_Def_AnonClass1().givesANum(); var p2: string = new ES6_Def_AnonClass1().givesANum(); // Error: number ~> string -import ES6_Def_NamedClass1 from \"ES6_Default_NamedClass1\"; +import ES6_Def_NamedClass1 from \\"ES6_Default_NamedClass1\\"; var q1: number = new ES6_Def_NamedClass1().givesANum(); var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> string @@ -1121,57 +1123,57 @@ var q2: string = new ES6_Def_NamedClass1().givesANum(); // Error: number ~> stri // == ES6 Named -> ES6 == // //////////////////////////// -import doesntExist5 from \"ES6_Named1\"; // Error: Not an exported binding +import doesntExist5 from \\"ES6_Named1\\"; // Error: Not an exported binding -import { specifierNumber1 as specifierNumber1_1 } from \"ES6_Named1\"; +import { specifierNumber1 as specifierNumber1_1 } from \\"ES6_Named1\\"; var r1: number = specifierNumber1_1; var r2: string = specifierNumber1_1; // Error: number ~> string -import { specifierNumber2Renamed } from \"ES6_Named1\"; +import { specifierNumber2Renamed } from \\"ES6_Named1\\"; var s1: number = specifierNumber2Renamed; var s2: string = specifierNumber2Renamed; // Error: number ~> string -import { specifierNumber3 as specifierNumber3Renamed } from \"ES6_Named1\"; +import { specifierNumber3 as specifierNumber3Renamed } from \\"ES6_Named1\\"; var t1: number = specifierNumber3Renamed; var t2: string = specifierNumber3Renamed; // Error: number ~> string -import { groupedSpecifierNumber1, groupedSpecifierNumber2 } from \"ES6_Named1\"; +import { groupedSpecifierNumber1, groupedSpecifierNumber2 } from \\"ES6_Named1\\"; var u1: number = groupedSpecifierNumber1; var u2: number = groupedSpecifierNumber2; var u3: string = groupedSpecifierNumber1; // Error: number ~> string var u4: string = groupedSpecifierNumber2; // Error: number ~> string -import { givesANumber } from \"ES6_Named1\"; +import { givesANumber } from \\"ES6_Named1\\"; var v1: number = givesANumber(); var v2: string = givesANumber(); // Error: number ~> string -import { NumberGenerator } from \"ES6_Named1\"; +import { NumberGenerator } from \\"ES6_Named1\\"; var w1: number = new NumberGenerator().givesANumber(); var w2: string = new NumberGenerator().givesANumber(); // Error: number ~> string -import { varDeclNumber1, varDeclNumber2 } from \"ES6_Named1\"; +import { varDeclNumber1, varDeclNumber2 } from \\"ES6_Named1\\"; var x1: number = varDeclNumber1; var x2: number = varDeclNumber2; var x3: string = varDeclNumber1; // Error: number ~> string var x4: string = varDeclNumber2; // Error: number ~> string -import { destructuredObjNumber } from \"ES6_Named1\"; +import { destructuredObjNumber } from \\"ES6_Named1\\"; var y1: number = destructuredObjNumber; var y2: string = destructuredObjNumber; // Error: number ~> string -import { destructuredArrNumber } from \"ES6_Named1\"; +import { destructuredArrNumber } from \\"ES6_Named1\\"; var z1: number = destructuredArrNumber; var z2: string = destructuredArrNumber; // Error: number ~> string -import { numberValue1 as numberValue4 } from \"ES6_ExportFrom_Intermediary1\"; +import { numberValue1 as numberValue4 } from \\"ES6_ExportFrom_Intermediary1\\"; var aa1: number = numberValue4; var aa2: string = numberValue4; // Error: number ~> string -import { numberValue2_renamed } from \"ES6_ExportFrom_Intermediary1\"; +import { numberValue2_renamed } from \\"ES6_ExportFrom_Intermediary1\\"; var ab1: number = numberValue2_renamed; var ab2: string = numberValue2_renamed; // Error: number ~> string -import { numberValue1 as numberValue5 } from \"ES6_ExportAllFrom_Intermediary1\"; +import { numberValue1 as numberValue5 } from \\"ES6_ExportAllFrom_Intermediary1\\"; var ac1: number = numberValue5; var ac2: string = numberValue5; // Error: number ~> string @@ -1179,21 +1181,21 @@ var ac2: string = numberValue5; // Error: number ~> string // == ES6 Default -> CommonJS == // /////////////////////////////////// -require(\"ES6_Default_AnonFunction2\").doesntExist; // Error: \'doesntExist\' isn\'t an export +require(\\"ES6_Default_AnonFunction2\\").doesntExist; // Error: 'doesntExist' isn't an export -var ES6_Def_AnonFunc2 = require(\"ES6_Default_AnonFunction2\").default; +var ES6_Def_AnonFunc2 = require(\\"ES6_Default_AnonFunction2\\").default; var ad1: number = ES6_Def_AnonFunc2(); var ad2: string = ES6_Def_AnonFunc2(); // Error: number ~> string -var ES6_Def_NamedFunc2 = require(\"ES6_Default_NamedFunction2\").default; +var ES6_Def_NamedFunc2 = require(\\"ES6_Default_NamedFunction2\\").default; var ae1: number = ES6_Def_NamedFunc2(); var ae2: string = ES6_Def_NamedFunc2(); // Error: number ~> string -var ES6_Def_AnonClass2 = require(\"ES6_Default_AnonClass2\").default; +var ES6_Def_AnonClass2 = require(\\"ES6_Default_AnonClass2\\").default; var af1: number = new ES6_Def_AnonClass2().givesANum(); var af2: string = new ES6_Def_AnonClass2().givesANum(); // Error: number ~> string -var ES6_Def_NamedClass2 = require(\"ES6_Default_NamedClass2\").default; +var ES6_Def_NamedClass2 = require(\\"ES6_Default_NamedClass2\\").default; var ag1: number = new ES6_Def_NamedClass2().givesANum(); var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> string @@ -1201,55 +1203,55 @@ var ag2: string = new ES6_Def_NamedClass2().givesANum(); // Error: number ~> str // == ES6 Named -> CommonJS == // ///////////////////////////////// -var specifierNumber4 = require(\"ES6_Named2\").specifierNumber4; +var specifierNumber4 = require(\\"ES6_Named2\\").specifierNumber4; var ah1: number = specifierNumber4; var ah2: string = specifierNumber4; // Error: number ~> string -var specifierNumber5Renamed = require(\"ES6_Named2\").specifierNumber5Renamed; +var specifierNumber5Renamed = require(\\"ES6_Named2\\").specifierNumber5Renamed; var ai1: number = specifierNumber5Renamed; var ai2: string = specifierNumber5Renamed; // Error: number ~> string -var groupedSpecifierNumber3 = require(\"ES6_Named2\").groupedSpecifierNumber3; -var groupedSpecifierNumber4 = require(\"ES6_Named2\").groupedSpecifierNumber4; +var groupedSpecifierNumber3 = require(\\"ES6_Named2\\").groupedSpecifierNumber3; +var groupedSpecifierNumber4 = require(\\"ES6_Named2\\").groupedSpecifierNumber4; var aj1: number = groupedSpecifierNumber3; var aj2: number = groupedSpecifierNumber4; var aj3: string = groupedSpecifierNumber3; // Error: number ~> string var aj4: string = groupedSpecifierNumber4; // Error: number ~> string -var givesANumber2 = require(\"ES6_Named2\").givesANumber2; +var givesANumber2 = require(\\"ES6_Named2\\").givesANumber2; var ak1: number = givesANumber2(); var ak2: string = givesANumber2(); // Error: number ~> string -var NumberGenerator2 = require(\"ES6_Named2\").NumberGenerator2; +var NumberGenerator2 = require(\\"ES6_Named2\\").NumberGenerator2; var al1: number = new NumberGenerator2().givesANumber(); var al2: string = new NumberGenerator2().givesANumber(); // Error: number ~> string -var varDeclNumber3 = require(\"ES6_Named2\").varDeclNumber3; -var varDeclNumber4 = require(\"ES6_Named2\").varDeclNumber4; +var varDeclNumber3 = require(\\"ES6_Named2\\").varDeclNumber3; +var varDeclNumber4 = require(\\"ES6_Named2\\").varDeclNumber4; var am1: number = varDeclNumber3; var am2: number = varDeclNumber4; var am3: string = varDeclNumber3; // Error: number ~> string var am4: string = varDeclNumber4; // Error: number ~> string -var destructuredObjNumber2 = require(\"ES6_Named2\").destructuredObjNumber2; +var destructuredObjNumber2 = require(\\"ES6_Named2\\").destructuredObjNumber2; var an1: number = destructuredObjNumber2; var an2: string = destructuredObjNumber2; // Error: number ~> string -var destructuredArrNumber2 = require(\"ES6_Named2\").destructuredArrNumber2; +var destructuredArrNumber2 = require(\\"ES6_Named2\\").destructuredArrNumber2; var ao1: number = destructuredArrNumber2; var ao2: string = destructuredArrNumber2; // Error: number ~> string -var numberValue6 = require(\"ES6_ExportFrom_Intermediary2\").numberValue1; +var numberValue6 = require(\\"ES6_ExportFrom_Intermediary2\\").numberValue1; var ap1: number = numberValue6; var ap2: string = numberValue6; // Error: number ~> string var numberValue2_renamed2 = require( - \"ES6_ExportFrom_Intermediary2\" + \\"ES6_ExportFrom_Intermediary2\\" ).numberValue2_renamed2; var aq1: number = numberValue2_renamed2; var aq2: string = numberValue2_renamed2; // Error: number ~> string -var numberValue7 = require(\"ES6_ExportAllFrom_Intermediary2\").numberValue2; +var numberValue7 = require(\\"ES6_ExportAllFrom_Intermediary2\\").numberValue2; var ar1: number = numberValue7; var ar2: string = numberValue7; // Error: number ~> string @@ -1257,7 +1259,7 @@ var ar2: string = numberValue7; // Error: number ~> string // == ES6 Default+Named -> ES6 import Default+Named== // //////////////////////////////////////////////////////// -import defaultNum, { str as namedStr } from \"./ES6_DefaultAndNamed\"; +import defaultNum, { str as namedStr } from \\"./ES6_DefaultAndNamed\\"; var as1: number = defaultNum; var as2: string = defaultNum; // Error: number ~> string @@ -1269,13 +1271,13 @@ var as4: number = namedStr; // Error: string ~> number // == Side-effect only ES6 imports == // //////////////////////////////////////// -import \"./SideEffects\"; +import \\"./SideEffects\\"; ////////////////////////////////////////////// // == Suggest export name on likely typo == // ////////////////////////////////////////////// -import specifierNumber1 from \"ES6_Named1\"; // Error: Did you mean \`import {specifierNumber1} from ...\`? -import { specifierNumber } from \"ES6_Named1\"; // Error: Did you mean \`specifierNumber1\`? +import specifierNumber1 from \\"ES6_Named1\\"; // Error: Did you mean \`import {specifierNumber1} from ...\`? +import { specifierNumber } from \\"ES6_Named1\\"; // Error: Did you mean \`specifierNumber1\`? /////////////////////////////////////////////////// // == Multi \`export *\` should combine exports == // @@ -1283,7 +1285,7 @@ import { specifierNumber } from \"ES6_Named1\"; // Error: Did you mean \`specifi import { numberValue1 as numberValue8, numberValue2 as numberValue9 -} from \"./ES6_ExportAllFromMulti\"; +} from \\"./ES6_ExportAllFromMulti\\"; var at1: number = numberValue8; var at2: string = numberValue8; // Error: number ~> string @@ -1294,11 +1296,11 @@ var at4: string = numberValue9; // Error: number ~> string ///////////////////////////////////////////////////////////// // == Vanilla \`import\` cannot import a type-only export == // ///////////////////////////////////////////////////////////// -import { typeAlias } from \"./ExportType\"; // Error: Cannot vanilla-import a type alias! +import { typeAlias } from \\"./ExportType\\"; // Error: Cannot vanilla-import a type alias! " `; -exports[`test test_imports_are_frozen.js 1`] = ` +exports[`test_imports_are_frozen.js 1`] = ` "/* @flow */ // @@ -1306,27 +1308,27 @@ exports[`test test_imports_are_frozen.js 1`] = ` // // CommonJS module -import * as DefaultA from \"A\"; +import * as DefaultA from \\"A\\"; DefaultA.numberValue1 = 123; // Error: DefaultA is frozen // ES6 module -import * as ES6_Named1 from \"ES6_Named1\"; +import * as ES6_Named1 from \\"ES6_Named1\\"; ES6_Named1.varDeclNumber1 = 123; // Error: ES6_Named1 is frozen // CommonJS module that clobbers module.exports -import * as CommonJS_Star from \"CommonJS_Clobbering_Lit\"; +import * as CommonJS_Star from \\"CommonJS_Clobbering_Lit\\"; CommonJS_Star.numberValue1 = 123; // Error: frozen CommonJS_Star.default.numberValue1 = 123; // ok -import CommonJS_Clobbering_Lit from \"CommonJS_Clobbering_Lit\"; +import CommonJS_Clobbering_Lit from \\"CommonJS_Clobbering_Lit\\"; CommonJS_Clobbering_Lit.numberValue1 = 123; // ok // CommonJS module that clobbers module.exports with a frozen object -import * as CommonJS_Frozen_Star from \"CommonJS_Clobbering_Frozen\"; +import * as CommonJS_Frozen_Star from \\"CommonJS_Clobbering_Frozen\\"; CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen CommonJS_Frozen_Star.default.numberValue1 = 123; // Error: frozen -import CommonJS_Clobbering_Frozen from \"CommonJS_Clobbering_Frozen\"; +import CommonJS_Clobbering_Frozen from \\"CommonJS_Clobbering_Frozen\\"; CommonJS_Clobbering_Frozen.numberValue1 = 123; // Error: exports are frozen @@ -1336,19 +1338,19 @@ CommonJS_Clobbering_Frozen.numberValue1 = 123; // Error: exports are frozen function testRequires() { // CommonJS module - var DefaultA = require(\"A\"); + var DefaultA = require(\\"A\\"); DefaultA.numberValue1 = 123; // ok, not frozen by default // ES6 module - var ES6_Named1 = require(\"ES6_Named1\"); + var ES6_Named1 = require(\\"ES6_Named1\\"); ES6_Named1.numberValue = 123; // error, es6 exports are frozen // CommonJS module that clobbers module.exports - var CommonJS_Star = require(\"CommonJS_Clobbering_Lit\"); + var CommonJS_Star = require(\\"CommonJS_Clobbering_Lit\\"); CommonJS_Star.numberValue1 = 123; // ok, not frozen by default // CommonJS module that clobbers module.exports with a frozen object - var CommonJS_Frozen_Star = require(\"CommonJS_Clobbering_Frozen\"); + var CommonJS_Frozen_Star = require(\\"CommonJS_Clobbering_Frozen\\"); CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1359,27 +1361,27 @@ function testRequires() { // // CommonJS module -import * as DefaultA from \"A\"; +import * as DefaultA from \\"A\\"; DefaultA.numberValue1 = 123; // Error: DefaultA is frozen // ES6 module -import * as ES6_Named1 from \"ES6_Named1\"; +import * as ES6_Named1 from \\"ES6_Named1\\"; ES6_Named1.varDeclNumber1 = 123; // Error: ES6_Named1 is frozen // CommonJS module that clobbers module.exports -import * as CommonJS_Star from \"CommonJS_Clobbering_Lit\"; +import * as CommonJS_Star from \\"CommonJS_Clobbering_Lit\\"; CommonJS_Star.numberValue1 = 123; // Error: frozen CommonJS_Star.default.numberValue1 = 123; // ok -import CommonJS_Clobbering_Lit from \"CommonJS_Clobbering_Lit\"; +import CommonJS_Clobbering_Lit from \\"CommonJS_Clobbering_Lit\\"; CommonJS_Clobbering_Lit.numberValue1 = 123; // ok // CommonJS module that clobbers module.exports with a frozen object -import * as CommonJS_Frozen_Star from \"CommonJS_Clobbering_Frozen\"; +import * as CommonJS_Frozen_Star from \\"CommonJS_Clobbering_Frozen\\"; CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen CommonJS_Frozen_Star.default.numberValue1 = 123; // Error: frozen -import CommonJS_Clobbering_Frozen from \"CommonJS_Clobbering_Frozen\"; +import CommonJS_Clobbering_Frozen from \\"CommonJS_Clobbering_Frozen\\"; CommonJS_Clobbering_Frozen.numberValue1 = 123; // Error: exports are frozen // @@ -1388,19 +1390,19 @@ CommonJS_Clobbering_Frozen.numberValue1 = 123; // Error: exports are frozen function testRequires() { // CommonJS module - var DefaultA = require(\"A\"); + var DefaultA = require(\\"A\\"); DefaultA.numberValue1 = 123; // ok, not frozen by default // ES6 module - var ES6_Named1 = require(\"ES6_Named1\"); + var ES6_Named1 = require(\\"ES6_Named1\\"); ES6_Named1.numberValue = 123; // error, es6 exports are frozen // CommonJS module that clobbers module.exports - var CommonJS_Star = require(\"CommonJS_Clobbering_Lit\"); + var CommonJS_Star = require(\\"CommonJS_Clobbering_Lit\\"); CommonJS_Star.numberValue1 = 123; // ok, not frozen by default // CommonJS module that clobbers module.exports with a frozen object - var CommonJS_Frozen_Star = require(\"CommonJS_Clobbering_Frozen\"); + var CommonJS_Frozen_Star = require(\\"CommonJS_Clobbering_Frozen\\"); CommonJS_Frozen_Star.numberValue1 = 123; // Error: frozen } " diff --git a/tests/flow/es_declare_module/__snapshots__/jsfmt.spec.js.snap b/tests/flow/es_declare_module/__snapshots__/jsfmt.spec.js.snap index 388bf141e..99e787605 100644 --- a/tests/flow/es_declare_module/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/es_declare_module/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test es_declare_module.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`es_declare_module.js 1`] = ` "// @flow -import {num1, str1} from \"CJS_Named\"; -import CJS_Named from \"CJS_Named\"; +import {num1, str1} from \\"CJS_Named\\"; +import CJS_Named from \\"CJS_Named\\"; (num1: number); (num1: string); // Error: number ~> string (str1: string); @@ -10,41 +12,41 @@ import CJS_Named from \"CJS_Named\"; (CJS_Named: {num1: number, str1: string}); (CJS_Named: number); // Error: Module ~> number -import {num2} from \"CJS_Clobbered\"; // Error: No such export! -import {numExport} from \"CJS_Clobbered\"; +import {num2} from \\"CJS_Clobbered\\"; // Error: No such export! +import {numExport} from \\"CJS_Clobbered\\"; (numExport: number); (numExport: string); // Error: number ~> string -import type {numType} from \"CJS_Clobbered\"; +import type {numType} from \\"CJS_Clobbered\\"; (42: numType); -(\'asdf\': numType); // Error: string ~> number +('asdf': numType); // Error: string ~> number -import {strHidden} from \"ES\"; // Error: No such export! -import {str3} from \"ES\"; +import {strHidden} from \\"ES\\"; // Error: No such export! +import {str3} from \\"ES\\"; (str3: string); (str3: number); // Error: string ~> number -import {num3} from \"ES\"; +import {num3} from \\"ES\\"; (num3: number); (num3: string); // Error: number ~> string -import {C} from \"ES\"; -import type {C as CType} from \"ES\"; +import {C} from \\"ES\\"; +import type {C as CType} from \\"ES\\"; (new C(): C); (42: C); // Error: number ~> C (new C(): CType); (42: CType); // Error: number ~> CType -import {T} from \"ES\"; // Error: T is a type import, not a value -import type {T as T2} from \"ES\"; +import {T} from \\"ES\\"; // Error: T is a type import, not a value +import type {T as T2} from \\"ES\\"; (42: T2); -(\'asdf\': T2); // Error: string ~> number +('asdf': T2); // Error: string ~> number -import {exports as nope} from \"ES\"; // Error: Not an export +import {exports as nope} from \\"ES\\"; // Error: Not an export ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { num1, str1 } from \"CJS_Named\"; -import CJS_Named from \"CJS_Named\"; +import { num1, str1 } from \\"CJS_Named\\"; +import CJS_Named from \\"CJS_Named\\"; (num1: number); (num1: string); // Error: number ~> string (str1: string); @@ -52,35 +54,35 @@ import CJS_Named from \"CJS_Named\"; (CJS_Named: { num1: number, str1: string }); (CJS_Named: number); // Error: Module ~> number -import { num2 } from \"CJS_Clobbered\"; // Error: No such export! -import { numExport } from \"CJS_Clobbered\"; +import { num2 } from \\"CJS_Clobbered\\"; // Error: No such export! +import { numExport } from \\"CJS_Clobbered\\"; (numExport: number); (numExport: string); // Error: number ~> string -import type { numType } from \"CJS_Clobbered\"; +import type { numType } from \\"CJS_Clobbered\\"; (42: numType); -(\"asdf\": numType); // Error: string ~> number +(\\"asdf\\": numType); // Error: string ~> number -import { strHidden } from \"ES\"; // Error: No such export! -import { str3 } from \"ES\"; +import { strHidden } from \\"ES\\"; // Error: No such export! +import { str3 } from \\"ES\\"; (str3: string); (str3: number); // Error: string ~> number -import { num3 } from \"ES\"; +import { num3 } from \\"ES\\"; (num3: number); (num3: string); // Error: number ~> string -import { C } from \"ES\"; -import type { C as CType } from \"ES\"; +import { C } from \\"ES\\"; +import type { C as CType } from \\"ES\\"; (new C(): C); (42: C); // Error: number ~> C (new C(): CType); (42: CType); // Error: number ~> CType -import { T } from \"ES\"; // Error: T is a type import, not a value -import type { T as T2 } from \"ES\"; +import { T } from \\"ES\\"; // Error: T is a type import, not a value +import type { T as T2 } from \\"ES\\"; (42: T2); -(\"asdf\": T2); // Error: string ~> number +(\\"asdf\\": T2); // Error: string ~> number -import { exports as nope } from \"ES\"; // Error: Not an export +import { exports as nope } from \\"ES\\"; // Error: Not an export " `; diff --git a/tests/flow/es_declare_module/flow-typed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/es_declare_module/flow-typed/__snapshots__/jsfmt.spec.js.snap index c0b42de4a..956a0dc95 100644 --- a/tests/flow/es_declare_module/flow-typed/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/es_declare_module/flow-typed/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test declares.js 1`] = ` -"declare module \"CJS_Named\" { +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`declares.js 1`] = ` +"declare module \\"CJS_Named\\" { declare var num1: number; declare var str1: string; } -declare module \"CJS_Clobbered\" { +declare module \\"CJS_Clobbered\\" { declare var num2: number; declare type numType = number; declare var exports: { @@ -12,7 +14,7 @@ declare module \"CJS_Clobbered\" { }; } -declare module \"ES\" { +declare module \\"ES\\" { declare var strHidden: string; declare export {strHidden as str3}; declare export var num3: number; @@ -21,18 +23,18 @@ declare module \"ES\" { declare var exports: number; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -declare module \"CJS_Named\" { +declare module \\"CJS_Named\\" { declare var num1: number; declare var str1: string; } -declare module \"CJS_Clobbered\" { +declare module \\"CJS_Clobbered\\" { declare var num2: number; declare type numType = number; declare var exports: { numExport: number }; } -declare module \"ES\" { +declare module \\"ES\\" { declare var strHidden: string; declare export { strHidden as str3 }; declare export var num3: number; diff --git a/tests/flow/esproposal_export_star_as.enable/__snapshots__/jsfmt.spec.js.snap b/tests/flow/esproposal_export_star_as.enable/__snapshots__/jsfmt.spec.js.snap index 0b5eff838..e600eff14 100644 --- a/tests/flow/esproposal_export_star_as.enable/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/esproposal_export_star_as.enable/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,9 @@ -exports[`test dest.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`dest.js 1`] = ` "// @flow -import {source} from \"./test\"; +import {source} from \\"./test\\"; var a: number = source.num; var b: string = source.num; // Error: num ~> string @@ -11,7 +13,7 @@ var d: number = source.str; // Error: num ~> string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { source } from \"./test\"; +import { source } from \\"./test\\"; var a: number = source.num; var b: string = source.num; // Error: num ~> string @@ -21,15 +23,15 @@ var d: number = source.str; // Error: num ~> string " `; -exports[`test source.js 1`] = ` +exports[`source.js 1`] = ` "// @flow -export var str = \'asdf\'; +export var str = 'asdf'; export var num = 42; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -export var str = \"asdf\"; +export var str = \\"asdf\\"; export var num = 42; " `; diff --git a/tests/flow/esproposal_export_star_as.ignore/__snapshots__/jsfmt.spec.js.snap b/tests/flow/esproposal_export_star_as.ignore/__snapshots__/jsfmt.spec.js.snap index d9d3df610..4c408ba98 100644 --- a/tests/flow/esproposal_export_star_as.ignore/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/esproposal_export_star_as.ignore/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,9 @@ -exports[`test dest.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`dest.js 1`] = ` "// @flow -import {source} from \"./test\"; +import {source} from \\"./test\\"; var a: number = source.num; var b: string = source.num; // Error: num ~> string @@ -11,7 +13,7 @@ var d: number = source.str; // Ignored error: num ~> string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { source } from \"./test\"; +import { source } from \\"./test\\"; var a: number = source.num; var b: string = source.num; // Error: num ~> string @@ -21,15 +23,15 @@ var d: number = source.str; // Ignored error: num ~> string " `; -exports[`test source.js 1`] = ` +exports[`source.js 1`] = ` "// @flow -export var str = \'asdf\'; +export var str = 'asdf'; export var num = 42; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -export var str = \"asdf\"; +export var str = \\"asdf\\"; export var num = 42; " `; diff --git a/tests/flow/export_default/__snapshots__/jsfmt.spec.js.snap b/tests/flow/export_default/__snapshots__/jsfmt.spec.js.snap index e7fa97fb4..37a848cf5 100644 --- a/tests/flow/export_default/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/export_default/__snapshots__/jsfmt.spec.js.snap @@ -1,25 +1,27 @@ -exports[`test P.js 1`] = ` -"module.exports = require(\'M\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`P.js 1`] = ` +"module.exports = require('M'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = require(\"M\"); +module.exports = require(\\"M\\"); " `; -exports[`test test.js 1`] = ` -"var M = require(\'M\'); -var N = require(\'N\'); +exports[`test.js 1`] = ` +"var M = require('M'); +var N = require('N'); N.x = M(N.x); -var P = require(\'./P\'); // implementation of P redirects to module M +var P = require('./P'); // implementation of P redirects to module M N.y = P(N.y); -var Q = require(\'Q\'); // declaration of Q redirects to module M +var Q = require('Q'); // declaration of Q redirects to module M N.z = Q(N.z); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var M = require(\"M\"); -var N = require(\"N\"); +var M = require(\\"M\\"); +var N = require(\\"N\\"); N.x = M(N.x); -var P = require(\"./P\"); // implementation of P redirects to module M +var P = require(\\"./P\\"); // implementation of P redirects to module M N.y = P(N.y); -var Q = require(\"Q\"); // declaration of Q redirects to module M +var Q = require(\\"Q\\"); // declaration of Q redirects to module M N.z = Q(N.z); " `; diff --git a/tests/flow/export_default/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/export_default/lib/__snapshots__/jsfmt.spec.js.snap index 6d1560fc3..dca6b58f3 100644 --- a/tests/flow/export_default/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/export_default/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test lib.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`lib.js 1`] = ` "declare module M { declare function exports(x:string): string; } @@ -8,7 +10,7 @@ declare module N { declare var z: number; } declare module Q { - declare var exports: $Exports<\'M\'>; + declare var exports: $Exports<'M'>; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare module M { @@ -20,7 +22,7 @@ declare module N { declare var z: number; } declare module Q { - declare var exports: $Exports<\"M\">; + declare var exports: $Exports<\\"M\\">; } " `; diff --git a/tests/flow/export_type/__snapshots__/jsfmt.spec.js.snap b/tests/flow/export_type/__snapshots__/jsfmt.spec.js.snap index 30a674eeb..83f6f2094 100644 --- a/tests/flow/export_type/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/export_type/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test cjs_with_types.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`cjs_with_types.js 1`] = ` "/* @flow */ export type talias4 = number; @@ -15,7 +17,7 @@ module.exports = {}; " `; -exports[`test importer.js 1`] = ` +exports[`importer.js 1`] = ` "/* @flow */ import type { @@ -23,30 +25,30 @@ import type { standaloneType1, talias1, talias3, -} from \"./types_only\"; +} from \\"./types_only\\"; var a: inlinedType1 = 42; -var b: inlinedType1 = \'asdf\'; // Error: string ~> number +var b: inlinedType1 = 'asdf'; // Error: string ~> number var c: standaloneType1 = 42; -var d: standaloneType1 = \'asdf\'; // Error: string ~> number +var d: standaloneType1 = 'asdf'; // Error: string ~> number var e: talias1 = 42; -var f: talias1 = \'asdf\'; // Error: string ~> number +var f: talias1 = 'asdf'; // Error: string ~> number var g: talias3 = 42; -var h: talias3 = \'asdf\'; // Error: string ~> number +var h: talias3 = 'asdf'; // Error: string ~> number -import type {talias4} from \"./cjs_with_types\"; +import type {talias4} from \\"./cjs_with_types\\"; var i: talias4 = 42; -var j: talias4 = \'asdf\'; // Error: string ~> number +var j: talias4 = 'asdf'; // Error: string ~> number -import {IFoo, IFoo2} from \"./types_only\"; +import {IFoo, IFoo2} from \\"./types_only\\"; var k: IFoo = {prop: 42}; -var l: IFoo = {prop: \'asdf\'}; // Error: {prop:string} ~> {prop:number} +var l: IFoo = {prop: 'asdf'}; // Error: {prop:string} ~> {prop:number} -var m: IFoo2 = {prop: \'asdf\'}; +var m: IFoo2 = {prop: 'asdf'}; var n: IFoo2 = {prop: 42}; // Error: {prop:number} ~> {prop:string} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -56,40 +58,40 @@ import type { standaloneType1, talias1, talias3 -} from \"./types_only\"; +} from \\"./types_only\\"; var a: inlinedType1 = 42; -var b: inlinedType1 = \"asdf\"; // Error: string ~> number +var b: inlinedType1 = \\"asdf\\"; // Error: string ~> number var c: standaloneType1 = 42; -var d: standaloneType1 = \"asdf\"; // Error: string ~> number +var d: standaloneType1 = \\"asdf\\"; // Error: string ~> number var e: talias1 = 42; -var f: talias1 = \"asdf\"; // Error: string ~> number +var f: talias1 = \\"asdf\\"; // Error: string ~> number var g: talias3 = 42; -var h: talias3 = \"asdf\"; // Error: string ~> number +var h: talias3 = \\"asdf\\"; // Error: string ~> number -import type { talias4 } from \"./cjs_with_types\"; +import type { talias4 } from \\"./cjs_with_types\\"; var i: talias4 = 42; -var j: talias4 = \"asdf\"; // Error: string ~> number +var j: talias4 = \\"asdf\\"; // Error: string ~> number -import { IFoo, IFoo2 } from \"./types_only\"; +import { IFoo, IFoo2 } from \\"./types_only\\"; var k: IFoo = { prop: 42 }; -var l: IFoo = { prop: \"asdf\" }; // Error: {prop:string} ~> {prop:number} +var l: IFoo = { prop: \\"asdf\\" }; // Error: {prop:string} ~> {prop:number} -var m: IFoo2 = { prop: \"asdf\" }; +var m: IFoo2 = { prop: \\"asdf\\" }; var n: IFoo2 = { prop: 42 }; // Error: {prop:number} ~> {prop:string} " `; -exports[`test types_only.js 1`] = ` +exports[`types_only.js 1`] = ` "/* @flow */ export type inlinedType1 = number; var a: inlinedType1 = 42; -var b: inlinedType1 = \'asdf\'; // Error: string ~> number +var b: inlinedType1 = 'asdf'; // Error: string ~> number type standaloneType1 = number; export type {standaloneType1}; @@ -97,7 +99,7 @@ export type {standaloneType1}; type standaloneType2 = number; export {standaloneType2}; // Error: Missing \`type\` keyword -export type {talias1, talias2 as talias3, IFoo2} from \"./types_only2\"; +export type {talias1, talias2 as talias3, IFoo2} from \\"./types_only2\\"; export interface IFoo { prop: number }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -105,7 +107,7 @@ export interface IFoo { prop: number }; export type inlinedType1 = number; var a: inlinedType1 = 42; -var b: inlinedType1 = \"asdf\"; // Error: string ~> number +var b: inlinedType1 = \\"asdf\\"; // Error: string ~> number type standaloneType1 = number; export type { standaloneType1 }; @@ -113,13 +115,13 @@ export type { standaloneType1 }; type standaloneType2 = number; export { standaloneType2 }; // Error: Missing \`type\` keyword -export type { talias1, talias2 as talias3, IFoo2 } from \"./types_only2\"; +export type { talias1, talias2 as talias3, IFoo2 } from \\"./types_only2\\"; export interface IFoo { prop: number } " `; -exports[`test types_only2.js 1`] = ` +exports[`types_only2.js 1`] = ` "/* @flow */ export type talias1 = number; diff --git a/tests/flow/extensions/__snapshots__/jsfmt.spec.js.snap b/tests/flow/extensions/__snapshots__/jsfmt.spec.js.snap index 524d171e6..4067aab70 100644 --- a/tests/flow/extensions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/extensions/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test foo.js 1`] = ` -"var imp = require(\'./bar\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` +"var imp = require('./bar'); imp(1337); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var imp = require(\"./bar\"); +var imp = require(\\"./bar\\"); imp(1337); " `; diff --git a/tests/flow/facebook_fbt_none/__snapshots__/jsfmt.spec.js.snap b/tests/flow/facebook_fbt_none/__snapshots__/jsfmt.spec.js.snap index 29f2d9815..ad5b6a5fa 100644 --- a/tests/flow/facebook_fbt_none/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/facebook_fbt_none/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test main.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`main.js 1`] = ` "// @flow -var React = require(\'react\'); +var React = require('react'); (: React.Element<*>); (: number); // Error: ReactElement ~> number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var React = require(\"react\"); +var React = require(\\"react\\"); (: React.Element<*>); (: number); // Error: ReactElement ~> number " diff --git a/tests/flow/facebook_fbt_some/__snapshots__/jsfmt.spec.js.snap b/tests/flow/facebook_fbt_some/__snapshots__/jsfmt.spec.js.snap index 407d4a20e..69430b2de 100644 --- a/tests/flow/facebook_fbt_some/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/facebook_fbt_some/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test main.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`main.js 1`] = ` "// @flow (: number); diff --git a/tests/flow/facebook_fbt_some/flow-typed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/facebook_fbt_some/flow-typed/__snapshots__/jsfmt.spec.js.snap index cba08a2ce..d035b074a 100644 --- a/tests/flow/facebook_fbt_some/flow-typed/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/facebook_fbt_some/flow-typed/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test fbt.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`fbt.js 1`] = ` "type Fbt = number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ type Fbt = number; diff --git a/tests/flow/facebookisms/__snapshots__/jsfmt.spec.js.snap b/tests/flow/facebookisms/__snapshots__/jsfmt.spec.js.snap index 0f4a557da..e85d29006 100644 --- a/tests/flow/facebookisms/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/facebookisms/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test Bar.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Bar.js 1`] = ` "var Bar = { x: 0 }; module.exports = Bar; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -7,7 +9,7 @@ module.exports = Bar; " `; -exports[`test copyProperties.js 1`] = ` +exports[`copyProperties.js 1`] = ` "// @flow let tests = [ @@ -22,15 +24,15 @@ let tests = [ result.baz = false; (copyProperties( result, - { foo: \'a\' }, + { foo: 'a' }, { bar: 123 } ): { foo: string, bar: number, baz: boolean }); }, // module from lib function() { - const copyProperties = require(\'copyProperties\'); - let x = { foo: \'a\' }; + const copyProperties = require('copyProperties'); + let x = { foo: 'a' }; let y = { bar: 123 }; (copyProperties({}, x, y): { foo: string, bar: number }); }, @@ -38,7 +40,7 @@ let tests = [ // too few args function(copyProperties: Object$Assign) { copyProperties(); - (copyProperties({ foo: \'a\' }): { foo: number }); // err, num !~> string + (copyProperties({ foo: 'a' }): { foo: number }); // err, num !~> string }, // passed as a function @@ -60,7 +62,7 @@ let tests = [ function(copyProperties: Object$Assign) { let result = {}; result.baz = false; - (copyProperties(result, { foo: \"a\" }, { bar: 123 }): { + (copyProperties(result, { foo: \\"a\\" }, { bar: 123 }): { foo: string, bar: number, baz: boolean @@ -69,8 +71,8 @@ let tests = [ // module from lib function() { - const copyProperties = require(\"copyProperties\"); - let x = { foo: \"a\" }; + const copyProperties = require(\\"copyProperties\\"); + let x = { foo: \\"a\\" }; let y = { bar: 123 }; (copyProperties({}, x, y): { foo: string, bar: number }); }, @@ -78,7 +80,7 @@ let tests = [ // too few args function(copyProperties: Object$Assign) { copyProperties(); - (copyProperties({ foo: \"a\" }): { foo: number }); // err, num !~> string + (copyProperties({ foo: \\"a\\" }): { foo: number }); // err, num !~> string }, // passed as a function @@ -90,13 +92,13 @@ let tests = [ " `; -exports[`test invariant.js 1`] = ` +exports[`invariant.js 1`] = ` "/* @flow */ let tests = [ function() { let x: ?string = null; - invariant(x, \'truthy only\'); // error, forgot to require invariant + invariant(x, 'truthy only'); // error, forgot to require invariant }, function(invariant: Function) { @@ -111,7 +113,7 @@ let tests = [ let tests = [ function() { let x: ?string = null; - invariant(x, \"truthy only\"); // error, forgot to require invariant + invariant(x, \\"truthy only\\"); // error, forgot to require invariant }, function(invariant: Function) { @@ -123,32 +125,32 @@ let tests = [ " `; -exports[`test lib.js 1`] = ` -"declare module \"copyProperties\" { +exports[`lib.js 1`] = ` +"declare module \\"copyProperties\\" { declare var exports: Object$Assign; } -declare module \"mergeInto\" { +declare module \\"mergeInto\\" { declare var exports: $Facebookism$MergeInto; } -declare module \"mixin\" { +declare module \\"mixin\\" { declare var exports: $Facebookism$Mixin; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -declare module \"copyProperties\" { +declare module \\"copyProperties\\" { declare var exports: Object$Assign; } -declare module \"mergeInto\" { +declare module \\"mergeInto\\" { declare var exports: $Facebookism$MergeInto; } -declare module \"mixin\" { +declare module \\"mixin\\" { declare var exports: $Facebookism$Mixin; } " `; -exports[`test mergeInto.js 1`] = ` +exports[`mergeInto.js 1`] = ` "// @flow let tests = [ @@ -161,15 +163,15 @@ let tests = [ function(mergeInto: $Facebookism$MergeInto) { let result = {}; result.baz = false; - (mergeInto(result, { foo: \'a\' }, { bar: 123 }): void); + (mergeInto(result, { foo: 'a' }, { bar: 123 }): void); (result: { foo: string, bar: number, baz: boolean }); }, // module from lib function() { - const mergeInto = require(\'mergeInto\'); + const mergeInto = require('mergeInto'); let result: { foo?: string, bar?: number, baz: boolean } = { baz: false }; - (mergeInto(result, { foo: \'a\' }, { bar: 123 }): void); + (mergeInto(result, { foo: 'a' }, { bar: 123 }): void); }, // too few args @@ -196,15 +198,15 @@ let tests = [ function(mergeInto: $Facebookism$MergeInto) { let result = {}; result.baz = false; - (mergeInto(result, { foo: \"a\" }, { bar: 123 }): void); + (mergeInto(result, { foo: \\"a\\" }, { bar: 123 }): void); (result: { foo: string, bar: number, baz: boolean }); }, // module from lib function() { - const mergeInto = require(\"mergeInto\"); + const mergeInto = require(\\"mergeInto\\"); let result: { foo?: string, bar?: number, baz: boolean } = { baz: false }; - (mergeInto(result, { foo: \"a\" }, { bar: 123 }): void); + (mergeInto(result, { foo: \\"a\\" }, { bar: 123 }): void); }, // too few args @@ -221,24 +223,24 @@ let tests = [ " `; -exports[`test test.js 1`] = ` -"var Bar = require(\'./Bar\'); -var mixin = require(\'mixin\'); +exports[`test.js 1`] = ` +"var Bar = require('./Bar'); +var mixin = require('mixin'); class Foo extends mixin(Bar) { m() { var x: string = this.x; - this.y = \"\"; + this.y = \\"\\"; } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var Bar = require(\"./Bar\"); -var mixin = require(\"mixin\"); +var Bar = require(\\"./Bar\\"); +var mixin = require(\\"mixin\\"); class Foo extends mixin(Bar) { m() { var x: string = this.x; - this.y = \"\"; + this.y = \\"\\"; } } " diff --git a/tests/flow/fetch/__snapshots__/jsfmt.spec.js.snap b/tests/flow/fetch/__snapshots__/jsfmt.spec.js.snap index f66810821..5b90de60a 100644 --- a/tests/flow/fetch/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/fetch/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test fetch.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`fetch.js 1`] = ` "/* @flow */ // most of the details are tested in the separate file // here I test the basic usage -const myRequest = new Request(\'http://google.com\'); +const myRequest = new Request('http://google.com'); const a: Promise = fetch(myRequest) @@ -12,64 +14,64 @@ const a: Promise = const b: Promise = fetch(myRequest); // incorrect -var myInit = { method: \'GET\', +var myInit = { method: 'GET', headers: { - \'Content-Type\': \'image/jpeg\' + 'Content-Type': 'image/jpeg' }, - mode: \'cors\', - cache: \'default\' }; + mode: 'cors', + cache: 'default' }; const c: Promise = - fetch(\'image.png\') + fetch('image.png') .then(response => response.blob()); // correct -const d: Promise = fetch(\'image.png\'); // incorrect +const d: Promise = fetch('image.png'); // incorrect ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ // most of the details are tested in the separate file // here I test the basic usage -const myRequest = new Request(\"http://google.com\"); +const myRequest = new Request(\\"http://google.com\\"); const a: Promise = fetch(myRequest).then(response => response.text()); const b: Promise = fetch(myRequest); // incorrect var myInit = { - method: \"GET\", + method: \\"GET\\", headers: { - \"Content-Type\": \"image/jpeg\" + \\"Content-Type\\": \\"image/jpeg\\" }, - mode: \"cors\", - cache: \"default\" + mode: \\"cors\\", + cache: \\"default\\" }; -const c: Promise = fetch(\"image.png\").then(response => response.blob()); // correct +const c: Promise = fetch(\\"image.png\\").then(response => response.blob()); // correct -const d: Promise = fetch(\"image.png\"); // incorrect +const d: Promise = fetch(\\"image.png\\"); // incorrect " `; -exports[`test headers.js 1`] = ` +exports[`headers.js 1`] = ` "/* @flow */ -const a = new Headers(\"\'Content-Type\': \'image/jpeg\'\"); // not correct -const b = new Headers([\'Content-Type\', \'image/jpeg\']); // not correct -const c = new Headers({\'Content-Type\', \'image/jpeg\'}); // correct +const a = new Headers(\\"'Content-Type': 'image/jpeg'\\"); // not correct +const b = new Headers(['Content-Type', 'image/jpeg']); // not correct +const c = new Headers({'Content-Type', 'image/jpeg'}); // correct const d = new Headers(c); // correct const e: Headers = new Headers(); // correct -e.append(\'Content-Type\', \'image/jpeg\'); // correct -e.append(\'Content-Type\'); // not correct -e.append({\'Content-Type\', \'image/jpeg\'}); // not correct -e.set(\'Content-Type\', \'image/jpeg\'); // correct -e.set(\'Content-Type\'); // not correct -e.set({\'Content-Type\', \'image/jpeg\'}); // not correct +e.append('Content-Type', 'image/jpeg'); // correct +e.append('Content-Type'); // not correct +e.append({'Content-Type', 'image/jpeg'}); // not correct +e.set('Content-Type', 'image/jpeg'); // correct +e.set('Content-Type'); // not correct +e.set({'Content-Type', 'image/jpeg'}); // not correct -const f: Headers = e.append(\'Content-Type\', \'image/jpeg\'); // not correct +const f: Headers = e.append('Content-Type', 'image/jpeg'); // not correct -const g: string = e.get(\'Content-Type\'); // correct -const h: number = e.get(\'Content-Type\'); // not correct +const g: string = e.get('Content-Type'); // correct +const h: number = e.get('Content-Type'); // not correct for (let v of e) { const [i, j]: [string, string] = v; // correct @@ -79,26 +81,26 @@ for (let v of e.entries()) { const [i, j]: [string, string] = v; // correct } -e.getAll(\'content-type\').forEach((v: string) => {}); // correct +e.getAll('content-type').forEach((v: string) => {}); // correct ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -const a = new Headers(\"\'Content-Type\': \'image/jpeg\'\"); // not correct -const b = new Headers([\"Content-Type\", \"image/jpeg\"]); // not correct -const c = new Headers({ \"Content-Type\", \"image/jpeg\" }); // correct +const a = new Headers(\\"'Content-Type': 'image/jpeg'\\"); // not correct +const b = new Headers([\\"Content-Type\\", \\"image/jpeg\\"]); // not correct +const c = new Headers({ \\"Content-Type\\", \\"image/jpeg\\" }); // correct const d = new Headers(c); // correct const e: Headers = new Headers(); // correct -e.append(\"Content-Type\", \"image/jpeg\"); // correct -e.append(\"Content-Type\"); // not correct -e.append({ \"Content-Type\", \"image/jpeg\" }); // not correct -e.set(\"Content-Type\", \"image/jpeg\"); // correct -e.set(\"Content-Type\"); // not correct -e.set({ \"Content-Type\", \"image/jpeg\" }); // not correct +e.append(\\"Content-Type\\", \\"image/jpeg\\"); // correct +e.append(\\"Content-Type\\"); // not correct +e.append({ \\"Content-Type\\", \\"image/jpeg\\" }); // not correct +e.set(\\"Content-Type\\", \\"image/jpeg\\"); // correct +e.set(\\"Content-Type\\"); // not correct +e.set({ \\"Content-Type\\", \\"image/jpeg\\" }); // not correct -const f: Headers = e.append(\"Content-Type\", \"image/jpeg\"); // not correct +const f: Headers = e.append(\\"Content-Type\\", \\"image/jpeg\\"); // not correct -const g: string = e.get(\"Content-Type\"); // correct -const h: number = e.get(\"Content-Type\"); // not correct +const g: string = e.get(\\"Content-Type\\"); // correct +const h: number = e.get(\\"Content-Type\\"); // not correct for (let v of e) { const [i, j]: [string, string] = v; // correct @@ -108,54 +110,54 @@ for (let v of e.entries()) { const [i, j]: [string, string] = v; // correct } -e.getAll(\"content-type\").forEach((v: string) => {}); // correct +e.getAll(\\"content-type\\").forEach((v: string) => {}); // correct " `; -exports[`test request.js 1`] = ` +exports[`request.js 1`] = ` "/* @flow */ const a: Request = new Request(); // incorrect -const b: Request = new Request(\'http://example.org\'); // correct +const b: Request = new Request('http://example.org'); // correct const c: Request = new Request(b); // correct -const d: Request = new Request(c.clone()); // correct (doesn\'t make much sense though) +const d: Request = new Request(c.clone()); // correct (doesn't make much sense though) const e: Request = new Request(b, c); // incorrect const f: Request = new Request({}) // incorrect -const g: Request = new Request(\'http://example.org\', {}) // correct +const g: Request = new Request('http://example.org', {}) // correct -const h: Request = new Request(\'http://example.org\', { - method: \'GET\', +const h: Request = new Request('http://example.org', { + method: 'GET', headers: { - \'Content-Type\': \'image/jpeg\' + 'Content-Type': 'image/jpeg' }, - mode: \'cors\', - cache: \'default\' + mode: 'cors', + cache: 'default' }) // correct -const i: Request = new Request(\'http://example.org\', { - method: \'POST\', +const i: Request = new Request('http://example.org', { + method: 'POST', headers: { - \'Content-Type\': \'image/jpeg\' + 'Content-Type': 'image/jpeg' }, - body: new URLSearchParams(\"key=value\"), - mode: \'cors\', - cache: \'default\' + body: new URLSearchParams(\\"key=value\\"), + mode: 'cors', + cache: 'default' }) // correct -const j: Request = new Request(\'http://example.org\', { - method: \'GET\', - headers: \'Content-Type: image/jpeg\', - mode: \'cors\', - cache: \'default\' +const j: Request = new Request('http://example.org', { + method: 'GET', + headers: 'Content-Type: image/jpeg', + mode: 'cors', + cache: 'default' }) // incorrect - headers is string -const k: Request = new Request(\'http://example.org\', { - method: \'CONNECT\', +const k: Request = new Request('http://example.org', { + method: 'CONNECT', headers: { - \'Content-Type\': \'image/jpeg\' + 'Content-Type': 'image/jpeg' }, - mode: \'cors\', - cache: \'default\' + mode: 'cors', + cache: 'default' }) // incorrect - CONNECT is forbidden var l: boolean = h.bodyUsed; @@ -167,47 +169,47 @@ h.arrayBuffer().then((ab: Buffer) => ab); // incorrect ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ const a: Request = new Request(); // incorrect -const b: Request = new Request(\"http://example.org\"); // correct +const b: Request = new Request(\\"http://example.org\\"); // correct const c: Request = new Request(b); // correct -const d: Request = new Request(c.clone()); // correct (doesn\'t make much sense though) +const d: Request = new Request(c.clone()); // correct (doesn't make much sense though) const e: Request = new Request(b, c); // incorrect const f: Request = new Request({}); // incorrect -const g: Request = new Request(\"http://example.org\", {}); // correct +const g: Request = new Request(\\"http://example.org\\", {}); // correct -const h: Request = new Request(\"http://example.org\", { - method: \"GET\", +const h: Request = new Request(\\"http://example.org\\", { + method: \\"GET\\", headers: { - \"Content-Type\": \"image/jpeg\" + \\"Content-Type\\": \\"image/jpeg\\" }, - mode: \"cors\", - cache: \"default\" + mode: \\"cors\\", + cache: \\"default\\" }); // correct -const i: Request = new Request(\"http://example.org\", { - method: \"POST\", +const i: Request = new Request(\\"http://example.org\\", { + method: \\"POST\\", headers: { - \"Content-Type\": \"image/jpeg\" + \\"Content-Type\\": \\"image/jpeg\\" }, - body: new URLSearchParams(\"key=value\"), - mode: \"cors\", - cache: \"default\" + body: new URLSearchParams(\\"key=value\\"), + mode: \\"cors\\", + cache: \\"default\\" }); // correct -const j: Request = new Request(\"http://example.org\", { - method: \"GET\", - headers: \"Content-Type: image/jpeg\", - mode: \"cors\", - cache: \"default\" +const j: Request = new Request(\\"http://example.org\\", { + method: \\"GET\\", + headers: \\"Content-Type: image/jpeg\\", + mode: \\"cors\\", + cache: \\"default\\" }); // incorrect - headers is string -const k: Request = new Request(\"http://example.org\", { - method: \"CONNECT\", +const k: Request = new Request(\\"http://example.org\\", { + method: \\"CONNECT\\", headers: { - \"Content-Type\": \"image/jpeg\" + \\"Content-Type\\": \\"image/jpeg\\" }, - mode: \"cors\", - cache: \"default\" + mode: \\"cors\\", + cache: \\"default\\" }); // incorrect - CONNECT is forbidden var l: boolean = h.bodyUsed; @@ -219,7 +221,7 @@ h.arrayBuffer().then((ab: Buffer) => ab); // incorrect " `; -exports[`test response.js 1`] = ` +exports[`response.js 1`] = ` "/* @flow */ const a: Response = new Response(); // correct const b: Response = new Response(new Blob()); // correct @@ -229,33 +231,33 @@ const d: Response = new Response(new FormData(), { status: 404 }); // correct -const e: Response = new Response(\"responsebody\", { - status: \"404\" +const e: Response = new Response(\\"responsebody\\", { + status: \\"404\\" }); // incorrect -const f: Response = new Response(\"responsebody\", { +const f: Response = new Response(\\"responsebody\\", { status: 404, - headers: \"\'Content-Type\': \'image/jpeg\'\" + headers: \\"'Content-Type': 'image/jpeg'\\" }); // incorrect -const g: Response = new Response(\"responsebody\", { +const g: Response = new Response(\\"responsebody\\", { status: 404, headers: { - \'Content-Type\': \'image/jpeg\' + 'Content-Type': 'image/jpeg' } }); // correct -const h: Response = new Response(\"responsebody\", { +const h: Response = new Response(\\"responsebody\\", { status: 404, headers: new Headers({ - \'Content-Type\': \'image/jpeg\' + 'Content-Type': 'image/jpeg' }) }); // correct, if verbose const i: Response = new Response({ status: 404, headers: new Headers({ - \'Content-Type\': \'image/jpeg\' + 'Content-Type': 'image/jpeg' }) }); // incorrect @@ -276,33 +278,33 @@ const d: Response = new Response(new FormData(), { status: 404 }); // correct -const e: Response = new Response(\"responsebody\", { - status: \"404\" +const e: Response = new Response(\\"responsebody\\", { + status: \\"404\\" }); // incorrect -const f: Response = new Response(\"responsebody\", { +const f: Response = new Response(\\"responsebody\\", { status: 404, - headers: \"\'Content-Type\': \'image/jpeg\'\" + headers: \\"'Content-Type': 'image/jpeg'\\" }); // incorrect -const g: Response = new Response(\"responsebody\", { +const g: Response = new Response(\\"responsebody\\", { status: 404, headers: { - \"Content-Type\": \"image/jpeg\" + \\"Content-Type\\": \\"image/jpeg\\" } }); // correct -const h: Response = new Response(\"responsebody\", { +const h: Response = new Response(\\"responsebody\\", { status: 404, headers: new Headers({ - \"Content-Type\": \"image/jpeg\" + \\"Content-Type\\": \\"image/jpeg\\" }) }); // correct, if verbose const i: Response = new Response({ status: 404, headers: new Headers({ - \"Content-Type\": \"image/jpeg\" + \\"Content-Type\\": \\"image/jpeg\\" }) }); // incorrect @@ -316,25 +318,25 @@ h.arrayBuffer().then((ab: Buffer) => ab); // incorrect " `; -exports[`test urlsearchparams.js 1`] = ` +exports[`urlsearchparams.js 1`] = ` "/* @flow */ -const a = new URLSearchParams(\"key1=value1\"); // correct -const b = new URLSearchParams([\'key1\', \'value1\']); // not correct -const c = new URLSearchParams({\'key1\', \'value1\'}); // not correct +const a = new URLSearchParams(\\"key1=value1\\"); // correct +const b = new URLSearchParams(['key1', 'value1']); // not correct +const c = new URLSearchParams({'key1', 'value1'}); // not correct const d = new URLSearchParams(c); // correct const e: URLSearchParams = new URLSearchParams(); // correct -e.append(\'key1\', \'value1\'); // correct -e.append(\'key1\'); // not correct -e.append({\'key1\', \'value1\'}); // not correct -e.set(\'key1\', \'value1\'); // correct -e.set(\'key1\'); // not correct -e.set({\'key1\', \'value1\'}); // not correct +e.append('key1', 'value1'); // correct +e.append('key1'); // not correct +e.append({'key1', 'value1'}); // not correct +e.set('key1', 'value1'); // correct +e.set('key1'); // not correct +e.set({'key1', 'value1'}); // not correct -const f: URLSearchParams = e.append(\'key1\', \'value1\'); // not correct +const f: URLSearchParams = e.append('key1', 'value1'); // not correct -const g: string = e.get(\'key1\'); // correct -const h: number = e.get(\'key1\'); // not correct +const g: string = e.get('key1'); // correct +const h: number = e.get('key1'); // not correct for (let v of e) { const [i, j]: [string, string] = v; // correct @@ -344,26 +346,26 @@ for (let v of e.entries()) { const [i, j]: [string, string] = v; // correct } -e.getAll(\'key1\').forEach((v: string) => {}); // correct +e.getAll('key1').forEach((v: string) => {}); // correct ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -const a = new URLSearchParams(\"key1=value1\"); // correct -const b = new URLSearchParams([\"key1\", \"value1\"]); // not correct -const c = new URLSearchParams({ \"key1\", \"value1\" }); // not correct +const a = new URLSearchParams(\\"key1=value1\\"); // correct +const b = new URLSearchParams([\\"key1\\", \\"value1\\"]); // not correct +const c = new URLSearchParams({ \\"key1\\", \\"value1\\" }); // not correct const d = new URLSearchParams(c); // correct const e: URLSearchParams = new URLSearchParams(); // correct -e.append(\"key1\", \"value1\"); // correct -e.append(\"key1\"); // not correct -e.append({ \"key1\", \"value1\" }); // not correct -e.set(\"key1\", \"value1\"); // correct -e.set(\"key1\"); // not correct -e.set({ \"key1\", \"value1\" }); // not correct +e.append(\\"key1\\", \\"value1\\"); // correct +e.append(\\"key1\\"); // not correct +e.append({ \\"key1\\", \\"value1\\" }); // not correct +e.set(\\"key1\\", \\"value1\\"); // correct +e.set(\\"key1\\"); // not correct +e.set({ \\"key1\\", \\"value1\\" }); // not correct -const f: URLSearchParams = e.append(\"key1\", \"value1\"); // not correct +const f: URLSearchParams = e.append(\\"key1\\", \\"value1\\"); // not correct -const g: string = e.get(\"key1\"); // correct -const h: number = e.get(\"key1\"); // not correct +const g: string = e.get(\\"key1\\"); // correct +const h: number = e.get(\\"key1\\"); // not correct for (let v of e) { const [i, j]: [string, string] = v; // correct @@ -373,6 +375,6 @@ for (let v of e.entries()) { const [i, j]: [string, string] = v; // correct } -e.getAll(\"key1\").forEach((v: string) => {}); // correct +e.getAll(\\"key1\\").forEach((v: string) => {}); // correct " `; diff --git a/tests/flow/find-module/__snapshots__/jsfmt.spec.js.snap b/tests/flow/find-module/__snapshots__/jsfmt.spec.js.snap index d345e5f80..787a75633 100644 --- a/tests/flow/find-module/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/find-module/__snapshots__/jsfmt.spec.js.snap @@ -1,19 +1,21 @@ -exports[`test req.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`req.js 1`] = ` "module.exports = 0; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ module.exports = 0; " `; -exports[`test test.js 1`] = ` -"var x = require(\'./req\'); +exports[`test.js 1`] = ` +"var x = require('./req'); (x: string); -import x from \'./req\'; +import x from './req'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"./req\"); +var x = require(\\"./req\\"); (x: string); -import x from \"./req\"; +import x from \\"./req\\"; " `; diff --git a/tests/flow/fixpoint/__snapshots__/jsfmt.spec.js.snap b/tests/flow/fixpoint/__snapshots__/jsfmt.spec.js.snap index d5449747d..24322eb00 100644 --- a/tests/flow/fixpoint/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/fixpoint/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test Fun.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Fun.js 1`] = ` " /* @providesModule Fun */ @@ -26,7 +28,7 @@ function mk_factorial() { var factorial = mk_factorial(); -factorial(\"...\"); +factorial(\\"...\\"); module.exports = {fn: fix}; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -64,13 +66,13 @@ function mk_factorial() { } var factorial = mk_factorial(); -factorial(\"...\"); +factorial(\\"...\\"); module.exports = { fn: fix }; " `; -exports[`test Ycombinator.js 1`] = ` +exports[`Ycombinator.js 1`] = ` " /* @providesModule Ycombinator */ diff --git a/tests/flow/flow_ast.template_strings/__snapshots__/jsfmt.spec.js.snap b/tests/flow/flow_ast.template_strings/__snapshots__/jsfmt.spec.js.snap index c4ce42675..1800433a0 100644 --- a/tests/flow/flow_ast.template_strings/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/flow_ast.template_strings/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test foo.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` "a\`foo \${bar} baz\` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a\`foo \${bar} baz\`; diff --git a/tests/flow/for/__snapshots__/jsfmt.spec.js.snap b/tests/flow/for/__snapshots__/jsfmt.spec.js.snap index b96ac341d..ab9aa0da1 100644 --- a/tests/flow/for/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/for/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test abnormal.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`abnormal.js 1`] = ` "/* @flow */ function foo(x: boolean) { @@ -9,7 +11,7 @@ function foo(x: boolean) { } return; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function bar(x: boolean) { @@ -17,7 +19,7 @@ function bar(x: boolean) { for (var ii = 0; ii < max; ii++) { return; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function baz(x: boolean) { @@ -25,7 +27,7 @@ function baz(x: boolean) { for (var ii = 0; ii < max; ii++) { continue; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function bliffl(x: boolean) { @@ -34,9 +36,9 @@ function bliffl(x: boolean) { loop2: for (var jj = 0; jj < max; jj++) { break loop1; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function corge(x: boolean) { @@ -44,7 +46,7 @@ function corge(x: boolean) { for (var ii = 0; ii < max; ii++) { break; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -57,7 +59,7 @@ function foo(x: boolean) { } return; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function bar(x: boolean) { @@ -65,7 +67,7 @@ function bar(x: boolean) { for (var ii = 0; ii < max; ii++) { return; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function baz(x: boolean) { @@ -73,7 +75,7 @@ function baz(x: boolean) { for (var ii = 0; ii < max; ii++) { continue; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function bliffl(x: boolean) { @@ -84,9 +86,9 @@ function bliffl(x: boolean) { for (var jj = 0; jj < max; jj++) { break loop1; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function corge(x: boolean) { @@ -94,12 +96,12 @@ function corge(x: boolean) { for (var ii = 0; ii < max; ii++) { break; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } " `; -exports[`test abnormal_for_in.js 1`] = ` +exports[`abnormal_for_in.js 1`] = ` "function foo(x: boolean) { var obj = { a: 1, b: 2}; for (var prop in obj) { @@ -108,21 +110,21 @@ exports[`test abnormal_for_in.js 1`] = ` } return; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function bar(x: boolean) { for (var prop in {}) { return; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function baz(x: boolean) { for (var prop in {}) { continue; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function bliffl(x: boolean) { @@ -131,16 +133,16 @@ function bliffl(x: boolean) { loop2: for (var prop2 in obj) { break loop1; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function corge(x: boolean) { for (var prop in {}) { break; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function foo(x: boolean) { @@ -151,21 +153,21 @@ function foo(x: boolean) { } return; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function bar(x: boolean) { for (var prop in {}) { return; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function baz(x: boolean) { for (var prop in {}) { continue; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function bliffl(x: boolean) { @@ -176,21 +178,21 @@ function bliffl(x: boolean) { for (var prop2 in obj) { break loop1; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function corge(x: boolean) { for (var prop in {}) { break; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } " `; -exports[`test abnormal_for_of.js 1`] = ` +exports[`abnormal_for_of.js 1`] = ` "function foo(x: boolean) { var arr = [1, 2, 3]; for (var elem of arr) { @@ -199,21 +201,21 @@ exports[`test abnormal_for_of.js 1`] = ` } return; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function bar(x: boolean) { for (var elem of []) { return; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function baz(x: boolean) { for (var elem of []) { continue; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function bliffl(x: boolean) { @@ -222,16 +224,16 @@ function bliffl(x: boolean) { loop2: for (var elem of arr) { break loop1; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } function corge(x: boolean) { for (var elem of []) { break; } - console.log(\'this is still reachable\'); + console.log('this is still reachable'); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function foo(x: boolean) { @@ -242,21 +244,21 @@ function foo(x: boolean) { } return; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function bar(x: boolean) { for (var elem of []) { return; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function baz(x: boolean) { for (var elem of []) { continue; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function bliffl(x: boolean) { @@ -267,16 +269,16 @@ function bliffl(x: boolean) { for (var elem of arr) { break loop1; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } function corge(x: boolean) { for (var elem of []) { break; } - console.log(\"this is still reachable\"); + console.log(\\"this is still reachable\\"); } " `; diff --git a/tests/flow/forof/__snapshots__/jsfmt.spec.js.snap b/tests/flow/forof/__snapshots__/jsfmt.spec.js.snap index 26e5742e0..3bfba67c6 100644 --- a/tests/flow/forof/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/forof/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test forof.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`forof.js 1`] = ` "/** * @flow */ diff --git a/tests/flow/function/__snapshots__/jsfmt.spec.js.snap b/tests/flow/function/__snapshots__/jsfmt.spec.js.snap index 39a2e88aa..89d3175a2 100644 --- a/tests/flow/function/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/function/__snapshots__/jsfmt.spec.js.snap @@ -1,36 +1,38 @@ -exports[`test apply.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`apply.js 1`] = ` "function test(a: string, b: number): number { - return this.length; // expect []/\"\" this + return this.length; // expect []/\\"\\" this } // tuples flow correctly into params -test.apply(\"\", [\"\", 0]); +test.apply(\\"\\", [\\"\\", 0]); // wrong this is an error -test.apply(0, [\"\", 0]); // error: lookup \`length\` on Number +test.apply(0, [\\"\\", 0]); // error: lookup \`length\` on Number // not enough arguments is an error (via incompatible RestT) -test.apply(\"\", [\"\"]); // error: string ~> number +test.apply(\\"\\", [\\"\\"]); // error: string ~> number // mistyped arguments is an error -test.apply(\"\", [\"\", \"\"]); // error: string ~> number (2nd arg) -test.apply(\"\", [0, 0]); // error: number ~> string (1st arg) +test.apply(\\"\\", [\\"\\", \\"\\"]); // error: string ~> number (2nd arg) +test.apply(\\"\\", [0, 0]); // error: number ~> string (1st arg) // resolve args array from tvar -function f(args) { test.apply(\"\", args) } -f([\"\", 0]); // OK -f([\"\", \"\"]); // error: string ~> number (2nd arg) +function f(args) { test.apply(\\"\\", args) } +f([\\"\\", 0]); // OK +f([\\"\\", \\"\\"]); // error: string ~> number (2nd arg) f([0, 0]); // error: number ~> string (1st arg) // expect array -test.apply(\"\", \"not array\"); // error: expect array of args +test.apply(\\"\\", \\"not array\\"); // error: expect array of args // expect 4 errors: // - lookup length on Number (because 0 is used as \`this\`) // - 123 is not a string -// - \'foo\' is not a number +// - 'foo' is not a number // - return type (number) is not void -(test.call.apply(test, [0, 123, \'foo\']): void); +(test.call.apply(test, [0, 123, 'foo']): void); // expect 2 errors: // - lookup length on number (0 is used as \`this\`) @@ -40,42 +42,42 @@ test.apply(\"\", \"not array\"); // error: expect array of args // args are optional function test2(): number { return 0; } (test2.apply(): number); -(test2.apply(\"\"): number); +(test2.apply(\\"\\"): number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function test(a: string, b: number): number { - return this.length; // expect []/\"\" this + return this.length; // expect []/\\"\\" this } // tuples flow correctly into params -test.apply(\"\", [\"\", 0]); +test.apply(\\"\\", [\\"\\", 0]); // wrong this is an error -test.apply(0, [\"\", 0]); // error: lookup \`length\` on Number +test.apply(0, [\\"\\", 0]); // error: lookup \`length\` on Number // not enough arguments is an error (via incompatible RestT) -test.apply(\"\", [\"\"]); // error: string ~> number +test.apply(\\"\\", [\\"\\"]); // error: string ~> number // mistyped arguments is an error -test.apply(\"\", [\"\", \"\"]); // error: string ~> number (2nd arg) -test.apply(\"\", [0, 0]); // error: number ~> string (1st arg) +test.apply(\\"\\", [\\"\\", \\"\\"]); // error: string ~> number (2nd arg) +test.apply(\\"\\", [0, 0]); // error: number ~> string (1st arg) // resolve args array from tvar function f(args) { - test.apply(\"\", args); + test.apply(\\"\\", args); } -f([\"\", 0]); // OK -f([\"\", \"\"]); // error: string ~> number (2nd arg) +f([\\"\\", 0]); // OK +f([\\"\\", \\"\\"]); // error: string ~> number (2nd arg) f([0, 0]); // error: number ~> string (1st arg) // expect array -test.apply(\"\", \"not array\"); // error: expect array of args +test.apply(\\"\\", \\"not array\\"); // error: expect array of args // expect 4 errors: // - lookup length on Number (because 0 is used as \`this\`) // - 123 is not a string -// - \'foo\' is not a number +// - 'foo' is not a number // - return type (number) is not void -(test.call.apply(test, [0, 123, \"foo\"]): void); +(test.call.apply(test, [0, 123, \\"foo\\"]): void); // expect 2 errors: // - lookup length on number (0 is used as \`this\`) @@ -87,17 +89,17 @@ function test2(): number { return 0; } (test2.apply(): number); -(test2.apply(\"\"): number); +(test2.apply(\\"\\"): number); " `; -exports[`test bind.js 1`] = ` +exports[`bind.js 1`] = ` "// @flow let tests = [ function(x: (a: string, b: string) => void) { - let y = x.bind(x, \'foo\'); - y(\'bar\'); // ok + let y = x.bind(x, 'foo'); + y('bar'); // ok y(123); // error, number !~> string }, ]; @@ -106,100 +108,100 @@ let tests = [ let tests = [ function(x: (a: string, b: string) => void) { - let y = x.bind(x, \"foo\"); - y(\"bar\"); // ok + let y = x.bind(x, \\"foo\\"); + y(\\"bar\\"); // ok y(123); // error, number !~> string } ]; " `; -exports[`test call.js 1`] = ` +exports[`call.js 1`] = ` "// @flow function test(a: string, b: number): number { - return this.length; // expect []/\"\" this + return this.length; // expect []/\\"\\" this } // args flow correctly into params -test.call(\"\", \"\", 0); +test.call(\\"\\", \\"\\", 0); // wrong this is an error -test.call(0, \"\", 0); // error: lookup \`length\` on Number +test.call(0, \\"\\", 0); // error: lookup \`length\` on Number // not enough arguments is an error (via incompatible RestT) -test.call(\"\", \"\"); // error: string ~> number +test.call(\\"\\", \\"\\"); // error: string ~> number // mistyped arguments is an error -test.call(\"\", \"\", \"\"); // error: string ~> number (2nd arg) -test.call(\"\", 0, 0); // error: number ~> string (1st arg) +test.call(\\"\\", \\"\\", \\"\\"); // error: string ~> number (2nd arg) +test.call(\\"\\", 0, 0); // error: number ~> string (1st arg) // resolve args array from tvar -function f(args) { test.call(\"\", args[0], args[1]) } -f([\"\", 0]); // OK -f([\"\", \"\"]); // error: string ~> number (2nd arg) +function f(args) { test.call(\\"\\", args[0], args[1]) } +f([\\"\\", 0]); // OK +f([\\"\\", \\"\\"]); // error: string ~> number (2nd arg) f([0, 0]); // error: number ~> string (1st arg) // expect 3 errors: // - lookup length on Number (0 used as \`this\`) // - number !~> string (param a) // - string !~> number (param b) -(test.apply.call(test, 0, [0, \'foo\']): number); +(test.apply.call(test, 0, [0, 'foo']): number); // args are optional function test2(): number { return 0; } (test2.call(): number); -(test2.call(\"\"): number); +(test2.call(\\"\\"): number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow function test(a: string, b: number): number { - return this.length; // expect []/\"\" this + return this.length; // expect []/\\"\\" this } // args flow correctly into params -test.call(\"\", \"\", 0); +test.call(\\"\\", \\"\\", 0); // wrong this is an error -test.call(0, \"\", 0); // error: lookup \`length\` on Number +test.call(0, \\"\\", 0); // error: lookup \`length\` on Number // not enough arguments is an error (via incompatible RestT) -test.call(\"\", \"\"); // error: string ~> number +test.call(\\"\\", \\"\\"); // error: string ~> number // mistyped arguments is an error -test.call(\"\", \"\", \"\"); // error: string ~> number (2nd arg) -test.call(\"\", 0, 0); // error: number ~> string (1st arg) +test.call(\\"\\", \\"\\", \\"\\"); // error: string ~> number (2nd arg) +test.call(\\"\\", 0, 0); // error: number ~> string (1st arg) // resolve args array from tvar function f(args) { - test.call(\"\", args[0], args[1]); + test.call(\\"\\", args[0], args[1]); } -f([\"\", 0]); // OK -f([\"\", \"\"]); // error: string ~> number (2nd arg) +f([\\"\\", 0]); // OK +f([\\"\\", \\"\\"]); // error: string ~> number (2nd arg) f([0, 0]); // error: number ~> string (1st arg) // expect 3 errors: // - lookup length on Number (0 used as \`this\`) // - number !~> string (param a) // - string !~> number (param b) -(test.apply.call(test, 0, [0, \"foo\"]): number); +(test.apply.call(test, 0, [0, \\"foo\\"]): number); // args are optional function test2(): number { return 0; } (test2.call(): number); -(test2.call(\"\"): number); +(test2.call(\\"\\"): number); " `; -exports[`test function.js 1`] = ` +exports[`function.js 1`] = ` "/** * @flow */ // Previously we represented Function as (...rest: any) => any -// This means the following wouldn\'t pass, because that arrow function +// This means the following wouldn't pass, because that arrow function // can only be called with 3 arguments. var a: Function = (a, b, c) => 123; @@ -212,13 +214,13 @@ var c: Function = C; function good(x: Function, MyThing: Function): number { var o: Object = x; // Function is an Object x.foo = 123; - x[\'foo\'] = 456; + x['foo'] = 456; x(); ; var {...something} = x; - Object.assign(x, {hi: \'there\'}); + Object.assign(x, {hi: 'there'}); Object.keys(x); - return x.bar + x[\'bar\'] + x.lala(); + return x.bar + x['bar'] + x.lala(); } function bad(x: Function, y: Object): void { @@ -230,24 +232,24 @@ function bad(x: Function, y: Object): void { let tests = [ function(y: () => void, z: Function) { function x() {} - (x.length: void); // error, it\'s a number - (y.length: void); // error, it\'s a number - (z.length: void); // error, it\'s a number + (x.length: void); // error, it's a number + (y.length: void); // error, it's a number + (z.length: void); // error, it's a number - (x.name: void); // error, it\'s a string - (y.name: void); // error, it\'s a string - (z.name: void); // error, it\'s a string + (x.name: void); // error, it's a string + (y.name: void); // error, it's a string + (z.name: void); // error, it's a string }, function(y: () => void, z: Function) { function x() {} - x.length = \'foo\'; // error, it\'s a number - y.length = \'foo\'; // error, it\'s a number - z.length = \'foo\'; // error, it\'s a number + x.length = 'foo'; // error, it's a number + y.length = 'foo'; // error, it's a number + z.length = 'foo'; // error, it's a number - x.name = 123; // error, it\'s a string - y.name = 123; // error, it\'s a string - z.name = 123; // error, it\'s a string + x.name = 123; // error, it's a string + y.name = 123; // error, it's a string + z.name = 123; // error, it's a string // Non-(Function.prototype) properties on a \`Function\` type should be \`any\` (z.foo: number); @@ -266,7 +268,7 @@ var e = (d.bind(1): Function)(); */ // Previously we represented Function as (...rest: any) => any -// This means the following wouldn\'t pass, because that arrow function +// This means the following wouldn't pass, because that arrow function // can only be called with 3 arguments. var a: Function = (a, b, c) => 123; @@ -281,13 +283,13 @@ var c: Function = C; function good(x: Function, MyThing: Function): number { var o: Object = x; // Function is an Object x.foo = 123; - x[\"foo\"] = 456; + x[\\"foo\\"] = 456; x(); ; var { ...something } = x; - Object.assign(x, { hi: \"there\" }); + Object.assign(x, { hi: \\"there\\" }); Object.keys(x); - return x.bar + x[\"bar\"] + x.lala(); + return x.bar + x[\\"bar\\"] + x.lala(); } function bad(x: Function, y: Object): void { @@ -299,24 +301,24 @@ function bad(x: Function, y: Object): void { let tests = [ function(y: () => void, z: Function) { function x() {} - (x.length: void); // error, it\'s a number - (y.length: void); // error, it\'s a number - (z.length: void); // error, it\'s a number + (x.length: void); // error, it's a number + (y.length: void); // error, it's a number + (z.length: void); // error, it's a number - (x.name: void); // error, it\'s a string - (y.name: void); // error, it\'s a string - (z.name: void); // error, it\'s a string + (x.name: void); // error, it's a string + (y.name: void); // error, it's a string + (z.name: void); // error, it's a string }, function(y: () => void, z: Function) { function x() {} - x.length = \"foo\"; // error, it\'s a number - y.length = \"foo\"; // error, it\'s a number - z.length = \"foo\"; // error, it\'s a number + x.length = \\"foo\\"; // error, it's a number + y.length = \\"foo\\"; // error, it's a number + z.length = \\"foo\\"; // error, it's a number - x.name = 123; // error, it\'s a string - y.name = 123; // error, it\'s a string - z.name = 123; // error, it\'s a string + x.name = 123; // error, it's a string + y.name = 123; // error, it's a string + z.name = 123; // error, it's a string // Non-(Function.prototype) properties on a \`Function\` type should be \`any\` (z.foo: number); @@ -332,14 +334,14 @@ var e = (d.bind(1): Function)(); " `; -exports[`test rest.js 1`] = ` +exports[`rest.js 1`] = ` "/* regression tests */ function rest_array(...xs: Array): T { return xs[0]; } -// Warn, singleton tuple types don\'t represent rest params +// Warn, singleton tuple types don't represent rest params function rest_tuple(...xs: [T]): T { return xs[0]; } @@ -348,7 +350,7 @@ function rest_any(...xs: any): any { return xs[0]; } -// Warn, arbitrary subtypes of an array type don\'t represent rest params +// Warn, arbitrary subtypes of an array type don't represent rest params function rest_t>(...xs: T): U { return xs[0]; } @@ -359,7 +361,7 @@ function rest_array(...xs: Array): T { return xs[0]; } -// Warn, singleton tuple types don\'t represent rest params +// Warn, singleton tuple types don't represent rest params function rest_tuple(...xs: [T]): T { return xs[0]; } @@ -368,7 +370,7 @@ function rest_any(...xs: any): any { return xs[0]; } -// Warn, arbitrary subtypes of an array type don\'t represent rest params +// Warn, arbitrary subtypes of an array type don't represent rest params function rest_t>(...xs: T): U { return xs[0]; } diff --git a/tests/flow/funrec/__snapshots__/jsfmt.spec.js.snap b/tests/flow/funrec/__snapshots__/jsfmt.spec.js.snap index 575d958b2..7838f34c7 100644 --- a/tests/flow/funrec/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/funrec/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test funrec.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`funrec.js 1`] = ` "function bar(x) { return x; } function foo() { return function bound() { diff --git a/tests/flow/generators/__snapshots__/jsfmt.spec.js.snap b/tests/flow/generators/__snapshots__/jsfmt.spec.js.snap index 15e689693..9c4322026 100644 --- a/tests/flow/generators/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/generators/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test class.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class.js 1`] = ` "class GeneratorExamples { *stmt_yield(): Generator { yield 0; // ok - yield \"\"; // error: string ~> number + yield \\"\\"; // error: string ~> number } *stmt_next(): Generator { @@ -22,18 +24,18 @@ exports[`test class.js 1`] = ` } *stmt_return_err(): Generator { - return \"\"; // error: string ~> number + return \\"\\"; // error: string ~> number } *infer_stmt() { var x: boolean = yield 0; // error: number ~> boolean - return \"\"; + return \\"\\"; } *widen_next() { var x = yield 0; - if (typeof x === \"number\") { - } else if (typeof x === \"boolean\") { + if (typeof x === \\"number\\") { + } else if (typeof x === \\"boolean\\") { } else { (x : string) // ok, sherlock } @@ -41,7 +43,7 @@ exports[`test class.js 1`] = ` *widen_yield() { yield 0; - yield \"\"; + yield \\"\\"; yield true; } @@ -54,7 +56,7 @@ exports[`test class.js 1`] = ` *delegate_yield_generator() { function *inner() { - yield \"\"; + yield \\"\\"; } yield *inner(); @@ -62,7 +64,7 @@ exports[`test class.js 1`] = ` *delegate_return_generator() { function *inner() { - return \"\"; + return \\"\\"; } var x: number = yield *inner(); // error: string ~> number @@ -99,31 +101,31 @@ var examples = new GeneratorExamples(); for (var x of examples.infer_stmt()) { (x : string) } // error: number ~> string var infer_stmt_next = examples.infer_stmt().next(0).value; // error: number ~> boolean -if (typeof infer_stmt_next === \"undefined\") { -} else if (typeof infer_stmt_next === \"number\") { +if (typeof infer_stmt_next === \\"undefined\\") { +} else if (typeof infer_stmt_next === \\"number\\") { } else { (infer_stmt_next : boolean) // error: string ~> boolean } examples.widen_next().next(0) -examples.widen_next().next(\"\") +examples.widen_next().next(\\"\\") examples.widen_next().next(true) for (var x of examples.widen_yield()) { - if (typeof x === \"number\") { - } else if (typeof x === \"boolean\") { + if (typeof x === \\"number\\") { + } else if (typeof x === \\"boolean\\") { } else { (x : string) // ok, sherlock } } -examples.delegate_next_generator().next(\"\"); +examples.delegate_next_generator().next(\\"\\"); for (var x of examples.delegate_yield_generator()) { (x : number) // error: string ~> number } -examples.delegate_next_iterable([]).next(\"\"); // error: Iterator has no next value +examples.delegate_next_iterable([]).next(\\"\\"); // error: Iterator has no next value for (var x of examples.delegate_yield_iterable([])) { (x : string) // error: number ~> string @@ -132,7 +134,7 @@ for (var x of examples.delegate_yield_iterable([])) { class GeneratorExamples { *stmt_yield(): Generator { yield 0; // ok - yield \"\"; // error: string ~> number + yield \\"\\"; // error: string ~> number } *stmt_next(): Generator { @@ -152,18 +154,18 @@ class GeneratorExamples { } *stmt_return_err(): Generator { - return \"\"; // error: string ~> number + return \\"\\"; // error: string ~> number } *infer_stmt() { var x: boolean = yield 0; // error: number ~> boolean - return \"\"; + return \\"\\"; } *widen_next() { var x = yield 0; - if (typeof x === \"number\") { - } else if (typeof x === \"boolean\") { + if (typeof x === \\"number\\") { + } else if (typeof x === \\"boolean\\") { } else { (x: string); // ok, sherlock } @@ -171,7 +173,7 @@ class GeneratorExamples { *widen_yield() { yield 0; - yield \"\"; + yield \\"\\"; yield true; } @@ -184,7 +186,7 @@ class GeneratorExamples { *delegate_yield_generator() { function* inner() { - yield \"\"; + yield \\"\\"; } yield* inner(); @@ -192,7 +194,7 @@ class GeneratorExamples { *delegate_return_generator() { function* inner() { - return \"\"; + return \\"\\"; } var x: number = yield* inner(); // error: string ~> number @@ -231,31 +233,31 @@ for (var x of examples.infer_stmt()) { } // error: number ~> string var infer_stmt_next = examples.infer_stmt().next(0).value; // error: number ~> boolean -if (typeof infer_stmt_next === \"undefined\") { -} else if (typeof infer_stmt_next === \"number\") { +if (typeof infer_stmt_next === \\"undefined\\") { +} else if (typeof infer_stmt_next === \\"number\\") { } else { (infer_stmt_next: boolean); // error: string ~> boolean } examples.widen_next().next(0); -examples.widen_next().next(\"\"); +examples.widen_next().next(\\"\\"); examples.widen_next().next(true); for (var x of examples.widen_yield()) { - if (typeof x === \"number\") { - } else if (typeof x === \"boolean\") { + if (typeof x === \\"number\\") { + } else if (typeof x === \\"boolean\\") { } else { (x: string); // ok, sherlock } } -examples.delegate_next_generator().next(\"\"); +examples.delegate_next_generator().next(\\"\\"); for (var x of examples.delegate_yield_generator()) { (x: number); // error: string ~> number } -examples.delegate_next_iterable([]).next(\"\"); // error: Iterator has no next value +examples.delegate_next_iterable([]).next(\\"\\"); // error: Iterator has no next value for (var x of examples.delegate_yield_iterable([])) { (x: string); // error: number ~> string @@ -263,13 +265,13 @@ for (var x of examples.delegate_yield_iterable([])) { " `; -exports[`test class_failure.js 1`] = ` +exports[`class_failure.js 1`] = ` "// generalization of failure in class.js class GeneratorExamples { *infer_stmt() { var x: boolean = yield 0; // error: number ~> boolean - return \"\"; + return \\"\\"; } } @@ -279,8 +281,8 @@ for (var x of examples.infer_stmt()) { (x : string) } // error: number ~> string var infer_stmt_next = examples.infer_stmt().next(0).value; // error: number ~> boolean -if (typeof infer_stmt_next === \"undefined\") { -} else if (typeof infer_stmt_next === \"number\") { +if (typeof infer_stmt_next === \\"undefined\\") { +} else if (typeof infer_stmt_next === \\"number\\") { } else { (infer_stmt_next : boolean) // error: string ~> boolean } @@ -290,7 +292,7 @@ if (typeof infer_stmt_next === \"undefined\") { class GeneratorExamples { *infer_stmt() { var x: boolean = yield 0; // error: number ~> boolean - return \"\"; + return \\"\\"; } } @@ -302,18 +304,18 @@ for (var x of examples.infer_stmt()) { var infer_stmt_next = examples.infer_stmt().next(0).value; // error: number ~> boolean -if (typeof infer_stmt_next === \"undefined\") { -} else if (typeof infer_stmt_next === \"number\") { +if (typeof infer_stmt_next === \\"undefined\\") { +} else if (typeof infer_stmt_next === \\"number\\") { } else { (infer_stmt_next: boolean); // error: string ~> boolean } " `; -exports[`test generators.js 1`] = ` +exports[`generators.js 1`] = ` "function *stmt_yield(): Generator { yield 0; // ok - yield \"\"; // error: string ~> number + yield \\"\\"; // error: string ~> number } function *stmt_next(): Generator { @@ -333,41 +335,41 @@ function *stmt_return_ok(): Generator { } function *stmt_return_err(): Generator { - return \"\"; // error: string ~> number + return \\"\\"; // error: string ~> number } function *infer_stmt() { var x: boolean = yield 0; - return \"\"; + return \\"\\"; } for (var x of infer_stmt()) { (x : string) } // error: number ~> string var infer_stmt_next = infer_stmt().next(0).value; // error: number ~> boolean -if (typeof infer_stmt_next === \"undefined\") { -} else if (typeof infer_stmt_next === \"number\") { +if (typeof infer_stmt_next === \\"undefined\\") { +} else if (typeof infer_stmt_next === \\"number\\") { } else { (infer_stmt_next : boolean) // error: string ~> boolean } function *widen_next() { var x = yield 0; - if (typeof x === \"number\") { - } else if (typeof x === \"boolean\") { + if (typeof x === \\"number\\") { + } else if (typeof x === \\"boolean\\") { } else { (x : string) // ok, sherlock } } widen_next().next(0) -widen_next().next(\"\") +widen_next().next(\\"\\") widen_next().next(true) function *widen_yield() { yield 0; - yield \"\"; + yield \\"\\"; yield true; } for (var x of widen_yield()) { - if (typeof x === \"number\") { - } else if (typeof x === \"boolean\") { + if (typeof x === \\"number\\") { + } else if (typeof x === \\"boolean\\") { } else { (x : string) // ok, sherlock } @@ -379,11 +381,11 @@ function *delegate_next_generator() { } yield *inner(); } -delegate_next_generator().next(\"\"); +delegate_next_generator().next(\\"\\"); function *delegate_yield_generator() { function *inner() { - yield \"\"; + yield \\"\\"; } yield *inner(); @@ -394,7 +396,7 @@ for (var x of delegate_yield_generator()) { function *delegate_return_generator() { function *inner() { - return \"\"; + return \\"\\"; } var x: number = yield *inner(); // error: string ~> number @@ -404,7 +406,7 @@ function *delegate_return_generator() { function *delegate_next_iterable(xs: Array) { yield *xs; } -delegate_next_iterable([]).next(\"\"); // error: Iterator has no next value +delegate_next_iterable([]).next(\\"\\"); // error: Iterator has no next value function *delegate_yield_iterable(xs: Array) { yield *xs; @@ -433,7 +435,7 @@ function *multiple_return(b) { if (b) { return 0; } else { - return \"foo\"; + return \\"foo\\"; } } let multiple_return_result = multiple_return().next(); @@ -443,7 +445,7 @@ if (multiple_return_result.done) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function* stmt_yield(): Generator { yield 0; // ok - yield \"\"; // error: string ~> number + yield \\"\\"; // error: string ~> number } function* stmt_next(): Generator { @@ -463,43 +465,43 @@ function* stmt_return_ok(): Generator { } function* stmt_return_err(): Generator { - return \"\"; // error: string ~> number + return \\"\\"; // error: string ~> number } function* infer_stmt() { var x: boolean = yield 0; - return \"\"; + return \\"\\"; } for (var x of infer_stmt()) { (x: string); } // error: number ~> string var infer_stmt_next = infer_stmt().next(0).value; // error: number ~> boolean -if (typeof infer_stmt_next === \"undefined\") { -} else if (typeof infer_stmt_next === \"number\") { +if (typeof infer_stmt_next === \\"undefined\\") { +} else if (typeof infer_stmt_next === \\"number\\") { } else { (infer_stmt_next: boolean); // error: string ~> boolean } function* widen_next() { var x = yield 0; - if (typeof x === \"number\") { - } else if (typeof x === \"boolean\") { + if (typeof x === \\"number\\") { + } else if (typeof x === \\"boolean\\") { } else { (x: string); // ok, sherlock } } widen_next().next(0); -widen_next().next(\"\"); +widen_next().next(\\"\\"); widen_next().next(true); function* widen_yield() { yield 0; - yield \"\"; + yield \\"\\"; yield true; } for (var x of widen_yield()) { - if (typeof x === \"number\") { - } else if (typeof x === \"boolean\") { + if (typeof x === \\"number\\") { + } else if (typeof x === \\"boolean\\") { } else { (x: string); // ok, sherlock } @@ -511,11 +513,11 @@ function* delegate_next_generator() { } yield* inner(); } -delegate_next_generator().next(\"\"); +delegate_next_generator().next(\\"\\"); function* delegate_yield_generator() { function* inner() { - yield \"\"; + yield \\"\\"; } yield* inner(); @@ -526,7 +528,7 @@ for (var x of delegate_yield_generator()) { function* delegate_return_generator() { function* inner() { - return \"\"; + return \\"\\"; } var x: number = yield* inner(); // error: string ~> number @@ -536,7 +538,7 @@ function* delegate_return_generator() { function* delegate_next_iterable(xs: Array) { yield* xs; } -delegate_next_iterable([]).next(\"\"); // error: Iterator has no next value +delegate_next_iterable([]).next(\\"\\"); // error: Iterator has no next value function* delegate_yield_iterable(xs: Array) { yield* xs; @@ -565,7 +567,7 @@ function* multiple_return(b) { if (b) { return 0; } else { - return \"foo\"; + return \\"foo\\"; } } let multiple_return_result = multiple_return().next(); @@ -575,15 +577,15 @@ if (multiple_return_result.done) { " `; -exports[`test return.js 1`] = ` +exports[`return.js 1`] = ` "function test1(gen: Generator) { - // You can pass whatever you like to return, it doesn\'t need to be related to - // the Generator\'s return type + // You can pass whatever you like to return, it doesn't need to be related to + // the Generator's return type var ret = gen.return(0); (ret.value: void); // error: string | number ~> void } -// However, a generator can \"refuse\" the return by catching an exception and +// However, a generator can \\"refuse\\" the return by catching an exception and // yielding or returning internally. function *refuse_return() { try { @@ -593,19 +595,19 @@ function *refuse_return() { } } var refuse_return_gen = refuse_return(); -var refuse_return_result = refuse_return_gen.return(\"string\"); +var refuse_return_result = refuse_return_gen.return(\\"string\\"); if (refuse_return_result.done) { (refuse_return_result.value: string); // error: number | void ~> string } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function test1(gen: Generator) { - // You can pass whatever you like to return, it doesn\'t need to be related to - // the Generator\'s return type + // You can pass whatever you like to return, it doesn't need to be related to + // the Generator's return type var ret = gen.return(0); (ret.value: void); // error: string | number ~> void } -// However, a generator can \"refuse\" the return by catching an exception and +// However, a generator can \\"refuse\\" the return by catching an exception and // yielding or returning internally. function* refuse_return() { try { @@ -615,14 +617,14 @@ function* refuse_return() { } } var refuse_return_gen = refuse_return(); -var refuse_return_result = refuse_return_gen.return(\"string\"); +var refuse_return_result = refuse_return_gen.return(\\"string\\"); if (refuse_return_result.done) { (refuse_return_result.value: string); // error: number | void ~> string } " `; -exports[`test throw.js 1`] = ` +exports[`throw.js 1`] = ` "function *catch_return() { try { yield 0; @@ -631,7 +633,7 @@ exports[`test throw.js 1`] = ` } } -var catch_return_value = catch_return().throw(\"\").value; +var catch_return_value = catch_return().throw(\\"\\").value; if (catch_return_value !== undefined) { (catch_return_value : string); // error: number ~> string } @@ -644,7 +646,7 @@ function *yield_return() { yield e; } } -var yield_return_value = yield_return().throw(\"\").value; +var yield_return_value = yield_return().throw(\\"\\").value; if (yield_return_value !== undefined) { (yield_return_value: string); // error: number ~> string } @@ -657,7 +659,7 @@ function* catch_return() { } } -var catch_return_value = catch_return().throw(\"\").value; +var catch_return_value = catch_return().throw(\\"\\").value; if (catch_return_value !== undefined) { (catch_return_value: string); // error: number ~> string } @@ -670,14 +672,14 @@ function* yield_return() { yield e; } } -var yield_return_value = yield_return().throw(\"\").value; +var yield_return_value = yield_return().throw(\\"\\").value; if (yield_return_value !== undefined) { (yield_return_value: string); // error: number ~> string } " `; -exports[`test variance.js 1`] = ` +exports[`variance.js 1`] = ` "declare var g1: Generator; var g2: Generator = g1; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/flow/generics/__snapshots__/jsfmt.spec.js.snap b/tests/flow/generics/__snapshots__/jsfmt.spec.js.snap index 712067d81..f5921dc61 100644 --- a/tests/flow/generics/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/generics/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test generics.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`generics.js 1`] = ` "class C { x:X; constructor(x:X) { this.x = x; } @@ -36,12 +38,12 @@ class H extends G> { } var h1 = new H(); -h1.foo([\"...\"]); +h1.foo([\\"...\\"]); var h2:F>>> = h1; var obj : Object = {} // error, arity 0 -var fn : Function = function() { return \'foo\'; } // error, arity 0 -var fn : function = function() { return \'foo\'; } // error, arity 0 +var fn : Function = function() { return 'foo'; } // error, arity 0 +var fn : function = function() { return 'foo'; } // error, arity 0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class C { x: X; @@ -91,15 +93,15 @@ class H extends G> { } var h1 = new H(); -h1.foo([\"...\"]); +h1.foo([\\"...\\"]); var h2: F>>> = h1; var obj: Object = {}; // error, arity 0 var fn: Function = function() { - return \"foo\"; + return \\"foo\\"; }; // error, arity 0 var fn: function = function() { - return \"foo\"; + return \\"foo\\"; }; // error, arity 0 " `; diff --git a/tests/flow/geolocation/__snapshots__/jsfmt.spec.js.snap b/tests/flow/geolocation/__snapshots__/jsfmt.spec.js.snap index 99a380447..9d5354838 100644 --- a/tests/flow/geolocation/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/geolocation/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test a.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a.js 1`] = ` "/* @flow */ var geolocation = new Geolocation(); diff --git a/tests/flow/get-def/__snapshots__/jsfmt.spec.js.snap b/tests/flow/get-def/__snapshots__/jsfmt.spec.js.snap index dff1ec58c..dd91c8110 100644 --- a/tests/flow/get-def/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/get-def/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,9 @@ -exports[`test example.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`example.js 1`] = ` "/* @flow */ -var lib = require(\'./library\'); +var lib = require('./library'); function add(a: number, b: number): number { return a + b; @@ -17,7 +19,7 @@ lib.bar(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var lib = require(\"./library\"); +var lib = require(\\"./library\\"); function add(a: number, b: number): number { return a + b; @@ -33,34 +35,34 @@ lib.bar(); " `; -exports[`test imports.js 1`] = ` +exports[`imports.js 1`] = ` "// @flow -import thing from \"./helpers/exports_default.js\"; +import thing from \\"./helpers/exports_default.js\\"; thing; -import {foo, bar as baz} from \"./helpers/exports_named.js\"; +import {foo, bar as baz} from \\"./helpers/exports_named.js\\"; foo; baz; -import * as things from \"./helpers/exports_named.js\"; +import * as things from \\"./helpers/exports_named.js\\"; things; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import thing from \"./helpers/exports_default.js\"; +import thing from \\"./helpers/exports_default.js\\"; thing; -import { foo, bar as baz } from \"./helpers/exports_named.js\"; +import { foo, bar as baz } from \\"./helpers/exports_named.js\\"; foo; baz; -import * as things from \"./helpers/exports_named.js\"; +import * as things from \\"./helpers/exports_named.js\\"; things; " `; -exports[`test library.js 1`] = ` +exports[`library.js 1`] = ` "/* @flow */ module.exports = { diff --git a/tests/flow/get-def/helpers/__snapshots__/jsfmt.spec.js.snap b/tests/flow/get-def/helpers/__snapshots__/jsfmt.spec.js.snap index b86e95763..569ef7c49 100644 --- a/tests/flow/get-def/helpers/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/get-def/helpers/__snapshots__/jsfmt.spec.js.snap @@ -1,27 +1,29 @@ -exports[`test exports_default.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`exports_default.js 1`] = ` "// @flow -const x = \"foo\"; +const x = \\"foo\\"; export default x; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -const x = \"foo\"; +const x = \\"foo\\"; export default x; " `; -exports[`test exports_named.js 1`] = ` +exports[`exports_named.js 1`] = ` "// @flow -export const foo = \"foo\"; -export const bar = \"bar\"; +export const foo = \\"foo\\"; +export const bar = \\"bar\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -export const foo = \"foo\"; -export const bar = \"bar\"; +export const foo = \\"foo\\"; +export const bar = \\"bar\\"; " `; diff --git a/tests/flow/get-def2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/get-def2/__snapshots__/jsfmt.spec.js.snap index 4f5620c74..ac43726ae 100644 --- a/tests/flow/get-def2/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/get-def2/__snapshots__/jsfmt.spec.js.snap @@ -1,27 +1,29 @@ -exports[`test Parent.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Parent.js 1`] = ` "// @flow -var ParentFoo = {foo: \'bar\'}; +var ParentFoo = {foo: 'bar'}; module.exports = {ParentFoo}; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var ParentFoo = { foo: \"bar\" }; +var ParentFoo = { foo: \\"bar\\" }; module.exports = { ParentFoo }; " `; -exports[`test main.js 1`] = ` +exports[`main.js 1`] = ` "// @flow -var Parent = require(\'./Parent\'); +var Parent = require('./Parent'); // Hops through destructuring let ParentFoo; ({ParentFoo} = Parent); ParentFoo; // Points to lval in line above this -// Follows assignment on simple/\"non-destructuring\" patterns +// Follows assignment on simple/\\"non-destructuring\\" patterns let ParentFoo2; ParentFoo2 = Parent; ParentFoo2; // Points to LHS of line above this @@ -30,22 +32,22 @@ ParentFoo2; // Points to LHS of line above this let ParentFoo3 = Parent; ParentFoo3; // Points to LHS of line above this -// Follows non-destructured property access of \`require(\'Parent\')\` -let foo = require(\'./Parent\').ParentFoo.foo; +// Follows non-destructured property access of \`require('Parent')\` +let foo = require('./Parent').ParentFoo.foo; foo; -import type {Foo} from \'./types\'; +import type {Foo} from './types'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var Parent = require(\"./Parent\"); +var Parent = require(\\"./Parent\\"); // Hops through destructuring let ParentFoo; ({ ParentFoo } = Parent); ParentFoo; // Points to lval in line above this -// Follows assignment on simple/\"non-destructuring\" patterns +// Follows assignment on simple/\\"non-destructuring\\" patterns let ParentFoo2; ParentFoo2 = Parent; ParentFoo2; // Points to LHS of line above this @@ -54,15 +56,15 @@ ParentFoo2; // Points to LHS of line above this let ParentFoo3 = Parent; ParentFoo3; // Points to LHS of line above this -// Follows non-destructured property access of \`require(\'Parent\')\` -let foo = require(\"./Parent\").ParentFoo.foo; +// Follows non-destructured property access of \`require('Parent')\` +let foo = require(\\"./Parent\\").ParentFoo.foo; foo; -import type { Foo } from \"./types\"; +import type { Foo } from \\"./types\\"; " `; -exports[`test override.js 1`] = ` +exports[`override.js 1`] = ` "// @flow class C { @@ -93,26 +95,26 @@ class D extends C { " `; -exports[`test react.js 1`] = ` -"var React = require(\'react\'); +exports[`react.js 1`] = ` +"var React = require('react'); class C extends React.Component { props: { x: string }; } -let msg = \"hello\"; +let msg = \\"hello\\"; (); (
); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"react\"); +var React = require(\\"react\\"); class C extends React.Component { props: { x: string }; } -let msg = \"hello\"; +let msg = \\"hello\\"; ; @@ -120,7 +122,7 @@ let msg = \"hello\"; " `; -exports[`test types.js 1`] = ` +exports[`types.js 1`] = ` "// @flow export type Foo = {}; diff --git a/tests/flow/get-def2/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/get-def2/lib/__snapshots__/jsfmt.spec.js.snap index db39ea781..85d8aec26 100644 --- a/tests/flow/get-def2/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/get-def2/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,7 @@ -exports[`test jsx.js 1`] = ` -"declare var $React: $Exports<\'react\'>; // fake import +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx.js 1`] = ` +"declare var $React: $Exports<'react'>; // fake import type $JSXIntrinsic = Class<$React.Component>; type $JSXIntrinsics = { @@ -7,7 +9,7 @@ type $JSXIntrinsics = { span: $JSXIntrinsic<{id: string, class: string}>, }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -declare var $React: $Exports<\"react\">; // fake import +declare var $React: $Exports<\\"react\\">; // fake import type $JSXIntrinsic = Class<$React.Component>; type $JSXIntrinsics = { diff --git a/tests/flow/get-imports-and-importers/__snapshots__/jsfmt.spec.js.snap b/tests/flow/get-imports-and-importers/__snapshots__/jsfmt.spec.js.snap index 92b6ffc1d..09af19f6d 100644 --- a/tests/flow/get-imports-and-importers/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/get-imports-and-importers/__snapshots__/jsfmt.spec.js.snap @@ -1,32 +1,34 @@ -exports[`test a.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a.js 1`] = ` "// @flow ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow " `; -exports[`test b.js 1`] = ` +exports[`b.js 1`] = ` "/** * @flow * @providesModule b */ -require(\'./a\'); +require('./a'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow * @providesModule b */ -require(\"./a\"); +require(\\"./a\\"); " `; -exports[`test c.js 1`] = ` +exports[`c.js 1`] = ` "// @flow -require(\'./a.js\'); -require(\'b\'); +require('./a.js'); +require('b'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -require(\"./a.js\"); -require(\"b\"); +require(\\"./a.js\\"); +require(\\"b\\"); " `; diff --git a/tests/flow/getters_and_setters_disabled/__snapshots__/jsfmt.spec.js.snap b/tests/flow/getters_and_setters_disabled/__snapshots__/jsfmt.spec.js.snap index fbd8130f7..c9a2dafe2 100644 --- a/tests/flow/getters_and_setters_disabled/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/getters_and_setters_disabled/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test getters_and_setters.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`getters_and_setters.js 1`] = ` "/** * @flow */ diff --git a/tests/flow/getters_and_setters_enabled/__snapshots__/jsfmt.spec.js.snap b/tests/flow/getters_and_setters_enabled/__snapshots__/jsfmt.spec.js.snap index b58304171..4e80b1e76 100644 --- a/tests/flow/getters_and_setters_enabled/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/getters_and_setters_enabled/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test class.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class.js 1`] = ` "/** * @flow */ @@ -24,10 +26,10 @@ class Foo { get propWithSubtypingGetterAndSetterReordered(): ?number { return 4; } get propWithMismatchingGetterAndSetter(): number { return 4; } - set propWithMismatchingGetterAndSetter(x: string) { } // doesn\'t match getter (OK) + set propWithMismatchingGetterAndSetter(x: string) { } // doesn't match getter (OK) propOverriddenWithGetter: number; - get propOverriddenWithGetter() { return \"hello\"; } + get propOverriddenWithGetter() { return \\"hello\\"; } propOverriddenWithSetter: number; set propOverriddenWithSetter(x: string) { } @@ -47,8 +49,8 @@ foo.goodSetterNoAnnotation = 123; foo.goodSetterWithAnnotation = 123; // TODO: Why does no annotation mean no error? -foo.goodSetterNoAnnotation = \"hello\"; // Error string ~> number -foo.goodSetterWithAnnotation = \"hello\"; // Error string ~> number +foo.goodSetterNoAnnotation = \\"hello\\"; // Error string ~> number +foo.goodSetterWithAnnotation = \\"hello\\"; // Error string ~> number var testSubtypingGetterAndSetter: number = foo.propWithSubtypingGetterAndSetter; // Error ?number ~> number @@ -96,11 +98,11 @@ class Foo { get propWithMismatchingGetterAndSetter(): number { return 4; } - set propWithMismatchingGetterAndSetter(x: string) {} // doesn\'t match getter (OK) + set propWithMismatchingGetterAndSetter(x: string) {} // doesn't match getter (OK) propOverriddenWithGetter: number; get propOverriddenWithGetter() { - return \"hello\"; + return \\"hello\\"; } propOverriddenWithSetter: number; @@ -121,8 +123,8 @@ foo.goodSetterNoAnnotation = 123; foo.goodSetterWithAnnotation = 123; // TODO: Why does no annotation mean no error? -foo.goodSetterNoAnnotation = \"hello\"; // Error string ~> number -foo.goodSetterWithAnnotation = \"hello\"; // Error string ~> number +foo.goodSetterNoAnnotation = \\"hello\\"; // Error string ~> number +foo.goodSetterWithAnnotation = \\"hello\\"; // Error string ~> number var testSubtypingGetterAndSetter: number = foo.propWithSubtypingGetterAndSetter; // Error ?number ~> number @@ -131,7 +133,7 @@ foo.propOverriddenWithSetter = 123; // Error number ~> string " `; -exports[`test object.js 1`] = ` +exports[`object.js 1`] = ` "/** * @flow */ @@ -179,17 +181,17 @@ var testGetterWithError2: string = obj.goodGetterWithAnnotation; // Error number obj.goodSetterNoAnnotation = 123; obj.goodSetterWithAnnotation = 123; -obj.goodSetterNoAnnotation = \"hello\"; // Error string ~> number -obj.goodSetterWithAnnotation = \"hello\"; // Error string ~> number +obj.goodSetterNoAnnotation = \\"hello\\"; // Error string ~> number +obj.goodSetterWithAnnotation = \\"hello\\"; // Error string ~> number var testSubtypingGetterAndSetter: number = obj.propWithSubtypingGetterAndSetter; // Error ?number ~> number // When building this feature, it was tempting to flow the setter into the // getter and then use either the getter or setter as the type of the property. -// This example shows the danger of using the getter\'s type +// This example shows the danger of using the getter's type obj.exampleOfOrderOfGetterAndSetter = new C(); // Error C ~> B -// And this example shows the danger of using the setter\'s type. +// And this example shows the danger of using the setter's type. var testExampleOrOrderOfGetterAndSetterReordered: number = obj.exampleOfOrderOfGetterAndSetterReordered; // Error A ~> B ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -256,22 +258,22 @@ var testGetterWithError2: string = obj.goodGetterWithAnnotation; // Error number obj.goodSetterNoAnnotation = 123; obj.goodSetterWithAnnotation = 123; -obj.goodSetterNoAnnotation = \"hello\"; // Error string ~> number -obj.goodSetterWithAnnotation = \"hello\"; // Error string ~> number +obj.goodSetterNoAnnotation = \\"hello\\"; // Error string ~> number +obj.goodSetterWithAnnotation = \\"hello\\"; // Error string ~> number var testSubtypingGetterAndSetter: number = obj.propWithSubtypingGetterAndSetter; // Error ?number ~> number // When building this feature, it was tempting to flow the setter into the // getter and then use either the getter or setter as the type of the property. -// This example shows the danger of using the getter\'s type +// This example shows the danger of using the getter's type obj.exampleOfOrderOfGetterAndSetter = new C(); // Error C ~> B -// And this example shows the danger of using the setter\'s type. +// And this example shows the danger of using the setter's type. var testExampleOrOrderOfGetterAndSetterReordered: number = obj.exampleOfOrderOfGetterAndSetterReordered; // Error A ~> B " `; -exports[`test react.js 1`] = ` +exports[`react.js 1`] = ` "/** * @flow */ @@ -302,7 +304,7 @@ React.createClass({ " `; -exports[`test variance.js 1`] = ` +exports[`variance.js 1`] = ` "/* @flow */ class A {} diff --git a/tests/flow/haste_cycle/__snapshots__/jsfmt.spec.js.snap b/tests/flow/haste_cycle/__snapshots__/jsfmt.spec.js.snap index b785080f2..48d61ff57 100644 --- a/tests/flow/haste_cycle/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/haste_cycle/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test API.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`API.js 1`] = ` "// @flow -var OpenGraphObject = require(\'./models/OpenGraphObject.js\'); +var OpenGraphObject = require('./models/OpenGraphObject.js'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var OpenGraphObject = require(\"./models/OpenGraphObject.js\"); +var OpenGraphObject = require(\\"./models/OpenGraphObject.js\\"); " `; diff --git a/tests/flow/haste_cycle/models/__snapshots__/jsfmt.spec.js.snap b/tests/flow/haste_cycle/models/__snapshots__/jsfmt.spec.js.snap index 972cb4e5f..baff21cd7 100644 --- a/tests/flow/haste_cycle/models/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/haste_cycle/models/__snapshots__/jsfmt.spec.js.snap @@ -1,32 +1,34 @@ -exports[`test OpenGraphAction.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`OpenGraphAction.js 1`] = ` "// @flow -var OpenGraphValueContainer = require(\'./OpenGraphValueContainer.js\'); +var OpenGraphValueContainer = require('./OpenGraphValueContainer.js'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var OpenGraphValueContainer = require(\"./OpenGraphValueContainer.js\"); +var OpenGraphValueContainer = require(\\"./OpenGraphValueContainer.js\\"); " `; -exports[`test OpenGraphObject.js 1`] = ` +exports[`OpenGraphObject.js 1`] = ` "// @flow -var OpenGraphValueContainer = require(\'./OpenGraphValueContainer.js\'); +var OpenGraphValueContainer = require('./OpenGraphValueContainer.js'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var OpenGraphValueContainer = require(\"./OpenGraphValueContainer.js\"); +var OpenGraphValueContainer = require(\\"./OpenGraphValueContainer.js\\"); " `; -exports[`test OpenGraphValueContainer.js 1`] = ` +exports[`OpenGraphValueContainer.js 1`] = ` "// @flow -var OpenGraphObject = require(\'./OpenGraphObject.js\'); +var OpenGraphObject = require('./OpenGraphObject.js'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var OpenGraphObject = require(\"./OpenGraphObject.js\"); +var OpenGraphObject = require(\\"./OpenGraphObject.js\\"); " `; diff --git a/tests/flow/haste_dupe/__snapshots__/jsfmt.spec.js.snap b/tests/flow/haste_dupe/__snapshots__/jsfmt.spec.js.snap index daebb5358..56742bec9 100644 --- a/tests/flow/haste_dupe/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/haste_dupe/__snapshots__/jsfmt.spec.js.snap @@ -1,48 +1,50 @@ -exports[`test dupe1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`dupe1.js 1`] = ` "/** * Dupe provider 1/2 * @providesModule Dupe * @flow */ -module.exports = \"dupe1\"; +module.exports = \\"dupe1\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Dupe provider 1/2 * @providesModule Dupe * @flow */ -module.exports = \"dupe1\"; +module.exports = \\"dupe1\\"; " `; -exports[`test dupe2.js 1`] = ` +exports[`dupe2.js 1`] = ` "/** * Dupe provider 2/2 * @providesModule Dupe * @flow */ -module.exports = \"dupe2\"; +module.exports = \\"dupe2\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Dupe provider 2/2 * @providesModule Dupe * @flow */ -module.exports = \"dupe2\"; +module.exports = \\"dupe2\\"; " `; -exports[`test requires_dupe.js 1`] = ` +exports[`requires_dupe.js 1`] = ` "/** * depends on doubly-provided module * @flow */ -var dupe = require(\'Dupe\'); +var dupe = require('Dupe'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * depends on doubly-provided module * @flow */ -var dupe = require(\"Dupe\"); +var dupe = require(\\"Dupe\\"); " `; diff --git a/tests/flow/ignore_package/__snapshots__/jsfmt.spec.js.snap b/tests/flow/ignore_package/__snapshots__/jsfmt.spec.js.snap index a4577d6f5..8db463bf1 100644 --- a/tests/flow/ignore_package/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/ignore_package/__snapshots__/jsfmt.spec.js.snap @@ -1,12 +1,14 @@ -exports[`test foo.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` "/** @flow */ /* this require routes to nothing, because our node_modules/underscore directory has been excluded. If package.json files - are being excluded properly, we\'ll get - \'Required module not found\'. + are being excluded properly, we'll get + 'Required module not found'. */ -var _ = require(\'underscore\'); +var _ = require('underscore'); function foo(): string { return _.foo(); @@ -18,10 +20,10 @@ module.exports = foo; /* this require routes to nothing, because our node_modules/underscore directory has been excluded. If package.json files - are being excluded properly, we\'ll get - \'Required module not found\'. + are being excluded properly, we'll get + 'Required module not found'. */ -var _ = require(\"underscore\"); +var _ = require(\\"underscore\\"); function foo(): string { return _.foo(); diff --git a/tests/flow/immutable_methods/__snapshots__/jsfmt.spec.js.snap b/tests/flow/immutable_methods/__snapshots__/jsfmt.spec.js.snap index c2bc11be0..c2f793b90 100644 --- a/tests/flow/immutable_methods/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/immutable_methods/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "class A { foo(): A { return this; } } diff --git a/tests/flow/import_type/__snapshots__/jsfmt.spec.js.snap b/tests/flow/import_type/__snapshots__/jsfmt.spec.js.snap index 059cd220d..554d22ae4 100644 --- a/tests/flow/import_type/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/import_type/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test ExportCJSDefault_Class.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ExportCJSDefault_Class.js 1`] = ` "/** * @flow */ @@ -29,7 +31,7 @@ module.exports = ClassFoo3; " `; -exports[`test ExportCJSNamed_Class.js 1`] = ` +exports[`ExportCJSNamed_Class.js 1`] = ` "/** * @flow */ @@ -80,7 +82,7 @@ exports.foo5Inst = new ClassFoo5(); " `; -exports[`test ExportDefault_Class.js 1`] = ` +exports[`ExportDefault_Class.js 1`] = ` "/** * @flow */ @@ -107,7 +109,7 @@ export var foo1Inst = new ClassFoo1(); " `; -exports[`test ExportNamed_Alias.js 1`] = ` +exports[`ExportNamed_Alias.js 1`] = ` "/** * @flow */ @@ -138,7 +140,7 @@ export function givesAFoo3Obj(): AliasFoo3 { " `; -exports[`test ExportNamed_Class.js 1`] = ` +exports[`ExportNamed_Class.js 1`] = ` "/** * @flow */ @@ -165,7 +167,7 @@ export var foo2Inst = new ClassFoo2(); " `; -exports[`test ExportsANumber.js 1`] = ` +exports[`ExportsANumber.js 1`] = ` "/* @ flow */ export var numValue = 42; @@ -176,7 +178,7 @@ export var numValue = 42; " `; -exports[`test import_type.js 1`] = ` +exports[`import_type.js 1`] = ` "/** * @flow */ @@ -185,8 +187,8 @@ exports[`test import_type.js 1`] = ` // == Importing Class Type (Default Export) == // ///////////////////////////////////////////////// -import type ClassFoo1 from \"./ExportDefault_Class\"; -import {foo1Inst} from \"./ExportDefault_Class\"; +import type ClassFoo1 from \\"./ExportDefault_Class\\"; +import {foo1Inst} from \\"./ExportDefault_Class\\"; var a1: ClassFoo1 = foo1Inst; var a2: number = foo1Inst; // Error: ClassFoo1 ~> number @@ -196,8 +198,8 @@ new ClassFoo1(); // Error: ClassFoo1 is not a value-identifier // == Importing Class Type (Named Export) == // /////////////////////////////////////////////// -import type {ClassFoo2} from \"./ExportNamed_Class\"; -import {foo2Inst} from \"./ExportNamed_Class\"; +import type {ClassFoo2} from \\"./ExportNamed_Class\\"; +import {foo2Inst} from \\"./ExportNamed_Class\\"; var b1: ClassFoo2 = foo2Inst; var b2: number = foo2Inst; // Error: ClassFoo2 ~> number @@ -207,8 +209,8 @@ new ClassFoo2(); // Error: ClassFoo2 is not a value-identifier // == Importing Class Type (CJS Default Export) == // ///////////////////////////////////////////////////// -import type ClassFoo3T from \"./ExportCJSDefault_Class\"; -import ClassFoo3 from \"./ExportCJSDefault_Class\"; +import type ClassFoo3T from \\"./ExportCJSDefault_Class\\"; +import ClassFoo3 from \\"./ExportCJSDefault_Class\\"; var c1: ClassFoo3T = new ClassFoo3(); new ClassFoo3T(); // Error: ClassFoo3 is not a value-identifier @@ -216,38 +218,38 @@ new ClassFoo3T(); // Error: ClassFoo3 is not a value-identifier // == Importing Class Type (CJS Named Export) == // /////////////////////////////////////////////////// -import type {ClassFoo4, ClassFoo5} from \"./ExportCJSNamed_Class\"; -import {foo4Inst, foo5Inst} from \"./ExportCJSNamed_Class\"; +import type {ClassFoo4, ClassFoo5} from \\"./ExportCJSNamed_Class\\"; +import {foo4Inst, foo5Inst} from \\"./ExportCJSNamed_Class\\"; var d1: ClassFoo4 = foo4Inst; var d2: number = foo4Inst; // Error: ClassFoo4 ~> number new ClassFoo4(); // Error: ClassFoo4 is not a value-identifier -// TODO: this errors correctly, but the message is just \'can\'t resolve name\' -var d3: typeof ClassFoo5 = foo5Inst; // Error: Can\'t typeof a type alias +// TODO: this errors correctly, but the message is just 'can't resolve name' +var d3: typeof ClassFoo5 = foo5Inst; // Error: Can't typeof a type alias //////////////////////////////////////////// // == Import Type Alias (Named Export) == // //////////////////////////////////////////// -import type {AliasFoo3} from \"./ExportNamed_Alias\"; -import {givesAFoo3Obj} from \"./ExportNamed_Alias\"; +import type {AliasFoo3} from \\"./ExportNamed_Alias\\"; +import {givesAFoo3Obj} from \\"./ExportNamed_Alias\\"; var e1: AliasFoo3 = givesAFoo3Obj(); var e2: number = givesAFoo3Obj(); // Error: AliasFoo3 ~> number -var e3: typeof AliasFoo3 = givesAFoo3Obj(); // Error: Can\'t typeof a type alias +var e3: typeof AliasFoo3 = givesAFoo3Obj(); // Error: Can't typeof a type alias ////////////////////////////////////////////// // == Import Type Alias (Default Export) == // ////////////////////////////////////////////// -// TODO: No support for this right now. It\'s most likely possible, but it\'s +// TODO: No support for this right now. It's most likely possible, but it's // unclear how useful it is at the moment and it entails a little -// more work than named type exports, so I\'m punting on it for now. +// more work than named type exports, so I'm punting on it for now. /////////////////////////////////////////////////////// // == Import Type With Non-Alias Compatible Value == // /////////////////////////////////////////////////////// -import type {numValue} from \"./ExportsANumber\"; // Error: Cannot import-type a number value +import type {numValue} from \\"./ExportsANumber\\"; // Error: Cannot import-type a number value //////////////////////////////////////////////////////////////////////// // == Regression Test: https://github.com/facebook/flow/issues/359 == // @@ -255,7 +257,7 @@ import type {numValue} from \"./ExportsANumber\"; // Error: Cannot import-type a // env contexts. // //////////////////////////////////////////////////////////////////////// -import type ClassFoo6 from \"./issue-359\"; +import type ClassFoo6 from \\"./issue-359\\"; function foo() { ClassFoo6; // Error: Not a value binding } @@ -268,8 +270,8 @@ function foo() { // == Importing Class Type (Default Export) == // ///////////////////////////////////////////////// -import type ClassFoo1 from \"./ExportDefault_Class\"; -import { foo1Inst } from \"./ExportDefault_Class\"; +import type ClassFoo1 from \\"./ExportDefault_Class\\"; +import { foo1Inst } from \\"./ExportDefault_Class\\"; var a1: ClassFoo1 = foo1Inst; var a2: number = foo1Inst; // Error: ClassFoo1 ~> number @@ -279,8 +281,8 @@ new ClassFoo1(); // Error: ClassFoo1 is not a value-identifier // == Importing Class Type (Named Export) == // /////////////////////////////////////////////// -import type { ClassFoo2 } from \"./ExportNamed_Class\"; -import { foo2Inst } from \"./ExportNamed_Class\"; +import type { ClassFoo2 } from \\"./ExportNamed_Class\\"; +import { foo2Inst } from \\"./ExportNamed_Class\\"; var b1: ClassFoo2 = foo2Inst; var b2: number = foo2Inst; // Error: ClassFoo2 ~> number @@ -290,8 +292,8 @@ new ClassFoo2(); // Error: ClassFoo2 is not a value-identifier // == Importing Class Type (CJS Default Export) == // ///////////////////////////////////////////////////// -import type ClassFoo3T from \"./ExportCJSDefault_Class\"; -import ClassFoo3 from \"./ExportCJSDefault_Class\"; +import type ClassFoo3T from \\"./ExportCJSDefault_Class\\"; +import ClassFoo3 from \\"./ExportCJSDefault_Class\\"; var c1: ClassFoo3T = new ClassFoo3(); new ClassFoo3T(); // Error: ClassFoo3 is not a value-identifier @@ -299,38 +301,38 @@ new ClassFoo3T(); // Error: ClassFoo3 is not a value-identifier // == Importing Class Type (CJS Named Export) == // /////////////////////////////////////////////////// -import type { ClassFoo4, ClassFoo5 } from \"./ExportCJSNamed_Class\"; -import { foo4Inst, foo5Inst } from \"./ExportCJSNamed_Class\"; +import type { ClassFoo4, ClassFoo5 } from \\"./ExportCJSNamed_Class\\"; +import { foo4Inst, foo5Inst } from \\"./ExportCJSNamed_Class\\"; var d1: ClassFoo4 = foo4Inst; var d2: number = foo4Inst; // Error: ClassFoo4 ~> number new ClassFoo4(); // Error: ClassFoo4 is not a value-identifier -// TODO: this errors correctly, but the message is just \'can\'t resolve name\' -var d3: typeof ClassFoo5 = foo5Inst; // Error: Can\'t typeof a type alias +// TODO: this errors correctly, but the message is just 'can't resolve name' +var d3: typeof ClassFoo5 = foo5Inst; // Error: Can't typeof a type alias //////////////////////////////////////////// // == Import Type Alias (Named Export) == // //////////////////////////////////////////// -import type { AliasFoo3 } from \"./ExportNamed_Alias\"; -import { givesAFoo3Obj } from \"./ExportNamed_Alias\"; +import type { AliasFoo3 } from \\"./ExportNamed_Alias\\"; +import { givesAFoo3Obj } from \\"./ExportNamed_Alias\\"; var e1: AliasFoo3 = givesAFoo3Obj(); var e2: number = givesAFoo3Obj(); // Error: AliasFoo3 ~> number -var e3: typeof AliasFoo3 = givesAFoo3Obj(); // Error: Can\'t typeof a type alias +var e3: typeof AliasFoo3 = givesAFoo3Obj(); // Error: Can't typeof a type alias ////////////////////////////////////////////// // == Import Type Alias (Default Export) == // ////////////////////////////////////////////// -// TODO: No support for this right now. It\'s most likely possible, but it\'s +// TODO: No support for this right now. It's most likely possible, but it's // unclear how useful it is at the moment and it entails a little -// more work than named type exports, so I\'m punting on it for now. +// more work than named type exports, so I'm punting on it for now. /////////////////////////////////////////////////////// // == Import Type With Non-Alias Compatible Value == // /////////////////////////////////////////////////////// -import type { numValue } from \"./ExportsANumber\"; // Error: Cannot import-type a number value +import type { numValue } from \\"./ExportsANumber\\"; // Error: Cannot import-type a number value //////////////////////////////////////////////////////////////////////// // == Regression Test: https://github.com/facebook/flow/issues/359 == // @@ -338,29 +340,29 @@ import type { numValue } from \"./ExportsANumber\"; // Error: Cannot import-type // env contexts. // //////////////////////////////////////////////////////////////////////// -import type ClassFoo6 from \"./issue-359\"; +import type ClassFoo6 from \\"./issue-359\\"; function foo() { ClassFoo6; // Error: Not a value binding } " `; -exports[`test import_type_specifier.js 1`] = ` +exports[`import_type_specifier.js 1`] = ` "/** * @flow */ -import { Foo, type Baz } from \"../module\"; +import { Foo, type Baz } from \\"../module\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow */ -import { Foo, type Baz } from \"../module\"; +import { Foo, type Baz } from \\"../module\\"; " `; -exports[`test issue-359.js 1`] = ` +exports[`issue-359.js 1`] = ` "/* @flow */ class ClassFoo6 {}; diff --git a/tests/flow/import_typeof/__snapshots__/jsfmt.spec.js.snap b/tests/flow/import_typeof/__snapshots__/jsfmt.spec.js.snap index c2a0254bb..61939382b 100644 --- a/tests/flow/import_typeof/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/import_typeof/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test ExportCJSDefault_Class.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ExportCJSDefault_Class.js 1`] = ` "/** * @flow */ @@ -29,7 +31,7 @@ module.exports = ClassFoo3; " `; -exports[`test ExportCJSDefault_Number.js 1`] = ` +exports[`ExportCJSDefault_Number.js 1`] = ` "/* @flow */ module.exports = 42; @@ -40,7 +42,7 @@ module.exports = 42; " `; -exports[`test ExportCJSNamed_Class.js 1`] = ` +exports[`ExportCJSNamed_Class.js 1`] = ` "/** * @flow */ @@ -59,7 +61,7 @@ exports.ClassFoo4 = ClassFoo4; " `; -exports[`test ExportCJSNamed_Number.js 1`] = ` +exports[`ExportCJSNamed_Number.js 1`] = ` "/* @flow */ exports.num = 42; @@ -70,7 +72,7 @@ exports.num = 42; " `; -exports[`test ExportDefault_Class.js 1`] = ` +exports[`ExportDefault_Class.js 1`] = ` "/** * @flow */ @@ -95,7 +97,7 @@ export default ClassFoo1; " `; -exports[`test ExportDefault_Number.js 1`] = ` +exports[`ExportDefault_Number.js 1`] = ` "/* @flow */ export default 42; @@ -106,7 +108,7 @@ export default 42; " `; -exports[`test ExportNamed_Alias.js 1`] = ` +exports[`ExportNamed_Alias.js 1`] = ` "/** * @flow */ @@ -137,7 +139,7 @@ export function givesAFoo3Obj(): AliasFoo3 { " `; -exports[`test ExportNamed_Class.js 1`] = ` +exports[`ExportNamed_Class.js 1`] = ` "/** * @flow */ @@ -162,20 +164,20 @@ export { ClassFoo2 }; " `; -exports[`test ExportNamed_Multi.js 1`] = ` +exports[`ExportNamed_Multi.js 1`] = ` "// @flow export var num = 42; -export var str = \'asdf\'; +export var str = 'asdf'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow export var num = 42; -export var str = \"asdf\"; +export var str = \\"asdf\\"; " `; -exports[`test ExportNamed_Number.js 1`] = ` +exports[`ExportNamed_Number.js 1`] = ` "/* @flow */ export var num = 42; @@ -186,7 +188,7 @@ export var num = 42; " `; -exports[`test import_typeof.js 1`] = ` +exports[`import_typeof.js 1`] = ` "/** * @flow */ @@ -195,8 +197,8 @@ exports[`test import_typeof.js 1`] = ` // == Importing Class Typeof (Default Export) == // /////////////////////////////////////////////////// -import typeof ClassFoo1T from \"./ExportDefault_Class\"; -import ClassFoo1 from \"./ExportDefault_Class\"; +import typeof ClassFoo1T from \\"./ExportDefault_Class\\"; +import ClassFoo1 from \\"./ExportDefault_Class\\"; var a1: ClassFoo1T = ClassFoo1; var a2: ClassFoo1T = new ClassFoo1(); // Error: ClassFoo1 (inst) ~> ClassFoo1 (class) @@ -206,8 +208,8 @@ new ClassFoo1T(); // Error: ClassFoo1T is not bound to a value // == Importing Class Typeof (Named Export) == // ///////////////////////////////////////////////// -import typeof {ClassFoo2 as ClassFoo2T} from \"./ExportNamed_Class\"; -import {ClassFoo2} from \"./ExportNamed_Class\"; +import typeof {ClassFoo2 as ClassFoo2T} from \\"./ExportNamed_Class\\"; +import {ClassFoo2} from \\"./ExportNamed_Class\\"; var b1: ClassFoo2T = ClassFoo2; var b2: ClassFoo2T = new ClassFoo2(); // Error: ClassFoo2 (inst) ~> ClassFoo2 (class) @@ -217,8 +219,8 @@ new ClassFoo2T(); // Error: ClassFoo2T is not bound to a value // == Importing Class Typeof (CJS Default Export) == // /////////////////////////////////////////////////////// -import typeof ClassFoo3T from \"./ExportCJSDefault_Class\"; -import ClassFoo3 from \"./ExportCJSDefault_Class\"; +import typeof ClassFoo3T from \\"./ExportCJSDefault_Class\\"; +import ClassFoo3 from \\"./ExportCJSDefault_Class\\"; var c1: ClassFoo3T = ClassFoo3; var c2: ClassFoo3T = new ClassFoo3(); // Error: ClassFoo3 (inst) ~> ClassFoo3 (class) @@ -227,8 +229,8 @@ var c2: ClassFoo3T = new ClassFoo3(); // Error: ClassFoo3 (inst) ~> ClassFoo3 (c // == Importing Class Typeof (CJS Named Export) == // ///////////////////////////////////////////////////// -import typeof {ClassFoo4 as ClassFoo4T} from \"./ExportCJSNamed_Class\"; -import {ClassFoo4} from \"./ExportCJSNamed_Class\"; +import typeof {ClassFoo4 as ClassFoo4T} from \\"./ExportCJSNamed_Class\\"; +import {ClassFoo4} from \\"./ExportCJSNamed_Class\\"; var d1: ClassFoo4T = ClassFoo4; var d2: ClassFoo4T = new ClassFoo4(); // Error: ClassFoo4 (inst) ~> ClassFoo4 (class) @@ -237,58 +239,58 @@ var d2: ClassFoo4T = new ClassFoo4(); // Error: ClassFoo4 (inst) ~> ClassFoo4 (c // == Import Typeof Alias (Named Export) == // ////////////////////////////////////////////// -import typeof {AliasFoo3} from \"./ExportNamed_Alias\"; // Error: Can\'t \`import typeof\` type aliases! +import typeof {AliasFoo3} from \\"./ExportNamed_Alias\\"; // Error: Can't \`import typeof\` type aliases! //////////////////////////////////////////////// // == Import Typeof Alias (Default Export) == // //////////////////////////////////////////////// -// TODO: No support for this right now. It\'s most likely possible, but it\'s +// TODO: No support for this right now. It's most likely possible, but it's // unclear how useful it is at the moment and it entails a little -// more work than named type exports, so I\'m punting on it for now. +// more work than named type exports, so I'm punting on it for now. /////////////////////////////////////////////////////////////// // == Import Typeof With Non-Class Value (Default Export) == // /////////////////////////////////////////////////////////////// -import typeof num_default from \"./ExportDefault_Number\"; +import typeof num_default from \\"./ExportDefault_Number\\"; var f1: num_default = 42; -var f2: num_default = \'asdf\'; // Error: string ~> number +var f2: num_default = 'asdf'; // Error: string ~> number ///////////////////////////////////////////////////////////// // == Import Typeof With Non-Class Value (Named Export) == // ///////////////////////////////////////////////////////////// -import typeof {num as num_named} from \"./ExportNamed_Number\"; +import typeof {num as num_named} from \\"./ExportNamed_Number\\"; var g1: num_named = 42; -var g2: num_named = \'asdf\'; // Error: string ~> number +var g2: num_named = 'asdf'; // Error: string ~> number /////////////////////////////////////////////////////////////////// // == Import Typeof With Non-Class Value (CJS Default Export) == // /////////////////////////////////////////////////////////////////// -import typeof num_cjs_default from \"./ExportCJSDefault_Number\"; +import typeof num_cjs_default from \\"./ExportCJSDefault_Number\\"; var h1: num_cjs_default = 42; -var h2: num_cjs_default = \'asdf\'; // Error: string ~> number +var h2: num_cjs_default = 'asdf'; // Error: string ~> number ///////////////////////////////////////////////////////////////// // == Import Typeof With Non-Class Value (CJS Named Export) == // ///////////////////////////////////////////////////////////////// -import typeof {num as num_cjs_named} from \"./ExportCJSNamed_Number\"; +import typeof {num as num_cjs_named} from \\"./ExportCJSNamed_Number\\"; var i1: num_cjs_named = 42; -var i2: num_cjs_named = \'asdf\'; // Error: string ~> number +var i2: num_cjs_named = 'asdf'; // Error: string ~> number /////////////////////////////////////////////// // == Import Typeof ModuleNamespaceObject == // /////////////////////////////////////////////// -import typeof * as ModuleNSObjT from \"./ExportNamed_Multi\"; -var j1: ModuleNSObjT = {num: 42, str: \'asdf\'}; +import typeof * as ModuleNSObjT from \\"./ExportNamed_Multi\\"; +var j1: ModuleNSObjT = {num: 42, str: 'asdf'}; var j2: ModuleNSObjT = {num: 42, str: 42}; // Error: number ~> string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** @@ -299,8 +301,8 @@ var j2: ModuleNSObjT = {num: 42, str: 42}; // Error: number ~> string // == Importing Class Typeof (Default Export) == // /////////////////////////////////////////////////// -import typeof ClassFoo1T from \"./ExportDefault_Class\"; -import ClassFoo1 from \"./ExportDefault_Class\"; +import typeof ClassFoo1T from \\"./ExportDefault_Class\\"; +import ClassFoo1 from \\"./ExportDefault_Class\\"; var a1: ClassFoo1T = ClassFoo1; var a2: ClassFoo1T = new ClassFoo1(); // Error: ClassFoo1 (inst) ~> ClassFoo1 (class) @@ -310,8 +312,8 @@ new ClassFoo1T(); // Error: ClassFoo1T is not bound to a value // == Importing Class Typeof (Named Export) == // ///////////////////////////////////////////////// -import typeof { ClassFoo2 as ClassFoo2T } from \"./ExportNamed_Class\"; -import { ClassFoo2 } from \"./ExportNamed_Class\"; +import typeof { ClassFoo2 as ClassFoo2T } from \\"./ExportNamed_Class\\"; +import { ClassFoo2 } from \\"./ExportNamed_Class\\"; var b1: ClassFoo2T = ClassFoo2; var b2: ClassFoo2T = new ClassFoo2(); // Error: ClassFoo2 (inst) ~> ClassFoo2 (class) @@ -321,8 +323,8 @@ new ClassFoo2T(); // Error: ClassFoo2T is not bound to a value // == Importing Class Typeof (CJS Default Export) == // /////////////////////////////////////////////////////// -import typeof ClassFoo3T from \"./ExportCJSDefault_Class\"; -import ClassFoo3 from \"./ExportCJSDefault_Class\"; +import typeof ClassFoo3T from \\"./ExportCJSDefault_Class\\"; +import ClassFoo3 from \\"./ExportCJSDefault_Class\\"; var c1: ClassFoo3T = ClassFoo3; var c2: ClassFoo3T = new ClassFoo3(); // Error: ClassFoo3 (inst) ~> ClassFoo3 (class) @@ -331,8 +333,8 @@ var c2: ClassFoo3T = new ClassFoo3(); // Error: ClassFoo3 (inst) ~> ClassFoo3 (c // == Importing Class Typeof (CJS Named Export) == // ///////////////////////////////////////////////////// -import typeof { ClassFoo4 as ClassFoo4T } from \"./ExportCJSNamed_Class\"; -import { ClassFoo4 } from \"./ExportCJSNamed_Class\"; +import typeof { ClassFoo4 as ClassFoo4T } from \\"./ExportCJSNamed_Class\\"; +import { ClassFoo4 } from \\"./ExportCJSNamed_Class\\"; var d1: ClassFoo4T = ClassFoo4; var d2: ClassFoo4T = new ClassFoo4(); // Error: ClassFoo4 (inst) ~> ClassFoo4 (class) @@ -341,58 +343,58 @@ var d2: ClassFoo4T = new ClassFoo4(); // Error: ClassFoo4 (inst) ~> ClassFoo4 (c // == Import Typeof Alias (Named Export) == // ////////////////////////////////////////////// -import typeof { AliasFoo3 } from \"./ExportNamed_Alias\"; // Error: Can\'t \`import typeof\` type aliases! +import typeof { AliasFoo3 } from \\"./ExportNamed_Alias\\"; // Error: Can't \`import typeof\` type aliases! //////////////////////////////////////////////// // == Import Typeof Alias (Default Export) == // //////////////////////////////////////////////// -// TODO: No support for this right now. It\'s most likely possible, but it\'s +// TODO: No support for this right now. It's most likely possible, but it's // unclear how useful it is at the moment and it entails a little -// more work than named type exports, so I\'m punting on it for now. +// more work than named type exports, so I'm punting on it for now. /////////////////////////////////////////////////////////////// // == Import Typeof With Non-Class Value (Default Export) == // /////////////////////////////////////////////////////////////// -import typeof num_default from \"./ExportDefault_Number\"; +import typeof num_default from \\"./ExportDefault_Number\\"; var f1: num_default = 42; -var f2: num_default = \"asdf\"; // Error: string ~> number +var f2: num_default = \\"asdf\\"; // Error: string ~> number ///////////////////////////////////////////////////////////// // == Import Typeof With Non-Class Value (Named Export) == // ///////////////////////////////////////////////////////////// -import typeof { num as num_named } from \"./ExportNamed_Number\"; +import typeof { num as num_named } from \\"./ExportNamed_Number\\"; var g1: num_named = 42; -var g2: num_named = \"asdf\"; // Error: string ~> number +var g2: num_named = \\"asdf\\"; // Error: string ~> number /////////////////////////////////////////////////////////////////// // == Import Typeof With Non-Class Value (CJS Default Export) == // /////////////////////////////////////////////////////////////////// -import typeof num_cjs_default from \"./ExportCJSDefault_Number\"; +import typeof num_cjs_default from \\"./ExportCJSDefault_Number\\"; var h1: num_cjs_default = 42; -var h2: num_cjs_default = \"asdf\"; // Error: string ~> number +var h2: num_cjs_default = \\"asdf\\"; // Error: string ~> number ///////////////////////////////////////////////////////////////// // == Import Typeof With Non-Class Value (CJS Named Export) == // ///////////////////////////////////////////////////////////////// -import typeof { num as num_cjs_named } from \"./ExportCJSNamed_Number\"; +import typeof { num as num_cjs_named } from \\"./ExportCJSNamed_Number\\"; var i1: num_cjs_named = 42; -var i2: num_cjs_named = \"asdf\"; // Error: string ~> number +var i2: num_cjs_named = \\"asdf\\"; // Error: string ~> number /////////////////////////////////////////////// // == Import Typeof ModuleNamespaceObject == // /////////////////////////////////////////////// -import typeof * as ModuleNSObjT from \"./ExportNamed_Multi\"; -var j1: ModuleNSObjT = { num: 42, str: \"asdf\" }; +import typeof * as ModuleNSObjT from \\"./ExportNamed_Multi\\"; +var j1: ModuleNSObjT = { num: 42, str: \\"asdf\\" }; var j2: ModuleNSObjT = { num: 42, str: 42 }; // Error: number ~> string " `; diff --git a/tests/flow/include/foo/batman/__snapshots__/jsfmt.spec.js.snap b/tests/flow/include/foo/batman/__snapshots__/jsfmt.spec.js.snap index 6565bed1b..fe5ba8d4d 100644 --- a/tests/flow/include/foo/batman/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/include/foo/batman/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test baz.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`baz.js 1`] = ` "/* @flow */ -var x: number = \"not a number\" // Error string ~> number +var x: number = \\"not a number\\" // Error string ~> number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var x: number = \"not a number\"; // Error string ~> number +var x: number = \\"not a number\\"; // Error string ~> number " `; diff --git a/tests/flow/include/included/__snapshots__/jsfmt.spec.js.snap b/tests/flow/include/included/__snapshots__/jsfmt.spec.js.snap index aa25c1d33..9fb80d25a 100644 --- a/tests/flow/include/included/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/include/included/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "(123: string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (123: string); diff --git a/tests/flow/incremental/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental/__snapshots__/jsfmt.spec.js.snap index 8ee563e01..50ce651ab 100644 --- a/tests/flow/incremental/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental/__snapshots__/jsfmt.spec.js.snap @@ -1,26 +1,28 @@ -exports[`test a.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a.js 1`] = ` "/* @providesModule IncrModuleA */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule IncrModuleA */ " `; -exports[`test b.js 1`] = ` +exports[`b.js 1`] = ` "/* @providesModule IncrModuleB @flow */ -var A = require(\'IncrModuleA\'); +var A = require('IncrModuleA'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule IncrModuleB @flow */ -var A = require(\"IncrModuleA\"); +var A = require(\\"IncrModuleA\\"); " `; -exports[`test dup_a.js 1`] = ` +exports[`dup_a.js 1`] = ` "/* @providesModule IncrModuleA */ var x:string = 0; diff --git a/tests/flow/incremental_basic/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_basic/__snapshots__/jsfmt.spec.js.snap index a0eb1b11d..c1edbeb03 100644 --- a/tests/flow/incremental_basic/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_basic/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test a.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a.js 1`] = ` "// @flow var a: string = 0; module.exports = a; @@ -9,27 +11,27 @@ module.exports = a; " `; -exports[`test b.js 1`] = ` +exports[`b.js 1`] = ` "// @flow -var a = require(\'./a\'); +var a = require('./a'); var b: number = a; module.exports = b; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var a = require(\"./a\"); +var a = require(\\"./a\\"); var b: number = a; module.exports = b; " `; -exports[`test c.js 1`] = ` +exports[`c.js 1`] = ` "// @flow -var b = require(\'./b\'); +var b = require('./b'); var c: string = b; module.exports = c; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var b = require(\"./b\"); +var b = require(\\"./b\\"); var c: string = b; module.exports = c; " diff --git a/tests/flow/incremental_basic/tmp1/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_basic/tmp1/__snapshots__/jsfmt.spec.js.snap index 11d82fe87..d3082e1cd 100644 --- a/tests/flow/incremental_basic/tmp1/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_basic/tmp1/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test b.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`b.js 1`] = ` "// @flow -var a = require(\'./a\'); +var a = require('./a'); var b = a; module.exports = b; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var a = require(\"./a\"); +var a = require(\\"./a\\"); var b = a; module.exports = b; " diff --git a/tests/flow/incremental_basic/tmp2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_basic/tmp2/__snapshots__/jsfmt.spec.js.snap index 5e7162532..52eea8e27 100644 --- a/tests/flow/incremental_basic/tmp2/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_basic/tmp2/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test a.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a.js 1`] = ` "// @flow var a = 0; module.exports = a; diff --git a/tests/flow/incremental_basic/tmp3/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_basic/tmp3/__snapshots__/jsfmt.spec.js.snap index b56a5d3b2..31fd55365 100644 --- a/tests/flow/incremental_basic/tmp3/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_basic/tmp3/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test b.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`b.js 1`] = ` "// @flow -var a = require(\'./a\'); +var a = require('./a'); var b: number = a; module.exports = b; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var a = require(\"./a\"); +var a = require(\\"./a\\"); var b: number = a; module.exports = b; " diff --git a/tests/flow/incremental_cycle/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_cycle/__snapshots__/jsfmt.spec.js.snap index 593b1bd60..bb21e6316 100644 --- a/tests/flow/incremental_cycle/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_cycle/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "// @flow class A { @@ -19,10 +21,10 @@ module.exports = A; " `; -exports[`test B.js 1`] = ` +exports[`B.js 1`] = ` "// @flow -var A = require (\'./A\'); -import type C from \'./C\'; +var A = require ('./A'); +import type C from './C'; class B extends A { c: C; @@ -31,8 +33,8 @@ class B extends A { module.exports = B; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var A = require(\"./A\"); -import type C from \"./C\"; +var A = require(\\"./A\\"); +import type C from \\"./C\\"; class B extends A { c: C; @@ -42,10 +44,10 @@ module.exports = B; " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` "// @flow -var A = require (\'./A\'); -import type B from \'./B\'; +var A = require ('./A'); +import type B from './B'; class C extends A { b: B; @@ -54,8 +56,8 @@ class C extends A { module.exports = C; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var A = require(\"./A\"); -import type B from \"./B\"; +var A = require(\\"./A\\"); +import type B from \\"./B\\"; class C extends A { b: B; diff --git a/tests/flow/incremental_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap index 2c6c4ac20..ece381c84 100644 --- a/tests/flow/incremental_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap @@ -1,22 +1,24 @@ -exports[`test B.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`B.js 1`] = ` "// @flow -var A = require (\'./A\'); -import type C from \'./C\'; +var A = require ('./A'); +import type C from './C'; export type B = string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var A = require(\"./A\"); -import type C from \"./C\"; +var A = require(\\"./A\\"); +import type C from \\"./C\\"; export type B = string; " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` "// @flow -var A = require (\'./A\'); -import type { B } from \'./B\' +var A = require ('./A'); +import type { B } from './B' class C extends A { b: B; @@ -25,8 +27,8 @@ class C extends A { module.exports = C; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var A = require(\"./A\"); -import type { B } from \"./B\"; +var A = require(\\"./A\\"); +import type { B } from \\"./B\\"; class C extends A { b: B; diff --git a/tests/flow/incremental_cycle/tmp2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_cycle/tmp2/__snapshots__/jsfmt.spec.js.snap index 7310a9d65..b1877e534 100644 --- a/tests/flow/incremental_cycle/tmp2/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_cycle/tmp2/__snapshots__/jsfmt.spec.js.snap @@ -1,13 +1,15 @@ -exports[`test B.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`B.js 1`] = ` "// @flow -var A = require (\'./A\'); -//import type C from \'./C\'; +var A = require ('./A'); +//import type C from './C'; export type B = string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var A = require(\"./A\"); -//import type C from \'./C\'; +var A = require(\\"./A\\"); +//import type C from './C'; export type B = string; " diff --git a/tests/flow/incremental_cycle/tmp3/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_cycle/tmp3/__snapshots__/jsfmt.spec.js.snap index e38873999..c680a7bef 100644 --- a/tests/flow/incremental_cycle/tmp3/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_cycle/tmp3/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test B.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`B.js 1`] = ` "// @flow -var A = require (\'./A\'); -import type C from \'./C\'; +var A = require ('./A'); +import type C from './C'; export type B = string; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var A = require(\"./A\"); -import type C from \"./C\"; +var A = require(\\"./A\\"); +import type C from \\"./C\\"; export type B = string; " diff --git a/tests/flow/incremental_delete/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_delete/__snapshots__/jsfmt.spec.js.snap index 850937310..b3735dc58 100644 --- a/tests/flow/incremental_delete/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_delete/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test a.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a.js 1`] = ` "// @flow var a: string = 0; module.exports = a; @@ -9,107 +11,107 @@ module.exports = a; " `; -exports[`test b.js 1`] = ` +exports[`b.js 1`] = ` "// @flow -var a = require(\'./a\'); +var a = require('./a'); var b: number = a; module.exports = b; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var a = require(\"./a\"); +var a = require(\\"./a\\"); var b: number = a; module.exports = b; " `; -exports[`test c.js 1`] = ` +exports[`c.js 1`] = ` "// @flow -var b = require(\'./b\'); +var b = require('./b'); var c: string = b; module.exports = c; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var b = require(\"./b\"); +var b = require(\\"./b\\"); var c: string = b; module.exports = c; " `; -exports[`test dupe1.js 1`] = ` +exports[`dupe1.js 1`] = ` "/** * Dupe provider 1/2 * @providesModule Dupe * @flow */ -module.exports = \"dupe1\"; +module.exports = \\"dupe1\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Dupe provider 1/2 * @providesModule Dupe * @flow */ -module.exports = \"dupe1\"; +module.exports = \\"dupe1\\"; " `; -exports[`test dupe2.js 1`] = ` +exports[`dupe2.js 1`] = ` "/** * Dupe provider 2/2 * @providesModule Dupe * @flow */ -module.exports = \"dupe2\"; +module.exports = \\"dupe2\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Dupe provider 2/2 * @providesModule Dupe * @flow */ -module.exports = \"dupe2\"; +module.exports = \\"dupe2\\"; " `; -exports[`test requires_dupe.js 1`] = ` +exports[`requires_dupe.js 1`] = ` "/** * depends on doubly-provided module * @flow */ -var dupe = require(\'Dupe\'); +var dupe = require('Dupe'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * depends on doubly-provided module * @flow */ -var dupe = require(\"Dupe\"); +var dupe = require(\\"Dupe\\"); " `; -exports[`test requires_unchecked.js 1`] = ` +exports[`requires_unchecked.js 1`] = ` "/** * depends on an unchecked module, which will be deleted * @flow */ -var unchecked = require(\'Unchecked\'); +var unchecked = require('Unchecked'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * depends on an unchecked module, which will be deleted * @flow */ -var unchecked = require(\"Unchecked\"); +var unchecked = require(\\"Unchecked\\"); " `; -exports[`test unchecked.js 1`] = ` +exports[`unchecked.js 1`] = ` "/** * Not a flow module. * @providesModule Unchecked */ -module.exports = \"unchecked\"; +module.exports = \\"unchecked\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Not a flow module. * @providesModule Unchecked */ -module.exports = \"unchecked\"; +module.exports = \\"unchecked\\"; " `; diff --git a/tests/flow/incremental_duplicate_delete/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_duplicate_delete/__snapshots__/jsfmt.spec.js.snap index 6ff6488f1..e5d93d64c 100644 --- a/tests/flow/incremental_duplicate_delete/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_duplicate_delete/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/** * @providesModule A * @flow diff --git a/tests/flow/incremental_json/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_json/__snapshots__/jsfmt.spec.js.snap index 74c31c795..c7c3ed93f 100644 --- a/tests/flow/incremental_json/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_json/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "/** * @flow */ -var data = require(\'./data\'); +var data = require('./data'); var x: number = data.x; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow */ -var data = require(\"./data\"); +var data = require(\\"./data\\"); var x: number = data.x; " `; diff --git a/tests/flow/incremental_mixed_naming_cycle/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_mixed_naming_cycle/__snapshots__/jsfmt.spec.js.snap index 481d45bfb..cdd9179c0 100644 --- a/tests/flow/incremental_mixed_naming_cycle/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_mixed_naming_cycle/__snapshots__/jsfmt.spec.js.snap @@ -1,106 +1,108 @@ -exports[`test a.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a.js 1`] = ` "/** * @providesModule A * @flow */ -(require(\'./b\'): void); -(require(\'C\'): void); +(require('./b'): void); +(require('C'): void); -module.exports = \'A\'; +module.exports = 'A'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule A * @flow */ -(require(\"./b\"): void); -(require(\"C\"): void); +(require(\\"./b\\"): void); +(require(\\"C\\"): void); -module.exports = \"A\"; +module.exports = \\"A\\"; " `; -exports[`test b.js 1`] = ` +exports[`b.js 1`] = ` "/** * @providesModule B * @flow */ -(require(\'A\'): void); -(require(\'D\'): void); +(require('A'): void); +(require('D'): void); -module.exports = \'B\'; +module.exports = 'B'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule B * @flow */ -(require(\"A\"): void); -(require(\"D\"): void); +(require(\\"A\\"): void); +(require(\\"D\\"): void); -module.exports = \"B\"; +module.exports = \\"B\\"; " `; -exports[`test c.js 1`] = ` +exports[`c.js 1`] = ` "/** * @providesModule C * @flow */ -require(\'Root\'); -(require(\'./b\'): void); +require('Root'); +(require('./b'): void); -module.exports = \'C\'; +module.exports = 'C'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule C * @flow */ -require(\"Root\"); -(require(\"./b\"): void); +require(\\"Root\\"); +(require(\\"./b\\"): void); -module.exports = \"C\"; +module.exports = \\"C\\"; " `; -exports[`test d.js 1`] = ` +exports[`d.js 1`] = ` "/** * @providesModule D * @flow */ -(require(\'./b\'): void); +(require('./b'): void); -module.exports = \'D\'; +module.exports = 'D'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule D * @flow */ -(require(\"./b\"): void); +(require(\\"./b\\"): void); -module.exports = \"D\"; +module.exports = \\"D\\"; " `; -exports[`test root.js 1`] = ` +exports[`root.js 1`] = ` "/** * @providesModule Root * @flow */ -module.exports = \'Root\'; +module.exports = 'Root'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule Root * @flow */ -module.exports = \"Root\"; +module.exports = \\"Root\\"; " `; diff --git a/tests/flow/incremental_mixed_naming_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_mixed_naming_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap index f68ea2ac2..ee3cd71ba 100644 --- a/tests/flow/incremental_mixed_naming_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_mixed_naming_cycle/tmp1/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test root.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`root.js 1`] = ` "/** * @providesModule Root * @flow */ // trivial edit (adding this comment) -module.exports = \'Root\'; +module.exports = 'Root'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule Root @@ -13,6 +15,6 @@ module.exports = \'Root\'; */ // trivial edit (adding this comment) -module.exports = \"Root\"; +module.exports = \\"Root\\"; " `; diff --git a/tests/flow/incremental_non_flow_move/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_non_flow_move/__snapshots__/jsfmt.spec.js.snap index d312b9c9f..8509cf839 100644 --- a/tests/flow/incremental_non_flow_move/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_non_flow_move/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test foo.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` "/* * @providesModule Foo */ @@ -9,17 +11,17 @@ exports[`test foo.js 1`] = ` " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "/** * @flow */ -require(\'Foo\'); +require('Foo'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow */ -require(\"Foo\"); +require(\\"Foo\\"); " `; diff --git a/tests/flow/incremental_path/dir/__snapshots__/jsfmt.spec.js.snap b/tests/flow/incremental_path/dir/__snapshots__/jsfmt.spec.js.snap index 630bf0729..7ffab3767 100644 --- a/tests/flow/incremental_path/dir/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/incremental_path/dir/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test a.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a.js 1`] = ` "// @flow -(require(\'b\'): boolean); +(require('b'): boolean); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -(require(\"b\"): boolean); +(require(\\"b\\"): boolean); " `; diff --git a/tests/flow/indexer/__snapshots__/jsfmt.spec.js.snap b/tests/flow/indexer/__snapshots__/jsfmt.spec.js.snap index e1b606541..9d4b4be8c 100644 --- a/tests/flow/indexer/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/indexer/__snapshots__/jsfmt.spec.js.snap @@ -1,87 +1,89 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "// No indexer should be fine function foo0(): {} { - return { foo: \"bar\" } + return { foo: \\"bar\\" } } // Matching indexer should be fine function foo1(): {[key: string]: string} { - return { foo: \"bar\" } + return { foo: \\"bar\\" } } // Indexer with different key type is an error when it matches function foo2(): {[key: number]: string} { - return { foo: \"bar\" } + return { foo: \\"bar\\" } } // Matching indexer with different value type is an error function foo3(): {[key: string]: number} { - return { foo: \"bar\" } + return { foo: \\"bar\\" } } // Indexer with different key type and different value type is twice an error function foo4(): {[key: number]: number} { - return { foo: \"bar\" } + return { foo: \\"bar\\" } } // If key exists in object type then indexer is not matched function foo5(): {[key: string]: number; foo: string} { - return { foo: \"bar\" } + return { foo: \\"bar\\" } } // If key exists in object type then indexer is not matched function foo6(): {[key: number]: number; foo: string} { - return { foo: \"bar\" } + return { foo: \\"bar\\" } } // Should still complain about mistyped properties function foo7(): {[key: string]: number; foo: number} { - return { foo: \"bar\" } + return { foo: \\"bar\\" } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // No indexer should be fine function foo0(): {} { - return { foo: \"bar\" }; + return { foo: \\"bar\\" }; } // Matching indexer should be fine function foo1(): { [key: string]: string } { - return { foo: \"bar\" }; + return { foo: \\"bar\\" }; } // Indexer with different key type is an error when it matches function foo2(): { [key: number]: string } { - return { foo: \"bar\" }; + return { foo: \\"bar\\" }; } // Matching indexer with different value type is an error function foo3(): { [key: string]: number } { - return { foo: \"bar\" }; + return { foo: \\"bar\\" }; } // Indexer with different key type and different value type is twice an error function foo4(): { [key: number]: number } { - return { foo: \"bar\" }; + return { foo: \\"bar\\" }; } // If key exists in object type then indexer is not matched function foo5(): { [key: string]: number, foo: string } { - return { foo: \"bar\" }; + return { foo: \\"bar\\" }; } // If key exists in object type then indexer is not matched function foo6(): { [key: number]: number, foo: string } { - return { foo: \"bar\" }; + return { foo: \\"bar\\" }; } // Should still complain about mistyped properties function foo7(): { [key: string]: number, foo: number } { - return { foo: \"bar\" }; + return { foo: \\"bar\\" }; } " `; -exports[`test multiple.js 1`] = ` +exports[`multiple.js 1`] = ` "// @flow let tests = [ diff --git a/tests/flow/init/__snapshots__/jsfmt.spec.js.snap b/tests/flow/init/__snapshots__/jsfmt.spec.js.snap index 2ed1939bc..a0252be55 100644 --- a/tests/flow/init/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/init/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test hoisted.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`hoisted.js 1`] = ` "/** * test initialization tracking in the presence of hoisting * @flow @@ -95,7 +97,7 @@ function _for_of(arr: Array) { " `; -exports[`test hoisted2.js 1`] = ` +exports[`hoisted2.js 1`] = ` "/** * test initialization tracking for vars * note: for try/catch/finally, see tests/try/init.js @@ -636,7 +638,7 @@ function for_in_post_init() { " `; -exports[`test let.js 1`] = ` +exports[`let.js 1`] = ` "/** * test initialization tracking for lets * @flow @@ -660,7 +662,7 @@ function linear_pre_init() { // self-references in let bindings are not ok function self_init() { - let x = x; // \'x\' not initialized! + let x = x; // 'x' not initialized! } // use of let after partial init (non-exhaustive if) gives undefined @@ -767,7 +769,7 @@ function switch_post_init2(i): number { bar = 3; break; default: - throw new Error(\'Invalid state\'); + throw new Error('Invalid state'); } return bar; // ok, definitely initialized } @@ -780,7 +782,7 @@ function switch_post_init2(i): number { bar = 3; break; default: - throw new Error(\'Invalid state\'); + throw new Error('Invalid state'); } return bar; // ok, definitely initialized } @@ -818,7 +820,7 @@ function linear_pre_init() { // self-references in let bindings are not ok function self_init() { - let x = x; // \'x\' not initialized! + let x = x; // 'x' not initialized! } // use of let after partial init (non-exhaustive if) gives undefined @@ -925,7 +927,7 @@ function switch_post_init2(i): number { bar = 3; break; default: - throw new Error(\"Invalid state\"); + throw new Error(\\"Invalid state\\"); } return bar; // ok, definitely initialized } @@ -938,7 +940,7 @@ function switch_post_init2(i): number { bar = 3; break; default: - throw new Error(\"Invalid state\"); + throw new Error(\\"Invalid state\\"); } return bar; // ok, definitely initialized } @@ -959,7 +961,7 @@ function sub_closure_init_reference() { " `; -exports[`test nullable-init.js 1`] = ` +exports[`nullable-init.js 1`] = ` "var o: {x: ?number} = { x: null }; var a: Array = [null,null]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/flow/instanceof/__snapshots__/jsfmt.spec.js.snap b/tests/flow/instanceof/__snapshots__/jsfmt.spec.js.snap index 597e767b2..766182e0b 100644 --- a/tests/flow/instanceof/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/instanceof/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test instanceof.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`instanceof.js 1`] = ` "/* @flow */ // x instancof t @@ -9,13 +11,13 @@ function x(b) { return b ? new X1 : new X2; } function consumer1(b) { var g = x(b); - if (g instanceof X2) g.foo = \'1337\'; + if (g instanceof X2) g.foo = '1337'; else g.foo = 1337; } function consumer2(b) { var g = x(b); - if (g instanceof X1) g.foo = \'1337\'; // oops + if (g instanceof X1) g.foo = '1337'; // oops } // x.y instanceof t @@ -26,13 +28,13 @@ function y(b) { return b ? new Y1 : new Y2; } function consumer3(b) { var g = y(b); - if (g.bar instanceof X2) g.bar.foo = \'1337\'; + if (g.bar instanceof X2) g.bar.foo = '1337'; else g.bar.foo = 1337; } function consumer4(b) { var g = y(b); - if (g.bar instanceof X1) g.bar.foo = \'1337\'; // oops + if (g.bar instanceof X1) g.bar.foo = '1337'; // oops } // x.y.z instance of t @@ -43,13 +45,13 @@ function z(b) { return b ? new Z1 : new Z2; } function consumer5(b) { var g = z(b); - if (g.baz.bar instanceof X2) g.baz.bar.foo = \'1337\'; + if (g.baz.bar instanceof X2) g.baz.bar.foo = '1337'; else g.baz.bar.foo = 1337; } function consumer6(b) { var g = z(b); - if (g.baz.bar instanceof X1) g.baz.bar.foo = \'1337\'; // oops + if (g.baz.bar instanceof X1) g.baz.bar.foo = '1337'; // oops } // this instanceof t @@ -58,7 +60,7 @@ class C { if (this instanceof D) alert(this.s); else - alert(\"nope\"); + alert(\\"nope\\"); } } @@ -66,7 +68,7 @@ class D extends C { s: string; constructor() { super(); - this.s = \"yup\"; + this.s = \\"yup\\"; } } @@ -103,13 +105,13 @@ function x(b) { function consumer1(b) { var g = x(b); - if (g instanceof X2) g.foo = \"1337\"; + if (g instanceof X2) g.foo = \\"1337\\"; else g.foo = 1337; } function consumer2(b) { var g = x(b); - if (g instanceof X1) g.foo = \"1337\"; // oops + if (g instanceof X1) g.foo = \\"1337\\"; // oops } // x.y instanceof t @@ -126,13 +128,13 @@ function y(b) { function consumer3(b) { var g = y(b); - if (g.bar instanceof X2) g.bar.foo = \"1337\"; + if (g.bar instanceof X2) g.bar.foo = \\"1337\\"; else g.bar.foo = 1337; } function consumer4(b) { var g = y(b); - if (g.bar instanceof X1) g.bar.foo = \"1337\"; // oops + if (g.bar instanceof X1) g.bar.foo = \\"1337\\"; // oops } // x.y.z instance of t @@ -149,20 +151,20 @@ function z(b) { function consumer5(b) { var g = z(b); - if (g.baz.bar instanceof X2) g.baz.bar.foo = \"1337\"; + if (g.baz.bar instanceof X2) g.baz.bar.foo = \\"1337\\"; else g.baz.bar.foo = 1337; } function consumer6(b) { var g = z(b); - if (g.baz.bar instanceof X1) g.baz.bar.foo = \"1337\"; // oops + if (g.baz.bar instanceof X1) g.baz.bar.foo = \\"1337\\"; // oops } // this instanceof t class C { m() { if (this instanceof D) alert(this.s); - else alert(\"nope\"); + else alert(\\"nope\\"); } } @@ -170,7 +172,7 @@ class D extends C { s: string; constructor() { super(); - this.s = \"yup\"; + this.s = \\"yup\\"; } } diff --git a/tests/flow/integration/__snapshots__/jsfmt.spec.js.snap b/tests/flow/integration/__snapshots__/jsfmt.spec.js.snap index 024c8dc10..ee83f3ef2 100644 --- a/tests/flow/integration/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/integration/__snapshots__/jsfmt.spec.js.snap @@ -1,15 +1,17 @@ -exports[`test bar.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bar.js 1`] = ` "// @flow ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow " `; -exports[`test foo.js 1`] = ` +exports[`foo.js 1`] = ` "// @flow -require(\'./bar\'); +require('./bar'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -require(\"./bar\"); +require(\\"./bar\\"); " `; diff --git a/tests/flow/interface/__snapshots__/jsfmt.spec.js.snap b/tests/flow/interface/__snapshots__/jsfmt.spec.js.snap index 33139f6c8..7efd74424 100644 --- a/tests/flow/interface/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/interface/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test import.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`import.js 1`] = ` "interface I { x: number } export type J = I; // workaround for export interface ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -7,7 +9,7 @@ export type J = I; // workaround for export interface " `; -exports[`test indexer.js 1`] = ` +exports[`indexer.js 1`] = ` "// @flow interface Ok { @@ -32,7 +34,7 @@ interface Bad { " `; -exports[`test interface.js 1`] = ` +exports[`interface.js 1`] = ` "declare class C { x: number; } var x: string = new C().x; @@ -61,13 +63,13 @@ function testInterfaceName(o: I) { " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "interface I { y: string } interface I_ { x: number } interface J extends I, I_ { } interface K extends J { } -var k: K = { x: \"\", y: \"\" }; // error: x should be number +var k: K = { x: \\"\\", y: \\"\\" }; // error: x should be number (k.x: string); // error: x is number (k.y: string); @@ -80,7 +82,7 @@ interface A_ { x: X } interface B extends A, A_ { z: Z } interface E extends B { } -var e: E = { x: \"\", y: \"\", z: \"\" }; // error: x and z should be numbers +var e: E = { x: \\"\\", y: \\"\\", z: \\"\\" }; // error: x and z should be numbers (e.x: string); // error: x is number (e.y: string); (e.z: string); // error: z is number @@ -90,7 +92,7 @@ interface I_ { x: number } interface J extends I, I_ {} interface K extends J {} -var k: K = { x: \"\", y: \"\" }; // error: x should be number +var k: K = { x: \\"\\", y: \\"\\" }; // error: x should be number (k.x: string); // error: x is number (k.y: string); @@ -103,15 +105,15 @@ interface A_ { x: X } interface B extends A, A_ { z: Z } interface E extends B {} -var e: E = { x: \"\", y: \"\", z: \"\" }; // error: x and z should be numbers +var e: E = { x: \\"\\", y: \\"\\", z: \\"\\" }; // error: x and z should be numbers (e.x: string); // error: x is number (e.y: string); (e.z: string); // error: z is number " `; -exports[`test test2.js 1`] = ` -"import type { J } from \'./import\'; +exports[`test2.js 1`] = ` +"import type { J } from './import'; interface K { } interface L extends J, K { y: string } @@ -122,7 +124,7 @@ type M = { y: string } & J & { z: boolean } function bar(m: M) { m.x; m.y; m.z; } // OK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import type { J } from \"./import\"; +import type { J } from \\"./import\\"; interface K {} interface L extends J, K { y: string } @@ -143,7 +145,7 @@ function bar(m: M) { " `; -exports[`test test3.js 1`] = ` +exports[`test3.js 1`] = ` "interface I { x: number, y : string } interface J { y : number } interface K extends I, J { x: string } // error: x is number in I @@ -162,7 +164,7 @@ function foo(k: K) { " `; -exports[`test test4.js 1`] = ` +exports[`test4.js 1`] = ` "interface I { foo(x: number): void; } (function foo(x: number) { }: I); // error, property \`foo\` not found function diff --git a/tests/flow/intersection/__snapshots__/jsfmt.spec.js.snap b/tests/flow/intersection/__snapshots__/jsfmt.spec.js.snap index 59f55cf40..f1d1c004d 100644 --- a/tests/flow/intersection/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/intersection/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test intersection.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`intersection.js 1`] = ` "function foo(x: $All): number { return x.type; } @@ -17,7 +19,7 @@ function bar(x: Error & { type: number }): number { " `; -exports[`test objassign.js 1`] = ` +exports[`objassign.js 1`] = ` "/** * Test intersection of objects flowing to spread assignment. * @@ -44,7 +46,7 @@ let y: ObjAssignT = { ...x }; // should be fine " `; -exports[`test pred.js 1`] = ` +exports[`pred.js 1`] = ` "/** * Test interaction of object intersections and predicates. * Definitions in lib/lib.js @@ -97,7 +99,7 @@ function hasObjectMode_ok(options: DuplexStreamOptions): boolean { " `; -exports[`test test_fun.js 1`] = ` +exports[`test_fun.js 1`] = ` "/** * Tests for intersections of function types. * @@ -164,7 +166,7 @@ var g: (_: number | string) => void = f; " `; -exports[`test test_obj.js 1`] = ` +exports[`test_obj.js 1`] = ` "/** * Tests for intersections of object types * diff --git a/tests/flow/intersection/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/intersection/lib/__snapshots__/jsfmt.spec.js.snap index 66e3eeebb..c00b6ad09 100644 --- a/tests/flow/intersection/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/intersection/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test lib.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`lib.js 1`] = ` "// @flow // defs used in tests, here to stress tvar machinery diff --git a/tests/flow/issues-11/__snapshots__/jsfmt.spec.js.snap b/tests/flow/issues-11/__snapshots__/jsfmt.spec.js.snap index 31d0b8f39..71da3bf27 100644 --- a/tests/flow/issues-11/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/issues-11/__snapshots__/jsfmt.spec.js.snap @@ -1,22 +1,24 @@ -exports[`test export.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`export.js 1`] = ` "/* @flow */ exports.x = 1; -exports.y = \"\"; +exports.y = \\"\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ exports.x = 1; -exports.y = \"\"; +exports.y = \\"\\"; " `; -exports[`test import.js 1`] = ` +exports[`import.js 1`] = ` "/* @flow */ -var e = require(\'./export\'); +var e = require('./export'); var x: string = e.x; var y: number = e.y; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var e = require(\"./export\"); +var e = require(\\"./export\\"); var x: string = e.x; var y: number = e.y; " diff --git a/tests/flow/iter/__snapshots__/jsfmt.spec.js.snap b/tests/flow/iter/__snapshots__/jsfmt.spec.js.snap index 4f013fca5..6e15957f3 100644 --- a/tests/flow/iter/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/iter/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test iter.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`iter.js 1`] = ` "var a = [true,false]; function foo(x) { } @@ -6,7 +8,7 @@ for (var i=0;i<3;i++) { foo(a[i]); } for (var k in a) { - foo(a[k]); // k is a string, which shouldn\'t be used for array access + foo(a[k]); // k is a string, which shouldn't be used for array access } var b = (null : ?{[key: string]: string}); @@ -21,7 +23,7 @@ for (var m in (c = b)) { var d; for (var n in (d = a)) { - foo(d[n]); // d is a string, which shouldn\'t be used for array access + foo(d[n]); // d is a string, which shouldn't be used for array access } for (var x in undefined) { @@ -33,8 +35,8 @@ for (var x in null) { } for (var y in this) { - // regression test to make sure \`in this\` doesn\'t fatal. it\'s currently - // allowed, even though we can\'t actually enumerate all the keys on \`this\`. + // regression test to make sure \`in this\` doesn't fatal. it's currently + // allowed, even though we can't actually enumerate all the keys on \`this\`. } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var a = [true, false]; @@ -44,7 +46,7 @@ for (var i = 0; i < 3; i++) { foo(a[i]); } for (var k in a) { - foo(a[k]); // k is a string, which shouldn\'t be used for array access + foo(a[k]); // k is a string, which shouldn't be used for array access } var b = (null: ?{ [key: string]: string }); @@ -59,7 +61,7 @@ for (var m in c = b) { var d; for (var n in d = a) { - foo(d[n]); // d is a string, which shouldn\'t be used for array access + foo(d[n]); // d is a string, which shouldn't be used for array access } for (var x in undefined) { @@ -71,8 +73,8 @@ for (var x in null) { } for (var y in this) { - // regression test to make sure \`in this\` doesn\'t fatal. it\'s currently - // allowed, even though we can\'t actually enumerate all the keys on \`this\`. + // regression test to make sure \`in this\` doesn't fatal. it's currently + // allowed, even though we can't actually enumerate all the keys on \`this\`. } " `; diff --git a/tests/flow/iterable/__snapshots__/jsfmt.spec.js.snap b/tests/flow/iterable/__snapshots__/jsfmt.spec.js.snap index 140aaf886..6a6b92ed2 100644 --- a/tests/flow/iterable/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/iterable/__snapshots__/jsfmt.spec.js.snap @@ -1,43 +1,45 @@ -exports[`test array.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`array.js 1`] = ` "/* @flow */ var arrayTest1: Iterable = ([1, 2]: Array); -var arrayTest2: Iterable = [1,2,\"hi\"]; +var arrayTest2: Iterable = [1,2,\\"hi\\"]; var arrayTest3: Iterable<*> = [1,2,3]; // Error string ~> number -var arrayTest4: Iterable = [\"hi\"]; +var arrayTest4: Iterable = [\\"hi\\"]; // Error string ~> number -var arrayTest5: Iterable = [\"hi\", 1]; +var arrayTest5: Iterable = [\\"hi\\", 1]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ var arrayTest1: Iterable = ([1, 2]: Array); -var arrayTest2: Iterable = [1, 2, \"hi\"]; +var arrayTest2: Iterable = [1, 2, \\"hi\\"]; var arrayTest3: Iterable<*> = [1, 2, 3]; // Error string ~> number -var arrayTest4: Iterable = [\"hi\"]; +var arrayTest4: Iterable = [\\"hi\\"]; // Error string ~> number -var arrayTest5: Iterable = [\"hi\", 1]; +var arrayTest5: Iterable = [\\"hi\\", 1]; " `; -exports[`test caching_bug.js 1`] = ` +exports[`caching_bug.js 1`] = ` "/* @flow */ /** - * I\'ve hit a bug with the caching in flow_js.ml. Avik is removing that caching + * I've hit a bug with the caching in flow_js.ml. Avik is removing that caching * so it should be fixed soon. The basic idea is I flow something like * * Array ~> Iterable * - * then Flow won\'t notice when I try to flow + * then Flow won't notice when I try to flow * * Array ~> Iterable * - * We shouldn\'t hit the cache because the union types are different, but we do - * anyway. I\'ve fixed this temporarily by bumping the \"meaningful\" param to + * We shouldn't hit the cache because the union types are different, but we do + * anyway. I've fixed this temporarily by bumping the \\"meaningful\\" param to * Hashtbl.hash_param */ @@ -49,17 +51,17 @@ function miss_the_cache(x: Array): Iterable { return x; /* @flow */ /** - * I\'ve hit a bug with the caching in flow_js.ml. Avik is removing that caching + * I've hit a bug with the caching in flow_js.ml. Avik is removing that caching * so it should be fixed soon. The basic idea is I flow something like * * Array ~> Iterable * - * then Flow won\'t notice when I try to flow + * then Flow won't notice when I try to flow * * Array ~> Iterable * - * We shouldn\'t hit the cache because the union types are different, but we do - * anyway. I\'ve fixed this temporarily by bumping the \"meaningful\" param to + * We shouldn't hit the cache because the union types are different, but we do + * anyway. I've fixed this temporarily by bumping the \\"meaningful\\" param to * Hashtbl.hash_param */ @@ -74,7 +76,7 @@ function miss_the_cache(x: Array): Iterable { " `; -exports[`test iter.js 1`] = ` +exports[`iter.js 1`] = ` "/* @flow */ function foo(strs: Iterable): void { @@ -101,16 +103,16 @@ foo(m.keys()); " `; -exports[`test iterator_result.js 1`] = ` +exports[`iterator_result.js 1`] = ` "/* @flow */ function makeIterator(coin_flip: () => boolean ): Iterator { return { - \"@@iterator\"() { return makeIterator(coin_flip); }, + \\"@@iterator\\"() { return makeIterator(coin_flip); }, next(): IteratorResult { var done = coin_flip(); if (!done) { - return { done, value: \"still going...\" }; + return { done, value: \\"still going...\\" }; } else { return { done }; } @@ -120,11 +122,11 @@ function makeIterator(coin_flip: () => boolean ): Iterator { function makeIterator(coin_flip: () => boolean ): Iterator { return { - \"@@iterator\"() { return makeIterator(coin_flip); }, + \\"@@iterator\\"() { return makeIterator(coin_flip); }, next(): IteratorResult { var done = coin_flip(); if (done) { // Whoops, made a mistake and forgot to negate done - return { done, value: \"still going...\" }; // Error string ~> void + return { done, value: \\"still going...\\" }; // Error string ~> void } else { return { done }; // Error void ~> string } @@ -136,13 +138,13 @@ function makeIterator(coin_flip: () => boolean ): Iterator { function makeIterator(coin_flip: () => boolean): Iterator { return { - \"@@iterator\"() { + \\"@@iterator\\"() { return makeIterator(coin_flip); }, next(): IteratorResult { var done = coin_flip(); if (!done) { - return { done, value: \"still going...\" }; + return { done, value: \\"still going...\\" }; } else { return { done }; } @@ -152,14 +154,14 @@ function makeIterator(coin_flip: () => boolean): Iterator { function makeIterator(coin_flip: () => boolean): Iterator { return { - \"@@iterator\"() { + \\"@@iterator\\"() { return makeIterator(coin_flip); }, next(): IteratorResult { var done = coin_flip(); if (done) { // Whoops, made a mistake and forgot to negate done - return { done, value: \"still going...\" }; // Error string ~> void + return { done, value: \\"still going...\\" }; // Error string ~> void } else { return { done }; // Error void ~> string } @@ -169,7 +171,7 @@ function makeIterator(coin_flip: () => boolean): Iterator { " `; -exports[`test map.js 1`] = ` +exports[`map.js 1`] = ` "/* @flow */ function mapTest1(map: Map): Iterable<[string, number]> { @@ -204,7 +206,7 @@ function mapTest4(map: Map): Iterable { " `; -exports[`test set.js 1`] = ` +exports[`set.js 1`] = ` "/* @flow */ function setTest1(set: Set): Iterable { @@ -239,22 +241,22 @@ function setTest4(set: Set): Iterable { " `; -exports[`test string.js 1`] = ` +exports[`string.js 1`] = ` "/* @flow */ -var stringTest1: Iterable = \"hi\"; -var stringTest3: Iterable<*> = \"hi\"; -var stringTest3: Iterable = \"hi\"; // Error - string is a Iterable +var stringTest1: Iterable = \\"hi\\"; +var stringTest3: Iterable<*> = \\"hi\\"; +var stringTest3: Iterable = \\"hi\\"; // Error - string is a Iterable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var stringTest1: Iterable = \"hi\"; -var stringTest3: Iterable<*> = \"hi\"; -var stringTest3: Iterable = \"hi\"; // Error - string is a Iterable +var stringTest1: Iterable = \\"hi\\"; +var stringTest3: Iterable<*> = \\"hi\\"; +var stringTest3: Iterable = \\"hi\\"; // Error - string is a Iterable " `; -exports[`test variance.js 1`] = ` +exports[`variance.js 1`] = ` "/* @flow */ (([]: Array): Iterable); // ok, Iterable<+T> diff --git a/tests/flow/jsx_intrinsics.builtin/__snapshots__/jsfmt.spec.js.snap b/tests/flow/jsx_intrinsics.builtin/__snapshots__/jsfmt.spec.js.snap index e047e3ecd..f0e810154 100644 --- a/tests/flow/jsx_intrinsics.builtin/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/jsx_intrinsics.builtin/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,9 @@ -exports[`test main.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`main.js 1`] = ` "// @flow -var React = require(\'react\'); +var React = require('react'); class CustomComponent extends React.Component { props: { @@ -9,21 +11,21 @@ class CustomComponent extends React.Component { }; } -var a: React.Element<{prop: string}> = ; -var b: React.Element<{prop1: string}> = ; // Error: Props<{prop}> ~> Props<{prop1}> +var a: React.Element<{prop: string}> = ; +var b: React.Element<{prop1: string}> = ; // Error: Props<{prop}> ~> Props<{prop1}> // Since intrinsics are typed as \`any\` out of the box, we can pass any // attributes to intrinsics! -var c: React.Element =
; -// However, we don\'t allow such elements to be viewed as React elements with +var c: React.Element =
; +// However, we don't allow such elements to be viewed as React elements with // different attributes. -var d: React.Element<{doesntmatch: string}> =
; +var d: React.Element<{doesntmatch: string}> =
; // No error as long as expectations are consistent, though. -var e: React.Element<{not_a_real_attr: string}> =
; +var e: React.Element<{not_a_real_attr: string}> =
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var React = require(\"react\"); +var React = require(\\"react\\"); class CustomComponent extends React.Component { props: { @@ -31,58 +33,58 @@ class CustomComponent extends React.Component { }; } -var a: React.Element<{ prop: string }> = ; -var b: React.Element<{ prop1: string }> = ; // Error: Props<{prop}> ~> Props<{prop1}> +var a: React.Element<{ prop: string }> = ; +var b: React.Element<{ prop1: string }> = ; // Error: Props<{prop}> ~> Props<{prop1}> // Since intrinsics are typed as \`any\` out of the box, we can pass any // attributes to intrinsics! -var c: React.Element =
; -// However, we don\'t allow such elements to be viewed as React elements with +var c: React.Element =
; +// However, we don't allow such elements to be viewed as React elements with // different attributes. -var d: React.Element<{ doesntmatch: string }> =
; +var d: React.Element<{ doesntmatch: string }> =
; // No error as long as expectations are consistent, though. var e: React.Element<{ not_a_real_attr: string }> = ( -
+
); " `; -exports[`test strings.js 1`] = ` +exports[`strings.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); // The builtin $JSXIntrinsics should allow any string -var Div = \'div\'; -var Bad = \'bad\'; -var Str: string = \'str\'; +var Div = 'div'; +var Bad = 'bad'; +var Str: string = 'str';
; // This is fine ; // This is fine ; // This is fine -React.createElement(\'div\', {}); // This is fine -React.createElement(\'bad\', {}); // This is fine +React.createElement('div', {}); // This is fine +React.createElement('bad', {}); // This is fine
; // This is fine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); // The builtin $JSXIntrinsics should allow any string -var Div = \"div\"; -var Bad = \"bad\"; -var Str: string = \"str\"; +var Div = \\"div\\"; +var Bad = \\"bad\\"; +var Str: string = \\"str\\";
; /* This is fine*/ ; /* This is fine*/ ; // This is fine -React.createElement(\"div\", {}); // This is fine -React.createElement(\"bad\", {}); /* This is fine*/ +React.createElement(\\"div\\", {}); // This is fine +React.createElement(\\"bad\\", {}); /* This is fine*/
; // This is fine " diff --git a/tests/flow/jsx_intrinsics.custom/__snapshots__/jsfmt.spec.js.snap b/tests/flow/jsx_intrinsics.custom/__snapshots__/jsfmt.spec.js.snap index 569e8a2ca..5a6923abd 100644 --- a/tests/flow/jsx_intrinsics.custom/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/jsx_intrinsics.custom/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,9 @@ -exports[`test main.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`main.js 1`] = ` "// @flow -var React = require(\'react\'); +var React = require('react'); class CustomComponent extends React.Component { props: { @@ -9,17 +11,17 @@ class CustomComponent extends React.Component { }; } -var a: React.Element<{prop: string}> = ; -var b: React.Element<{prop1: string}> = ; // Error: Props<{prop}> ~> Props<{prop1}> +var a: React.Element<{prop: string}> = ; +var b: React.Element<{prop1: string}> = ; // Error: Props<{prop}> ~> Props<{prop1}> -
; +
;
; // Error: (\`id\` prop) number ~> string -var c: React.Element<{id: string}> =
; -var d: React.Element<{id: number}> =
; // Error: Props<{id:string}> ~> Props<{id:number}> +var c: React.Element<{id: string}> =
; +var d: React.Element<{id: number}> =
; // Error: Props<{id:string}> ~> Props<{id:number}> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var React = require(\"react\"); +var React = require(\\"react\\"); class CustomComponent extends React.Component { props: { @@ -27,33 +29,33 @@ class CustomComponent extends React.Component { }; } -var a: React.Element<{ prop: string }> = ; +var a: React.Element<{ prop: string }> = ; var b: React.Element<{ prop1: string }> = ( - + ); /* Error: Props<{prop}> ~> Props<{prop1}>*/ -
; +
;
; // Error: (\`id\` prop) number ~> string -var c: React.Element<{ id: string }> =
; -var d: React.Element<{ id: number }> =
; // Error: Props<{id:string}> ~> Props<{id:number}> +var c: React.Element<{ id: string }> =
; +var d: React.Element<{ id: number }> =
; // Error: Props<{id:string}> ~> Props<{id:number}> " `; -exports[`test strings.js 1`] = ` +exports[`strings.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); -var Div = \'div\'; -var Bad = \'bad\'; -var Str: string = \'str\'; +var Div = 'div'; +var Bad = 'bad'; +var Str: string = 'str';
; // This is fine -; // Error: \'bad\' not in JSXIntrinsics +; // Error: 'bad' not in JSXIntrinsics ; // Error: string ~> keys of JSXIntrinsics -React.createElement(\'div\', {}); // This is fine -React.createElement(\'bad\', {}); // Error: \'bad\' not in JSXIntrinsics +React.createElement('div', {}); // This is fine +React.createElement('bad', {}); // Error: 'bad' not in JSXIntrinsics React.createElement(Str, {}); // Error: string ~> keys of JSXIntrinsics // TODO: Make this an error @@ -61,18 +63,18 @@ React.createElement(Str, {}); // Error: string ~> keys of JSXIntrinsics ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); -var Div = \"div\"; -var Bad = \"bad\"; -var Str: string = \"str\"; +var Div = \\"div\\"; +var Bad = \\"bad\\"; +var Str: string = \\"str\\";
; /* This is fine*/ -; /* Error: \'bad\' not in JSXIntrinsics*/ +; /* Error: 'bad' not in JSXIntrinsics*/ ; // Error: string ~> keys of JSXIntrinsics -React.createElement(\"div\", {}); // This is fine -React.createElement(\"bad\", {}); // Error: \'bad\' not in JSXIntrinsics +React.createElement(\\"div\\", {}); // This is fine +React.createElement(\\"bad\\", {}); // Error: 'bad' not in JSXIntrinsics React.createElement(Str, {}); /* Error: string ~> keys of JSXIntrinsics*/ /* TODO: Make this an error*/ diff --git a/tests/flow/jsx_intrinsics.custom/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/jsx_intrinsics.custom/lib/__snapshots__/jsfmt.spec.js.snap index db39ea781..85d8aec26 100644 --- a/tests/flow/jsx_intrinsics.custom/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/jsx_intrinsics.custom/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,7 @@ -exports[`test jsx.js 1`] = ` -"declare var $React: $Exports<\'react\'>; // fake import +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx.js 1`] = ` +"declare var $React: $Exports<'react'>; // fake import type $JSXIntrinsic = Class<$React.Component>; type $JSXIntrinsics = { @@ -7,7 +9,7 @@ type $JSXIntrinsics = { span: $JSXIntrinsic<{id: string, class: string}>, }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -declare var $React: $Exports<\"react\">; // fake import +declare var $React: $Exports<\\"react\\">; // fake import type $JSXIntrinsic = Class<$React.Component>; type $JSXIntrinsics = { diff --git a/tests/flow/keys/__snapshots__/jsfmt.spec.js.snap b/tests/flow/keys/__snapshots__/jsfmt.spec.js.snap index 3576b8288..aab3f39f3 100644 --- a/tests/flow/keys/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/keys/__snapshots__/jsfmt.spec.js.snap @@ -1,92 +1,94 @@ -exports[`test keys.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`keys.js 1`] = ` "/* @flow */ -function testKeysOfObject(str: string, lit: \'hi\') { +function testKeysOfObject(str: string, lit: 'hi') { (str: $Keys); // Any string should be fine if (str) { (str: $Keys); // No error, truthy string should be fine } - (\'hi\': $Keys); // String literal should be fine + ('hi': $Keys); // String literal should be fine (123: $Keys); // Error: number -> keys of Object } type StrDict = {[key: string]: mixed}; -function testKeysOfStrDict(str: string, lit: \'hi\') { +function testKeysOfStrDict(str: string, lit: 'hi') { (str: $Keys); // Any string should be fine if (str) { (str: $Keys); // No error, truthy string should be fine } - (\'hi\': $Keys); // String literal should be fine + ('hi': $Keys); // String literal should be fine (123: $Keys); // Error: number -> keys of StrDict } -type StrLitDict = {[key: \'hi\']: mixed}; -function testKeysOfStrLitDict(str: string, lit: \'hi\') { +type StrLitDict = {[key: 'hi']: mixed}; +function testKeysOfStrLitDict(str: string, lit: 'hi') { (str: $Keys); // Error: Not all strings are allowed if (str) { (str: $Keys); // Error: Not all truthy strings are allowed } - (\'hi\': $Keys); // The right string literal is allowed - (\'bye\': $Keys); // Error: The wrong string literal is not allowed + ('hi': $Keys); // The right string literal is allowed + ('bye': $Keys); // Error: The wrong string literal is not allowed (123: $Keys); // Error: number -> keys of StrLitDict } type ObjLit = {hi: mixed}; -function testKeysOfOtherObj(str: string, lit: \'hi\') { +function testKeysOfOtherObj(str: string, lit: 'hi') { (str: $Keys); // Error: string -> keys of ObjLit if (str) { (str: $Keys); // Error: truthy string -> keys of ObjLit } - (\'hi\': $Keys); // String literal should be fine + ('hi': $Keys); // String literal should be fine (123: $Keys); // Error: number -> keys of ObjLit } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -function testKeysOfObject(str: string, lit: \"hi\") { +function testKeysOfObject(str: string, lit: \\"hi\\") { (str: $Keys); // Any string should be fine if (str) { (str: $Keys); // No error, truthy string should be fine } - (\"hi\": $Keys); // String literal should be fine + (\\"hi\\": $Keys); // String literal should be fine (123: $Keys); // Error: number -> keys of Object } type StrDict = { [key: string]: mixed }; -function testKeysOfStrDict(str: string, lit: \"hi\") { +function testKeysOfStrDict(str: string, lit: \\"hi\\") { (str: $Keys); // Any string should be fine if (str) { (str: $Keys); // No error, truthy string should be fine } - (\"hi\": $Keys); // String literal should be fine + (\\"hi\\": $Keys); // String literal should be fine (123: $Keys); // Error: number -> keys of StrDict } -type StrLitDict = { [key: \"hi\"]: mixed }; -function testKeysOfStrLitDict(str: string, lit: \"hi\") { +type StrLitDict = { [key: \\"hi\\"]: mixed }; +function testKeysOfStrLitDict(str: string, lit: \\"hi\\") { (str: $Keys); // Error: Not all strings are allowed if (str) { (str: $Keys); // Error: Not all truthy strings are allowed } - (\"hi\": $Keys); // The right string literal is allowed - (\"bye\": $Keys); // Error: The wrong string literal is not allowed + (\\"hi\\": $Keys); // The right string literal is allowed + (\\"bye\\": $Keys); // Error: The wrong string literal is not allowed (123: $Keys); // Error: number -> keys of StrLitDict } type ObjLit = { hi: mixed }; -function testKeysOfOtherObj(str: string, lit: \"hi\") { +function testKeysOfOtherObj(str: string, lit: \\"hi\\") { (str: $Keys); // Error: string -> keys of ObjLit if (str) { (str: $Keys); // Error: truthy string -> keys of ObjLit } - (\"hi\": $Keys); // String literal should be fine + (\\"hi\\": $Keys); // String literal should be fine (123: $Keys); // Error: number -> keys of ObjLit } diff --git a/tests/flow/keyvalue/__snapshots__/jsfmt.spec.js.snap b/tests/flow/keyvalue/__snapshots__/jsfmt.spec.js.snap index 2f76ebeb3..0d9ab0282 100644 --- a/tests/flow/keyvalue/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/keyvalue/__snapshots__/jsfmt.spec.js.snap @@ -1,9 +1,11 @@ -exports[`test keyvalue.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`keyvalue.js 1`] = ` "// @flow let tests = [ function(x: { [key: number]: string }) { - (x[\"\"]: number); + (x[\\"\\"]: number); } ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -11,7 +13,7 @@ let tests = [ let tests = [ function(x: { [key: number]: string }) { - (x[\"\"]: number); + (x[\\"\\"]: number); } ]; " diff --git a/tests/flow/last_duplicate_property_wins/__snapshots__/jsfmt.spec.js.snap b/tests/flow/last_duplicate_property_wins/__snapshots__/jsfmt.spec.js.snap index cd584e6a6..59b6c9de8 100644 --- a/tests/flow/last_duplicate_property_wins/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/last_duplicate_property_wins/__snapshots__/jsfmt.spec.js.snap @@ -1,17 +1,19 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "// @flow // Classes class C { foo(): number { return 0; } - foo(): string { return \"hello\" } // last wins + foo(): string { return \\"hello\\" } // last wins x: number; x: string; // last wins bar(): number { return 0; } bar: string; // field wins over method qux: number; - qux(): string { return \"hello\" } // method loses to field! + qux(): string { return \\"hello\\" } // method loses to field! } // check @@ -19,19 +21,19 @@ class C { ((new C).foo(): boolean); // last wins ((new C).x: boolean); // last wins ((new C).bar: boolean); // last wins -((new C).qux: boolean); // weird outlier where last doesn\'t win in classes +((new C).qux: boolean); // weird outlier where last doesn't win in classes // Objects const o = { foo(): number { return 0; }, - foo(): string { return \"hello\" }, // last wins + foo(): string { return \\"hello\\" }, // last wins x: 42, - x: \"hello\", // last wins + x: \\"hello\\", // last wins bar(): number { return 0; }, - bar: \"hello\", // last wins + bar: \\"hello\\", // last wins qux: 42, - qux(): string { return \"hello\" }, // last wins + qux(): string { return \\"hello\\" }, // last wins }; // check @@ -50,7 +52,7 @@ class C { return 0; } foo(): string { - return \"hello\"; + return \\"hello\\"; } // last wins x: number; x: string; // last wins @@ -60,7 +62,7 @@ class C { bar: string; // field wins over method qux: number; qux(): string { - return \"hello\"; + return \\"hello\\"; } // method loses to field! } @@ -69,7 +71,7 @@ class C { (new C().foo(): boolean); // last wins (new C().x: boolean); // last wins (new C().bar: boolean); // last wins -(new C().qux: boolean); // weird outlier where last doesn\'t win in classes +(new C().qux: boolean); // weird outlier where last doesn't win in classes // Objects @@ -78,17 +80,17 @@ const o = { return 0; }, foo(): string { - return \"hello\"; + return \\"hello\\"; }, // last wins x: 42, - x: \"hello\", // last wins + x: \\"hello\\", // last wins bar(): number { return 0; }, - bar: \"hello\", // last wins + bar: \\"hello\\", // last wins qux: 42, qux(): string { - return \"hello\"; + return \\"hello\\"; } // last wins }; diff --git a/tests/flow/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/lib/__snapshots__/jsfmt.spec.js.snap index b784a4796..5ffc4ea5d 100644 --- a/tests/flow/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test libtest.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`libtest.js 1`] = ` "var x:string = NaN var y:string = Number.MAX_VALUE; var z:number = new TypeError().name; -var w:string = parseInt(\"...\"); +var w:string = parseInt(\\"...\\"); var a = new Map(); -a.delete(\'foobar\'); +a.delete('foobar'); var b = undefined; if (undefined) { @@ -14,10 +16,10 @@ if (undefined) { var x: string = NaN; var y: string = Number.MAX_VALUE; var z: number = new TypeError().name; -var w: string = parseInt(\"...\"); +var w: string = parseInt(\\"...\\"); var a = new Map(); -a.delete(\"foobar\"); +a.delete(\\"foobar\\"); var b = undefined; if (undefined) { diff --git a/tests/flow/lib_interfaces/declarations/__snapshots__/jsfmt.spec.js.snap b/tests/flow/lib_interfaces/declarations/__snapshots__/jsfmt.spec.js.snap index 01e79db6e..1fe2466cb 100644 --- a/tests/flow/lib_interfaces/declarations/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/lib_interfaces/declarations/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test underscore.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`underscore.js 1`] = ` "interface C { foo(): CArrays; bar(): C; diff --git a/tests/flow/libconfig/__snapshots__/jsfmt.spec.js.snap b/tests/flow/libconfig/__snapshots__/jsfmt.spec.js.snap index 7fd71f3aa..fdaf23df8 100644 --- a/tests/flow/libconfig/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/libconfig/__snapshots__/jsfmt.spec.js.snap @@ -1,18 +1,20 @@ -exports[`test libA.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`libA.js 1`] = ` "declare function foo(x: number): void; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare function foo(x: number): void; " `; -exports[`test libB.js 1`] = ` +exports[`libB.js 1`] = ` "declare function bar(x: string): void; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare function bar(x: string): void; " `; -exports[`test libtest.js 1`] = ` +exports[`libtest.js 1`] = ` "foo(123); bar(123); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/flow/libdef_ignored_module/__snapshots__/jsfmt.spec.js.snap b/tests/flow/libdef_ignored_module/__snapshots__/jsfmt.spec.js.snap index dd40ad979..baa4e444c 100644 --- a/tests/flow/libdef_ignored_module/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/libdef_ignored_module/__snapshots__/jsfmt.spec.js.snap @@ -1,13 +1,15 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "/* @flow */ -import foo from \"foo\"; +import foo from \\"foo\\"; (foo.bar : string); // error number ~> string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -import foo from \"foo\"; +import foo from \\"foo\\"; (foo.bar: string); // error number ~> string " diff --git a/tests/flow/libdef_ignored_module/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/libdef_ignored_module/lib/__snapshots__/jsfmt.spec.js.snap index c410d55b7..81b463e93 100644 --- a/tests/flow/libdef_ignored_module/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/libdef_ignored_module/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test foo.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` "declare module foo { declare var bar: number; } diff --git a/tests/flow/liberr/__snapshots__/jsfmt.spec.js.snap b/tests/flow/liberr/__snapshots__/jsfmt.spec.js.snap index 7a818bd7a..5fe7539bc 100644 --- a/tests/flow/liberr/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/liberr/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test a.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a.js 1`] = ` "/** * @flow */ diff --git a/tests/flow/liberr/libs/__snapshots__/jsfmt.spec.js.snap b/tests/flow/liberr/libs/__snapshots__/jsfmt.spec.js.snap index 59ecef80f..6f2a1e81f 100644 --- a/tests/flow/liberr/libs/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/liberr/libs/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test type_error.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type_error.js 1`] = ` "// @flow declare function foo(x: number): Array; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/flow/libflow-typed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/libflow-typed/__snapshots__/jsfmt.spec.js.snap index c41c08da9..2a0466193 100644 --- a/tests/flow/libflow-typed/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/libflow-typed/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test libtest.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`libtest.js 1`] = ` "/* @flow */ -const dino : Dinosaur = \"Stegosaurus\" +const dino : Dinosaur = \\"Stegosaurus\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -const dino: Dinosaur = \"Stegosaurus\"; +const dino: Dinosaur = \\"Stegosaurus\\"; " `; diff --git a/tests/flow/libflow-typed/flow-typed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/libflow-typed/flow-typed/__snapshots__/jsfmt.spec.js.snap index 5874c610f..8b35367c4 100644 --- a/tests/flow/libflow-typed/flow-typed/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/libflow-typed/flow-typed/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test dino.js 1`] = ` -"declare type Dinosaur = \"T-Rex\" | \"Apatosaurus\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`dino.js 1`] = ` +"declare type Dinosaur = \\"T-Rex\\" | \\"Apatosaurus\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -declare type Dinosaur = \"T-Rex\" | \"Apatosaurus\"; +declare type Dinosaur = \\"T-Rex\\" | \\"Apatosaurus\\"; " `; diff --git a/tests/flow/librec/__snapshots__/jsfmt.spec.js.snap b/tests/flow/librec/__snapshots__/jsfmt.spec.js.snap index 9d7c8b78d..9cd2cfe6f 100644 --- a/tests/flow/librec/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/librec/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test libtest.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`libtest.js 1`] = ` "foo(123); bar(123); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/flow/librec/lib/A/__snapshots__/jsfmt.spec.js.snap b/tests/flow/librec/lib/A/__snapshots__/jsfmt.spec.js.snap index 1fd0e0972..cf36e574c 100644 --- a/tests/flow/librec/lib/A/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/librec/lib/A/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test libA.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`libA.js 1`] = ` "declare function foo(x: number): void; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare function foo(x: number): void; diff --git a/tests/flow/librec/lib/B/__snapshots__/jsfmt.spec.js.snap b/tests/flow/librec/lib/B/__snapshots__/jsfmt.spec.js.snap index eb2965032..0f8dde276 100644 --- a/tests/flow/librec/lib/B/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/librec/lib/B/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test libB.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`libB.js 1`] = ` "declare function bar(x: string): void; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare function bar(x: string): void; diff --git a/tests/flow/literal/__snapshots__/jsfmt.spec.js.snap b/tests/flow/literal/__snapshots__/jsfmt.spec.js.snap index 5e8d5d96c..49b274554 100644 --- a/tests/flow/literal/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/literal/__snapshots__/jsfmt.spec.js.snap @@ -1,68 +1,70 @@ -exports[`test enum.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`enum.js 1`] = ` "var APIKeys = { - AGE: \'age\', - NAME: \'name\', + AGE: 'age', + NAME: 'name', }; module.exports = APIKeys; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var APIKeys = { - AGE: \"age\", - NAME: \"name\" + AGE: \\"age\\", + NAME: \\"name\\" }; module.exports = APIKeys; " `; -exports[`test enum_client.js 1`] = ` -"var APIKeys = require(\'./enum\'); -// object that maps \"AGE\" to \"age\", \"NAME\" to \"name\" +exports[`enum_client.js 1`] = ` +"var APIKeys = require('./enum'); +// object that maps \\"AGE\\" to \\"age\\", \\"NAME\\" to \\"name\\" function foo(x: $Keys) { } -foo(\"AGE\"); -foo(\"LOCATION\"); // error +foo(\\"AGE\\"); +foo(\\"LOCATION\\"); // error function bar(x: $Keys<{age: number}>) { } -bar(APIKeys.AGE); // not an error: APIKeys.AGE = \"age\" -bar(APIKeys.NAME); // error: since \"NAME\" is not in the smaller enum +bar(APIKeys.AGE); // not an error: APIKeys.AGE = \\"age\\" +bar(APIKeys.NAME); // error: since \\"NAME\\" is not in the smaller enum var object = {}; object[APIKeys.AGE] = 123; // i.e., object.age = 123 -object[APIKeys.NAME] = \"FOO\"; // i.e., object.name = \"FOO\" +object[APIKeys.NAME] = \\"FOO\\"; // i.e., object.name = \\"FOO\\" var age:number = object[APIKeys.AGE]; var name:number = object[APIKeys.NAME]; // error: object.name is a string var indices = { red: 0, green: 1, blue: 2 }; -var tuple = [42, \"hello\", false]; +var tuple = [42, \\"hello\\", false]; var red:string = tuple[indices.red]; // error: tuple[0] is a number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var APIKeys = require(\"./enum\"); -// object that maps \"AGE\" to \"age\", \"NAME\" to \"name\" +var APIKeys = require(\\"./enum\\"); +// object that maps \\"AGE\\" to \\"age\\", \\"NAME\\" to \\"name\\" function foo(x: $Keys) {} -foo(\"AGE\"); -foo(\"LOCATION\"); // error +foo(\\"AGE\\"); +foo(\\"LOCATION\\"); // error function bar(x: $Keys<{ age: number }>) {} -bar(APIKeys.AGE); // not an error: APIKeys.AGE = \"age\" -bar(APIKeys.NAME); // error: since \"NAME\" is not in the smaller enum +bar(APIKeys.AGE); // not an error: APIKeys.AGE = \\"age\\" +bar(APIKeys.NAME); // error: since \\"NAME\\" is not in the smaller enum var object = {}; object[APIKeys.AGE] = 123; // i.e., object.age = 123 -object[APIKeys.NAME] = \"FOO\"; // i.e., object.name = \"FOO\" +object[APIKeys.NAME] = \\"FOO\\"; // i.e., object.name = \\"FOO\\" var age: number = object[APIKeys.AGE]; var name: number = object[APIKeys.NAME]; // error: object.name is a string var indices = { red: 0, green: 1, blue: 2 }; -var tuple = [42, \"hello\", false]; +var tuple = [42, \\"hello\\", false]; var red: string = tuple[indices.red]; // error: tuple[0] is a number " `; -exports[`test number.js 1`] = ` +exports[`number.js 1`] = ` "function test1(x: number): number { return -x; } @@ -71,8 +73,8 @@ function test2(x: string): number { return -x; } -// sanity checks to make sure merging envs doesn\'t keep creating new NumT\'s -// because of the UnaryMinusT\'s, causing nontermination +// sanity checks to make sure merging envs doesn't keep creating new NumT's +// because of the UnaryMinusT's, causing nontermination function test3(x: number, flip_times: number): number { for (var i = 0; i < flip_times; i++) { x = -x; @@ -95,8 +97,8 @@ function test2(x: string): number { return -x; } -// sanity checks to make sure merging envs doesn\'t keep creating new NumT\'s -// because of the UnaryMinusT\'s, causing nontermination +// sanity checks to make sure merging envs doesn't keep creating new NumT's +// because of the UnaryMinusT's, causing nontermination function test3(x: number, flip_times: number): number { for (var i = 0; i < flip_times; i++) { x = -x; diff --git a/tests/flow/locals/__snapshots__/jsfmt.spec.js.snap b/tests/flow/locals/__snapshots__/jsfmt.spec.js.snap index 1414e6c6b..7bcf82818 100644 --- a/tests/flow/locals/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/locals/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test lex.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`lex.js 1`] = ` "function switch_scope(x: mixed) { - let a = \"\"; - let b = \"\"; + let a = \\"\\"; + let b = \\"\\"; switch (x) { - case \"foo\": + case \\"foo\\": let a; - a = 0; // doesn\'t add lower bound to outer a + a = 0; // doesn't add lower bound to outer a b = 0; } (a : string); // OK @@ -16,11 +18,11 @@ function try_scope_finally() { let a; let b; try { - a = \"\"; - b = \"\"; + a = \\"\\"; + b = \\"\\"; } finally { let a; - a = 0; // doesn\'t add lower bound to outer a + a = 0; // doesn't add lower bound to outer a b = 0; } (a : string); // ok @@ -28,10 +30,10 @@ function try_scope_finally() { } function for_scope() { - let a = \"\"; - let b = \"\"; + let a = \\"\\"; + let b = \\"\\"; for (let a;;) { - a = 0; // doesn\'t add lower bound to outer a + a = 0; // doesn't add lower bound to outer a b = 0; } (a : string); @@ -42,18 +44,18 @@ function for_in_scope(o: Object) { let a = 0; let b = 0; for (let a in o) { - a = \"\"; // doesn\'t add lower bound to outer a - b = \"\"; + a = \\"\\"; // doesn't add lower bound to outer a + b = \\"\\"; } (a : number); (b : number); // error: string ~> number } function for_of_scope(xs: number[]) { - let a = \"\"; - let b = \"\"; + let a = \\"\\"; + let b = \\"\\"; for (let a of xs) { - a = 0; // doesn\'t add lower bound to outer a + a = 0; // doesn't add lower bound to outer a b = 0; } (a : string); @@ -61,12 +63,12 @@ function for_of_scope(xs: number[]) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function switch_scope(x: mixed) { - let a = \"\"; - let b = \"\"; + let a = \\"\\"; + let b = \\"\\"; switch (x) { - case \"foo\": + case \\"foo\\": let a; - a = 0; // doesn\'t add lower bound to outer a + a = 0; // doesn't add lower bound to outer a b = 0; } (a: string); // OK @@ -77,11 +79,11 @@ function try_scope_finally() { let a; let b; try { - a = \"\"; - b = \"\"; + a = \\"\\"; + b = \\"\\"; } finally { let a; - a = 0; // doesn\'t add lower bound to outer a + a = 0; // doesn't add lower bound to outer a b = 0; } (a: string); // ok @@ -89,10 +91,10 @@ function try_scope_finally() { } function for_scope() { - let a = \"\"; - let b = \"\"; + let a = \\"\\"; + let b = \\"\\"; for (let a; ; ) { - a = 0; // doesn\'t add lower bound to outer a + a = 0; // doesn't add lower bound to outer a b = 0; } (a: string); @@ -103,18 +105,18 @@ function for_in_scope(o: Object) { let a = 0; let b = 0; for (let a in o) { - a = \"\"; // doesn\'t add lower bound to outer a - b = \"\"; + a = \\"\\"; // doesn't add lower bound to outer a + b = \\"\\"; } (a: number); (b: number); // error: string ~> number } function for_of_scope(xs: number[]) { - let a = \"\"; - let b = \"\"; + let a = \\"\\"; + let b = \\"\\"; for (let a of xs) { - a = 0; // doesn\'t add lower bound to outer a + a = 0; // doesn't add lower bound to outer a b = 0; } (a: string); @@ -123,7 +125,7 @@ function for_of_scope(xs: number[]) { " `; -exports[`test locals.js 1`] = ` +exports[`locals.js 1`] = ` "var x:string = 0; var x:number = 1; @@ -143,7 +145,7 @@ function sorry(really: bool) { function foo0(b: bool): number { var x = 0; if (b) { - var x = \"\"; // error: string ~> number + var x = \\"\\"; // error: string ~> number } return x; } @@ -167,7 +169,7 @@ function sorry(really: boolean) { function foo0(b: boolean): number { var x = 0; if (b) { - var x = \"\"; // error: string ~> number + var x = \\"\\"; // error: string ~> number } return x; } diff --git a/tests/flow/logical/__snapshots__/jsfmt.spec.js.snap b/tests/flow/logical/__snapshots__/jsfmt.spec.js.snap index 2ff1eac92..decee56d7 100644 --- a/tests/flow/logical/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/logical/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test logical.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`logical.js 1`] = ` "/* @flow */ /** @@ -6,7 +8,7 @@ exports[`test logical.js 1`] = ` */ function logical1a(): number { // expected \`: boolean\` var x = false; - return x && \'123\'; + return x && '123'; } /** @@ -14,84 +16,84 @@ function logical1a(): number { // expected \`: boolean\` */ function logical1b(): string { var x = true; - return x && \'123\'; + return x && '123'; } /** * A literal on the left side of && */ function logical2a(): number { // expected \`: boolean\` - return false && \'123\'; + return false && '123'; } /** * A literal on the left side of && */ function logical2b(): number { - return 0 && \'123\'; + return 0 && '123'; } /** * A literal on the left side of && */ function logical2c(): string { - return \"\" && 123; + return \\"\\" && 123; } /** * A literal on the left side of && */ function logical2d(): string { - return true && \'123\'; + return true && '123'; } /** * A literal on the left side of && */ function logical2e(): number { - return \'foo\' && 123; + return 'foo' && 123; } /** * A literal on the left side of && */ function logical2f(): string { - return 123 && \'foo\'; + return 123 && 'foo'; } /** * A literal on the left side of && */ function logical2g(): string { - return [1,2,3] && \'foo\'; + return [1,2,3] && 'foo'; } /** * A literal on the left side of && */ function logical2h(x: {a: number}): string { - return x && \'foo\'; + return x && 'foo'; } /** * A literal on the left side of && */ function logical2i(x: Object): string { - return x && \'foo\'; + return x && 'foo'; } /** * A literal on the left side of && */ function logical2j(x: (a: number) => number): string { - return x && \'foo\'; + return x && 'foo'; } /** * A literal on the left side of && */ function logical2k(x: Function): string { - return x && \'foo\'; + return x && 'foo'; } /** @@ -122,7 +124,7 @@ function logical3c(): ?number { // expected \`: boolean | ?number\` * Maybe truthy returns both types */ function logical4(x: boolean): string { // expected \`: boolean | string\` - return x && \'123\'; + return x && '123'; } /** @@ -153,42 +155,42 @@ function logical5c(): string { // expected \`: boolean\` * A literal on the left side of || */ function logical6a(): string { - return false || \'123\'; + return false || '123'; } /** * A literal on the left side of || */ function logical6b(): string { - return 0 || \'123\'; + return 0 || '123'; } /** * A literal on the left side of || */ function logical6c(): number { - return \"\" || 123; + return \\"\\" || 123; } /** * A literal on the left side of || */ function logical6d(): number { // expected \`: boolean\` - return true || \'123\'; + return true || '123'; } /** * A literal on the left side of || */ function logical6e(): string { - return \'foo\' || 123; + return 'foo' || 123; } /** * A literal on the left side of || */ function logical6f(): number { - return 123 || \'foo\'; + return 123 || 'foo'; } /** @@ -217,14 +219,14 @@ function logical7c(x: string): number { * A composite && and || */ function logical7d(x: number): string { - return x && \'foo\' || \'bar\'; + return x && 'foo' || 'bar'; } /** * A composite && and || */ function logical7e(x: number): string { - return false && x || \'bar\'; + return false && x || 'bar'; } /** @@ -235,7 +237,7 @@ function logical7e(x: number): string { */ function logical8a(): number { var x = false; - return (x || 0) && \'foo\'; + return (x || 0) && 'foo'; } /** @@ -245,7 +247,7 @@ function logical8a(): number { */ function logical8b(): string { var x = false; - return (x || 1) && \'foo\'; + return (x || 1) && 'foo'; } /** @@ -255,7 +257,7 @@ function logical8b(): string { */ function logical8c(): string { var x = true; - return (x || 1) && \'foo\'; + return (x || 1) && 'foo'; } /** @@ -263,7 +265,7 @@ function logical8c(): string { */ function logical8d(): number { var x = false; - return x || (0 && \'foo\'); + return x || (0 && 'foo'); } /** @@ -271,7 +273,7 @@ function logical8d(): number { */ function logical8e(): string { var x = false; - return x || (1 && \'foo\'); + return x || (1 && 'foo'); } /** @@ -279,7 +281,7 @@ function logical8e(): string { */ function logical8f(): string { // expected \`: boolean\` var x = true; - return x || (1 && \'foo\'); + return x || (1 && 'foo'); } /** @@ -303,7 +305,7 @@ function logical9b(x: number, y: string): number | string { * A composite || and || */ function logical9c(x: number, y: boolean): string { - return \'a\' || x || y; + return 'a' || x || y; } /** @@ -379,14 +381,14 @@ function logical12b(y: number): number { */ function logical13(x: number): Array<{x: string}> { return [ - {x: x && \"bar\"}, - {x: true && \"bar\"}, + {x: x && \\"bar\\"}, + {x: true && \\"bar\\"}, {x: true && false}, {x: false && false}, - {x: 1 && \"bar\"}, - {x: \"foo\" && \"bar\"}, - {x: \"foo\" && \"bar\"}, - {x: \"foo\" && \"bar\"}, + {x: 1 && \\"bar\\"}, + {x: \\"foo\\" && \\"bar\\"}, + {x: \\"foo\\" && \\"bar\\"}, + {x: \\"foo\\" && \\"bar\\"}, ]; } @@ -395,14 +397,14 @@ function logical13(x: number): Array<{x: string}> { */ function logical14(x: number): Array<{x: string}> { return [ - {x: x || \"bar\"}, - {x: false || \"bar\"}, + {x: x || \\"bar\\"}, + {x: false || \\"bar\\"}, {x: false || true}, {x: true || false}, - {x: 0 || \"bar\"}, - {x: \"foo\" || \"bar\"}, - {x: \"foo\" || \"bar\"}, - {x: \"foo\" || \"bar\"}, + {x: 0 || \\"bar\\"}, + {x: \\"foo\\" || \\"bar\\"}, + {x: \\"foo\\" || \\"bar\\"}, + {x: \\"foo\\" || \\"bar\\"}, ]; } @@ -522,7 +524,7 @@ function logical19b(x: { y: string, z: boolean }): boolean { function logical1a(): number { // expected \`: boolean\` var x = false; - return x && \"123\"; + return x && \\"123\\"; } /** @@ -530,7 +532,7 @@ function logical1a(): number { */ function logical1b(): string { var x = true; - return x && \"123\"; + return x && \\"123\\"; } /** @@ -538,77 +540,77 @@ function logical1b(): string { */ function logical2a(): number { // expected \`: boolean\` - return false && \"123\"; + return false && \\"123\\"; } /** * A literal on the left side of && */ function logical2b(): number { - return 0 && \"123\"; + return 0 && \\"123\\"; } /** * A literal on the left side of && */ function logical2c(): string { - return \"\" && 123; + return \\"\\" && 123; } /** * A literal on the left side of && */ function logical2d(): string { - return true && \"123\"; + return true && \\"123\\"; } /** * A literal on the left side of && */ function logical2e(): number { - return \"foo\" && 123; + return \\"foo\\" && 123; } /** * A literal on the left side of && */ function logical2f(): string { - return 123 && \"foo\"; + return 123 && \\"foo\\"; } /** * A literal on the left side of && */ function logical2g(): string { - return [1, 2, 3] && \"foo\"; + return [1, 2, 3] && \\"foo\\"; } /** * A literal on the left side of && */ function logical2h(x: { a: number }): string { - return x && \"foo\"; + return x && \\"foo\\"; } /** * A literal on the left side of && */ function logical2i(x: Object): string { - return x && \"foo\"; + return x && \\"foo\\"; } /** * A literal on the left side of && */ function logical2j(x: (a: number) => number): string { - return x && \"foo\"; + return x && \\"foo\\"; } /** * A literal on the left side of && */ function logical2k(x: Function): string { - return x && \"foo\"; + return x && \\"foo\\"; } /** @@ -643,7 +645,7 @@ function logical3c(): ?number { */ function logical4(x: boolean): string { // expected \`: boolean | string\` - return x && \"123\"; + return x && \\"123\\"; } /** @@ -675,21 +677,21 @@ function logical5c(): string { * A literal on the left side of || */ function logical6a(): string { - return false || \"123\"; + return false || \\"123\\"; } /** * A literal on the left side of || */ function logical6b(): string { - return 0 || \"123\"; + return 0 || \\"123\\"; } /** * A literal on the left side of || */ function logical6c(): number { - return \"\" || 123; + return \\"\\" || 123; } /** @@ -697,21 +699,21 @@ function logical6c(): number { */ function logical6d(): number { // expected \`: boolean\` - return true || \"123\"; + return true || \\"123\\"; } /** * A literal on the left side of || */ function logical6e(): string { - return \"foo\" || 123; + return \\"foo\\" || 123; } /** * A literal on the left side of || */ function logical6f(): number { - return 123 || \"foo\"; + return 123 || \\"foo\\"; } /** @@ -740,14 +742,14 @@ function logical7c(x: string): number { * A composite && and || */ function logical7d(x: number): string { - return x && \"foo\" || \"bar\"; + return x && \\"foo\\" || \\"bar\\"; } /** * A composite && and || */ function logical7e(x: number): string { - return false && x || \"bar\"; + return false && x || \\"bar\\"; } /** @@ -758,7 +760,7 @@ function logical7e(x: number): string { */ function logical8a(): number { var x = false; - return (x || 0) && \"foo\"; + return (x || 0) && \\"foo\\"; } /** @@ -768,7 +770,7 @@ function logical8a(): number { */ function logical8b(): string { var x = false; - return (x || 1) && \"foo\"; + return (x || 1) && \\"foo\\"; } /** @@ -778,7 +780,7 @@ function logical8b(): string { */ function logical8c(): string { var x = true; - return (x || 1) && \"foo\"; + return (x || 1) && \\"foo\\"; } /** @@ -786,7 +788,7 @@ function logical8c(): string { */ function logical8d(): number { var x = false; - return x || 0 && \"foo\"; + return x || 0 && \\"foo\\"; } /** @@ -794,7 +796,7 @@ function logical8d(): number { */ function logical8e(): string { var x = false; - return x || 1 && \"foo\"; + return x || 1 && \\"foo\\"; } /** @@ -803,7 +805,7 @@ function logical8e(): string { function logical8f(): string { // expected \`: boolean\` var x = true; - return x || 1 && \"foo\"; + return x || 1 && \\"foo\\"; } /** @@ -825,7 +827,7 @@ function logical9b(x: number, y: string): number | string { * A composite || and || */ function logical9c(x: number, y: boolean): string { - return \"a\" || x || y; + return \\"a\\" || x || y; } /** @@ -901,14 +903,14 @@ function logical12b(y: number): number { */ function logical13(x: number): Array<{ x: string }> { return [ - { x: x && \"bar\" }, - { x: true && \"bar\" }, + { x: x && \\"bar\\" }, + { x: true && \\"bar\\" }, { x: true && false }, { x: false && false }, - { x: 1 && \"bar\" }, - { x: \"foo\" && \"bar\" }, - { x: \"foo\" && \"bar\" }, - { x: \"foo\" && \"bar\" } + { x: 1 && \\"bar\\" }, + { x: \\"foo\\" && \\"bar\\" }, + { x: \\"foo\\" && \\"bar\\" }, + { x: \\"foo\\" && \\"bar\\" } ]; } @@ -917,14 +919,14 @@ function logical13(x: number): Array<{ x: string }> { */ function logical14(x: number): Array<{ x: string }> { return [ - { x: x || \"bar\" }, - { x: false || \"bar\" }, + { x: x || \\"bar\\" }, + { x: false || \\"bar\\" }, { x: false || true }, { x: true || false }, - { x: 0 || \"bar\" }, - { x: \"foo\" || \"bar\" }, - { x: \"foo\" || \"bar\" }, - { x: \"foo\" || \"bar\" } + { x: 0 || \\"bar\\" }, + { x: \\"foo\\" || \\"bar\\" }, + { x: \\"foo\\" || \\"bar\\" }, + { x: \\"foo\\" || \\"bar\\" } ]; } diff --git a/tests/flow/loners/__snapshots__/jsfmt.spec.js.snap b/tests/flow/loners/__snapshots__/jsfmt.spec.js.snap index bc44dec59..fee0dc6ba 100644 --- a/tests/flow/loners/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/loners/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,7 @@ -exports[`test loners.js 1`] = ` -"var o = { x: 5, y: \"jello\" }; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`loners.js 1`] = ` +"var o = { x: 5, y: \\"jello\\" }; var z = o.z; var export_o: { x: number; } = o; @@ -9,7 +11,7 @@ var export_f: (u: number) => number = f; //exports = export_o; module.exports = export_f; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var o = { x: 5, y: \"jello\" }; +var o = { x: 5, y: \\"jello\\" }; var z = o.z; var export_o: { x: number } = o; diff --git a/tests/flow/method_properties/__snapshots__/jsfmt.spec.js.snap b/tests/flow/method_properties/__snapshots__/jsfmt.spec.js.snap index 4e717dd0c..3aab06e46 100644 --- a/tests/flow/method_properties/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/method_properties/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test exports_optional_prop.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`exports_optional_prop.js 1`] = ` "// @flow declare class Foo { @@ -17,7 +19,7 @@ export { Foo }; " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "class C { C() { } foo() { } @@ -28,7 +30,7 @@ C.x; (new C).foo.x; C.bar.x; -import {Foo} from \'./exports_optional_prop\'; +import {Foo} from './exports_optional_prop'; const foo = new Foo(); (foo.bar(): string); // error, could be undefined @@ -49,7 +51,7 @@ C.x; new C().foo.x; C.bar.x; -import { Foo } from \"./exports_optional_prop\"; +import { Foo } from \\"./exports_optional_prop\\"; const foo = new Foo(); (foo.bar(): string); // error, could be undefined diff --git a/tests/flow/misc/__snapshots__/jsfmt.spec.js.snap b/tests/flow/misc/__snapshots__/jsfmt.spec.js.snap index c3f2e0dbc..7ff636eac 100644 --- a/tests/flow/misc/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/misc/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` " /* @providesModule A */ @@ -10,7 +12,7 @@ module.exports.cls = A; function f(x:boolean) { } module.exports.fn = f; -A.y = \"?\"; +A.y = \\"?\\"; A.x = A.y; f(A.x); // A.x is now a string, by def assign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -24,20 +26,20 @@ module.exports.cls = A; function f(x: boolean) {} module.exports.fn = f; -A.y = \"?\"; +A.y = \\"?\\"; A.x = A.y; f(A.x); // A.x is now a string, by def assign " `; -exports[`test B.js 1`] = ` +exports[`B.js 1`] = ` " /* @providesModule B */ -var A = require(\'A\').cls; +var A = require('A').cls; function B() { - this.b = \"...\"; + this.b = \\"...\\"; } function f():number { return this.b; } @@ -49,10 +51,10 @@ module.exports = B; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule B */ -var A = require(\"A\").cls; +var A = require(\\"A\\").cls; function B() { - this.b = \"...\"; + this.b = \\"...\\"; } function f(): number { @@ -66,12 +68,12 @@ module.exports = B; " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` " /* @providesModule C */ -var B = require(\'B\'); -var f = require(\'A\').fn; +var B = require('B'); +var f = require('A').fn; function C() { var o = new B(); @@ -84,8 +86,8 @@ module.exports = C; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule C */ -var B = require(\"B\"); -var f = require(\"A\").fn; +var B = require(\\"B\\"); +var f = require(\\"A\\").fn; function C() { var o = new B(); @@ -98,11 +100,11 @@ module.exports = C; " `; -exports[`test D.js 1`] = ` +exports[`D.js 1`] = ` " /* @providesModule D */ -var f = require(\'A\').fn; +var f = require('A').fn; function g():string { return this.i; } @@ -112,11 +114,11 @@ o.i = true; var i = o.fn(); f(i); -module.exports = \"D for dummy\"; +module.exports = \\"D for dummy\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule D */ -var f = require(\"A\").fn; +var f = require(\\"A\\").fn; function g(): string { return this.i; @@ -128,11 +130,11 @@ o.i = true; var i = o.fn(); f(i); -module.exports = \"D for dummy\"; +module.exports = \\"D for dummy\\"; " `; -exports[`test E.js 1`] = ` +exports[`E.js 1`] = ` " /* @providesModule E */ @@ -156,9 +158,9 @@ module.exports = { obj: o }; " `; -exports[`test F.js 1`] = ` +exports[`F.js 1`] = ` "function fn2(x) { return x.length * 4; } -fn2({length: \'hi\'}); +fn2({length: 'hi'}); function foo(x: Array): string { return x.length; @@ -167,7 +169,7 @@ function foo(x: Array): string { function fn2(x) { return x.length * 4; } -fn2({ length: \"hi\" }); +fn2({ length: \\"hi\\" }); function foo(x: Array): string { return x.length; @@ -175,21 +177,21 @@ function foo(x: Array): string { " `; -exports[`test G.js 1`] = ` -"var a = { length: \"duck\" }; +exports[`G.js 1`] = ` +"var a = { length: \\"duck\\" }; a.length = 123; a.length(); var b = [ 123 ]; -b.length = \"duck\"; +b.length = \\"duck\\"; b.length(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var a = { length: \"duck\" }; +var a = { length: \\"duck\\" }; a.length = 123; a.length(); var b = [123]; -b.length = \"duck\"; +b.length = \\"duck\\"; b.length(); " `; diff --git a/tests/flow/missing_annotation/__snapshots__/jsfmt.spec.js.snap b/tests/flow/missing_annotation/__snapshots__/jsfmt.spec.js.snap index 5483c51de..22123427d 100644 --- a/tests/flow/missing_annotation/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/missing_annotation/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test array.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`array.js 1`] = ` "// @flow type Foo = {}; @@ -13,7 +15,7 @@ export var arr = [f]; " `; -exports[`test async_return.js 1`] = ` +exports[`async_return.js 1`] = ` "// @flow export async function foo() { @@ -28,7 +30,7 @@ export async function foo() { " `; -exports[`test infer.js 1`] = ` +exports[`infer.js 1`] = ` "/* @flow */ var Foo = { @@ -75,15 +77,15 @@ var Foo = { }; var Bar = { - a: Foo.a(\'Foo\'), // no annotation required + a: Foo.a('Foo'), // no annotation required - // object property types are inferred, so make sure that this doesn\'t cause - // us to also infer the parameter\'s type. - b: Foo.b(\'bar\'), // no annotation required + // object property types are inferred, so make sure that this doesn't cause + // us to also infer the parameter's type. + b: Foo.b('bar'), // no annotation required - c: Foo.c(\'bar\'), // no annotation required + c: Foo.c('bar'), // no annotation required - d: Foo.d(\'bar\'), // no annotation required + d: Foo.d('bar'), // no annotation required }; module.exports = Foo, Bar; @@ -140,15 +142,15 @@ var Foo = { }; var Bar = { - a: Foo.a(\"Foo\"), // no annotation required + a: Foo.a(\\"Foo\\"), // no annotation required - // object property types are inferred, so make sure that this doesn\'t cause - // us to also infer the parameter\'s type. - b: Foo.b(\"bar\"), // no annotation required + // object property types are inferred, so make sure that this doesn't cause + // us to also infer the parameter's type. + b: Foo.b(\\"bar\\"), // no annotation required - c: Foo.c(\"bar\"), // no annotation required + c: Foo.c(\\"bar\\"), // no annotation required - d: Foo.d(\"bar\") // no annotation required + d: Foo.d(\\"bar\\") // no annotation required }; module.exports = Foo, Bar; diff --git a/tests/flow/modified_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/modified_lib/__snapshots__/jsfmt.spec.js.snap index 581211fee..3c678d30b 100644 --- a/tests/flow/modified_lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/modified_lib/__snapshots__/jsfmt.spec.js.snap @@ -1,13 +1,15 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "// @flow -import {bar} from \'foo\'; +import {bar} from 'foo'; bar(5); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { bar } from \"foo\"; +import { bar } from \\"foo\\"; bar(5); " diff --git a/tests/flow/modified_lib/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/modified_lib/lib/__snapshots__/jsfmt.spec.js.snap index 4a8925e21..799ce5f94 100644 --- a/tests/flow/modified_lib/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/modified_lib/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,9 +1,11 @@ -exports[`test lib.js 1`] = ` -"declare module \'foo\' { +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`lib.js 1`] = ` +"declare module 'foo' { declare function bar(str: string): number; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -declare module \"foo\" { +declare module \\"foo\\" { declare function bar(str: string): number; } " diff --git a/tests/flow/module_not_found_errors/src/__snapshots__/jsfmt.spec.js.snap b/tests/flow/module_not_found_errors/src/__snapshots__/jsfmt.spec.js.snap index 2822a5415..3348d752e 100644 --- a/tests/flow/module_not_found_errors/src/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/module_not_found_errors/src/__snapshots__/jsfmt.spec.js.snap @@ -1,18 +1,20 @@ -exports[`test index.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`index.js 1`] = ` "// @flow -require(\'module_completely_absent\'); +require('module_completely_absent'); // node_modules/module_outside_of_root/ sits outside of the Flow project root. // Flow should give a descriptive error about this -require(\'module_outside_of_root\'); +require('module_outside_of_root'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -require(\"module_completely_absent\"); +require(\\"module_completely_absent\\"); // node_modules/module_outside_of_root/ sits outside of the Flow project root. // Flow should give a descriptive error about this -require(\"module_outside_of_root\"); +require(\\"module_outside_of_root\\"); " `; diff --git a/tests/flow/module_redirect/__snapshots__/jsfmt.spec.js.snap b/tests/flow/module_redirect/__snapshots__/jsfmt.spec.js.snap index 08d4b9b06..5c4a9be36 100644 --- a/tests/flow/module_redirect/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/module_redirect/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "declare module A { declare function foo(): string; } @@ -9,57 +11,57 @@ declare module A { " `; -exports[`test B.js 1`] = ` +exports[`B.js 1`] = ` "/** * @providesModule B * @flow */ -module.exports = require(\'A\'); +module.exports = require('A'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule B * @flow */ -module.exports = require(\"A\"); +module.exports = require(\\"A\\"); " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` "/** * @providesModule C * @flow */ -module.exports = require(\'B\'); +module.exports = require('B'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule C * @flow */ -module.exports = require(\"B\"); +module.exports = require(\\"B\\"); " `; -exports[`test D.js 1`] = ` +exports[`D.js 1`] = ` "/** * @providesModule D * @flow */ -var bar1: string = require(\'A\'); -var bar2: string = require(\'B\'); -var bar3: string = require(\'C\'); +var bar1: string = require('A'); +var bar2: string = require('B'); +var bar3: string = require('C'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @providesModule D * @flow */ -var bar1: string = require(\"A\"); -var bar2: string = require(\"B\"); -var bar3: string = require(\"C\"); +var bar1: string = require(\\"A\\"); +var bar2: string = require(\\"B\\"); +var bar3: string = require(\\"C\\"); " `; diff --git a/tests/flow/module_use_strict/__snapshots__/jsfmt.spec.js.snap b/tests/flow/module_use_strict/__snapshots__/jsfmt.spec.js.snap index 6e98314fe..b17c28da9 100644 --- a/tests/flow/module_use_strict/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/module_use_strict/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "// @flow (01: number); diff --git a/tests/flow/modules/__snapshots__/jsfmt.spec.js.snap b/tests/flow/modules/__snapshots__/jsfmt.spec.js.snap index e162ca3f6..1c45d3619 100644 --- a/tests/flow/modules/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/modules/__snapshots__/jsfmt.spec.js.snap @@ -1,34 +1,36 @@ -exports[`test cli.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`cli.js 1`] = ` "/* @flow */ -var f = require(\'./lib\'); +var f = require('./lib'); var y:number = f(0); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var f = require(\"./lib\"); +var f = require(\\"./lib\\"); var y: number = f(0); " `; -exports[`test cli2.js 1`] = ` +exports[`cli2.js 1`] = ` "/* @flow */ -var f = require(\'./lib\'); +var f = require('./lib'); -f(\"...\"); +f(\\"...\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var f = require(\"./lib\"); +var f = require(\\"./lib\\"); -f(\"...\"); +f(\\"...\\"); " `; -exports[`test lib.js 1`] = ` +exports[`lib.js 1`] = ` "/* @flow */ function g(x:string) { } diff --git a/tests/flow/more_annot/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_annot/__snapshots__/jsfmt.spec.js.snap index dfcaa3e8a..6862ec586 100644 --- a/tests/flow/more_annot/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/more_annot/__snapshots__/jsfmt.spec.js.snap @@ -1,16 +1,18 @@ -exports[`test client_object.js 1`] = ` -"var o = require(\'./object\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`client_object.js 1`] = ` +"var o = require('./object'); var a:number = o.w.z.y; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var o = require(\"./object\"); +var o = require(\\"./object\\"); var a: number = o.w.z.y; " `; -exports[`test object.js 1`] = ` -"var o1 = { x: 0, y: \"\" }; +exports[`object.js 1`] = ` +"var o1 = { x: 0, y: \\"\\" }; var o2 = { z: o1 } var o3 = {}; @@ -20,7 +22,7 @@ o3.w = o2; module.exports = o3; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var o1 = { x: 0, y: \"\" }; +var o1 = { x: 0, y: \\"\\" }; var o2 = { z: o1 }; var o3 = {}; @@ -32,7 +34,7 @@ module.exports = o3; " `; -exports[`test proto.js 1`] = ` +exports[`proto.js 1`] = ` "function Foo() { this.x = 0; } Foo.prototype.m = function() { } @@ -51,7 +53,7 @@ var o2: Foo = new Foo(); " `; -exports[`test super.js 1`] = ` +exports[`super.js 1`] = ` "class C { m() { } } class D extends C { } diff --git a/tests/flow/more_classes/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_classes/__snapshots__/jsfmt.spec.js.snap index 5e1e692cf..0032363be 100644 --- a/tests/flow/more_classes/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/more_classes/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test Bar.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Bar.js 1`] = ` " /* @providesModule Bar */ -var Qux = require(\'Qux\'); +var Qux = require('Qux'); class Bar { y:number; @@ -13,7 +15,7 @@ class Bar { } bar(z:string,u:string):string { - new Qux().w = \"?\"; + new Qux().w = \\"?\\"; return z; } } @@ -22,7 +24,7 @@ module.exports = Bar; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule Bar */ -var Qux = require(\"Qux\"); +var Qux = require(\\"Qux\\"); class Bar { y: number; @@ -33,7 +35,7 @@ class Bar { } bar(z: string, u: string): string { - new Qux().w = \"?\"; + new Qux().w = \\"?\\"; return z; } } @@ -42,12 +44,12 @@ module.exports = Bar; " `; -exports[`test Foo.js 1`] = ` +exports[`Foo.js 1`] = ` " /* @providesModule Foo */ -var Bar = require(\'Bar\'); -var Qux = require(\'Qux\'); +var Bar = require('Bar'); +var Qux = require('Qux'); class Foo extends Qux { x:string; @@ -57,7 +59,7 @@ class Foo extends Qux { foo(y:string,z):number { this.x = y; - var u = new Foo(\"...\").qux(); + var u = new Foo(\\"...\\").qux(); var v = new Bar(y); v.self = v; return v.bar(z,u); @@ -72,8 +74,8 @@ module.exports = Foo; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule Foo */ -var Bar = require(\"Bar\"); -var Qux = require(\"Qux\"); +var Bar = require(\\"Bar\\"); +var Qux = require(\\"Qux\\"); class Foo extends Qux { x: string; @@ -83,7 +85,7 @@ class Foo extends Qux { foo(y: string, z): number { this.x = y; - var u = new Foo(\"...\").qux(); + var u = new Foo(\\"...\\").qux(); var v = new Bar(y); v.self = v; return v.bar(z, u); @@ -98,7 +100,7 @@ module.exports = Foo; " `; -exports[`test Qux.js 1`] = ` +exports[`Qux.js 1`] = ` " /* @providesModule Qux */ diff --git a/tests/flow/more_generics/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_generics/__snapshots__/jsfmt.spec.js.snap index 6540e6e8e..723c1b20b 100644 --- a/tests/flow/more_generics/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/more_generics/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test poly.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`poly.js 1`] = ` "var foo1 = function(x:T):T { return x; } function foo2(x:T):S { return x; } diff --git a/tests/flow/more_path/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_path/__snapshots__/jsfmt.spec.js.snap index 3e7301687..1e5eca434 100644 --- a/tests/flow/more_path/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/more_path/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test Condition.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Condition.js 1`] = ` "/* @providesModule Condition */ function f(x:number) { } -function g() { return (42 || \"hello\"); } +function g() { return (42 || \\"hello\\"); } var x = g(); -if (typeof x === \"string\") { +if (typeof x === \\"string\\") { x = 0; } f(x); @@ -25,7 +27,7 @@ class C { qux() { } } function foo() { - var c = \"...\"; + var c = \\"...\\"; c = new C(); if (bar()) { c.qux(); @@ -35,20 +37,20 @@ function foo() { function goofy() { var x = g(); - if (typeof x == \'function\') { + if (typeof x == 'function') { x(); - } else { // if (typeof x == \'number\') { + } else { // if (typeof x == 'number') { //f(x); } } function goofy2() { var o = {x : 0} - if (typeof o.x == \'function\') { + if (typeof o.x == 'function') { o.x(); } var y = o.x; - if (typeof y == \'function\') { + if (typeof y == 'function') { y(); } else { //f(y); @@ -61,11 +63,11 @@ module.exports = true; function f(x: number) {} function g() { - return 42 || \"hello\"; + return 42 || \\"hello\\"; } var x = g(); -if (typeof x === \"string\") { +if (typeof x === \\"string\\") { x = 0; } f(x); @@ -90,7 +92,7 @@ class C { } function foo() { - var c = \"...\"; + var c = \\"...\\"; c = new C(); if (bar()) { c.qux(); @@ -99,21 +101,21 @@ function foo() { function goofy() { var x = g(); - if (typeof x == \"function\") { + if (typeof x == \\"function\\") { x(); } else { - // if (typeof x == \'number\') { + // if (typeof x == 'number') { //f(x); } } function goofy2() { var o = { x: 0 }; - if (typeof o.x == \"function\") { + if (typeof o.x == \\"function\\") { o.x(); } var y = o.x; - if (typeof y == \"function\") { + if (typeof y == \\"function\\") { y(); } else { //f(y); @@ -124,7 +126,7 @@ module.exports = true; " `; -exports[`test FlowSA.js 1`] = ` +exports[`FlowSA.js 1`] = ` " /* @providesModule FlowSA */ @@ -132,7 +134,7 @@ function check(x:string) { } function FlowSA() { var x = 0; - x = \"...\"; + x = \\"...\\"; check(x); } @@ -144,7 +146,7 @@ function check(x: string) {} function FlowSA() { var x = 0; - x = \"...\"; + x = \\"...\\"; check(x); } @@ -152,7 +154,7 @@ module.exports = FlowSA; " `; -exports[`test Sigma.js 1`] = ` +exports[`Sigma.js 1`] = ` " /* @providesModule Sigma */ @@ -188,11 +190,11 @@ class D { d() {} } function baz(x:D) { if (x instanceof A) { - // unreachable, TODO: this shouldn\'t throw + // unreachable, TODO: this shouldn't throw } } -module.exports = \"sigma\"; +module.exports = \\"sigma\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule Sigma */ @@ -235,15 +237,15 @@ class D { function baz(x: D) { if (x instanceof A) { - // unreachable, TODO: this shouldn\'t throw + // unreachable, TODO: this shouldn't throw } } -module.exports = \"sigma\"; +module.exports = \\"sigma\\"; " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "class BaseClass { baseProp: string; } diff --git a/tests/flow/more_react/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_react/__snapshots__/jsfmt.spec.js.snap index e567f9ae1..5b38a680e 100644 --- a/tests/flow/more_react/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/more_react/__snapshots__/jsfmt.spec.js.snap @@ -1,31 +1,33 @@ -exports[`test API.react.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`API.react.js 1`] = ` " -var app = require(\'JSX\'); +var app = require('JSX'); app.setProps({y:42}); // error, y:number but foo expects string in App.react app.setState({z:42}); // error, z:number but foo expects string in App.react function bar(x:number) { } -bar(app.props.children); // No error, App doesn\'t specify propTypes so anything goes +bar(app.props.children); // No error, App doesn't specify propTypes so anything goes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var app = require(\"JSX\"); +var app = require(\\"JSX\\"); app.setProps({ y: 42 }); // error, y:number but foo expects string in App.react app.setState({ z: 42 }); // error, z:number but foo expects string in App.react function bar(x: number) {} -bar(app.props.children); // No error, App doesn\'t specify propTypes so anything goes +bar(app.props.children); // No error, App doesn't specify propTypes so anything goes " `; -exports[`test App.react.js 1`] = ` +exports[`App.react.js 1`] = ` " /** * @providesModule App.react * @jsx React.DOM */ -var React = require(\'react\'); +var React = require('react'); // expect args to be strings function foo(p:string,q:string):string { return p+q; } @@ -33,7 +35,7 @@ function foo(p:string,q:string):string { return p+q; } var App = React.createClass({ getDefaultProps: function(): { y: string } { - return {y:\"\"}; // infer props.y: string + return {y:\\"\\"}; // infer props.y: string }, getInitialState: function() { @@ -68,7 +70,7 @@ module.exports = App; * @jsx React.DOM */ -var React = require(\"react\"); +var React = require(\\"react\\"); // expect args to be strings function foo(p: string, q: string): string { @@ -77,7 +79,7 @@ function foo(p: string, q: string): string { var App = React.createClass({ getDefaultProps: function(): { y: string } { - return { y: \"\" }; // infer props.y: string + return { y: \\"\\" }; // infer props.y: string }, getInitialState: function() { @@ -108,12 +110,12 @@ module.exports = App; " `; -exports[`test JSX.js 1`] = ` +exports[`JSX.js 1`] = ` " /* @providesModule JSX */ -var React = require(\'react\'); -var App = require(\'App.react\'); +var React = require('react'); +var App = require('App.react'); var app = // error, y: number but foo expects string in App.react @@ -124,12 +126,12 @@ module.exports = app; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule JSX */ -var React = require(\"react\"); -var App = require(\"App.react\"); +var React = require(\\"react\\"); +var App = require(\\"App.react\\"); var app = ( - {\" \"}// error, y: number but foo expects string in App.react + {\\" \\"}// error, y: number but foo expects string in App.react Some text. ); @@ -138,8 +140,8 @@ module.exports = app; " `; -exports[`test propTypes.js 1`] = ` -"var React = require(\'React\'); +exports[`propTypes.js 1`] = ` +"var React = require('React'); var C = React.createClass({ propTypes: { @@ -154,11 +156,11 @@ var D = React.createClass({ }); ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"React\"); +var React = require(\\"React\\"); var C = React.createClass({ propTypes: { @@ -173,8 +175,8 @@ var D = React.createClass({ }); ; " `; diff --git a/tests/flow/more_statics/__snapshots__/jsfmt.spec.js.snap b/tests/flow/more_statics/__snapshots__/jsfmt.spec.js.snap index fda3bfa84..9a4ec6d6a 100644 --- a/tests/flow/more_statics/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/more_statics/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test class_static.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class_static.js 1`] = ` "class B { - static foo(): string { return \"\"; } + static foo(): string { return \\"\\"; } } class C extends B { - static bar(): string { return \"\"; } + static bar(): string { return \\"\\"; } } var x: number = C.bar(); @@ -12,13 +14,13 @@ var y: number = C.foo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class B { static foo(): string { - return \"\"; + return \\"\\"; } } class C extends B { static bar(): string { - return \"\"; + return \\"\\"; } } diff --git a/tests/flow/name_prop/__snapshots__/jsfmt.spec.js.snap b/tests/flow/name_prop/__snapshots__/jsfmt.spec.js.snap index d073de91b..705948456 100644 --- a/tests/flow/name_prop/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/name_prop/__snapshots__/jsfmt.spec.js.snap @@ -1,36 +1,38 @@ -exports[`test class.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class.js 1`] = ` "class A {} -var test1 = A.bar; // Error bar doesn\'t exist +var test1 = A.bar; // Error bar doesn't exist var test2: string = A.name; var test3: number = A.name; // Error string ~> number var a = new A(); -var test4 = a.constructor.bar; // Error bar doesn\'t exist +var test4 = a.constructor.bar; // Error bar doesn't exist var test5: string = a.constructor.name; var test6: number = a.constructor.name; // Error string ~> number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class A {} -var test1 = A.bar; // Error bar doesn\'t exist +var test1 = A.bar; // Error bar doesn't exist var test2: string = A.name; var test3: number = A.name; // Error string ~> number var a = new A(); -var test4 = a.constructor.bar; // Error bar doesn\'t exist +var test4 = a.constructor.bar; // Error bar doesn't exist var test5: string = a.constructor.name; var test6: number = a.constructor.name; // Error string ~> number " `; -exports[`test function.js 1`] = ` -"/* TODO - we currently say that a function\'s statics are an AnyObjT and - * anything goes. When we start enforcing the statics properly, we\'ll need to +exports[`function.js 1`] = ` +"/* TODO - we currently say that a function's statics are an AnyObjT and + * anything goes. When we start enforcing the statics properly, we'll need to * know that .name exists */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/* TODO - we currently say that a function\'s statics are an AnyObjT and - * anything goes. When we start enforcing the statics properly, we\'ll need to +/* TODO - we currently say that a function's statics are an AnyObjT and + * anything goes. When we start enforcing the statics properly, we'll need to * know that .name exists */ " diff --git a/tests/flow/namespace/__snapshots__/jsfmt.spec.js.snap b/tests/flow/namespace/__snapshots__/jsfmt.spec.js.snap index 5da9f0242..3459fd94e 100644 --- a/tests/flow/namespace/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/namespace/__snapshots__/jsfmt.spec.js.snap @@ -1,16 +1,18 @@ -exports[`test client.js 1`] = ` -"var ns = require(\'./namespace\') +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`client.js 1`] = ` +"var ns = require('./namespace') var bar: string = ns.foo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var ns = require(\"./namespace\"); +var ns = require(\\"./namespace\\"); var bar: string = ns.foo; " `; -exports[`test namespace.js 1`] = ` -"/*@flow*/// import type { T } from \'...\' +exports[`namespace.js 1`] = ` +"/*@flow*/// import type { T } from '...' type T = (x:number) => void; var f: T = function(x:string): void { } @@ -20,15 +22,15 @@ function bar(x:U, f:Map): V { return f(x); } -var y:number = bar(0, x => \"\"); +var y:number = bar(0, x => \\"\\"); type Seq = number | Array; var s1:Seq = [0,[0]]; -var s2:Seq = [[\"\"]]; +var s2:Seq = [[\\"\\"]]; -module.exports = { foo: (\"\": number) }; +module.exports = { foo: (\\"\\": number) }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/*@flow*/ // import type { T } from \'...\' +/*@flow*/ // import type { T } from '...' type T = (x: number) => void; var f: T = function(x: string): void {}; @@ -38,12 +40,12 @@ function bar(x: U, f: Map): V { return f(x); } -var y: number = bar(0, x => \"\"); +var y: number = bar(0, x => \\"\\"); type Seq = number | Array; var s1: Seq = [0, [0]]; -var s2: Seq = [[\"\"]]; +var s2: Seq = [[\\"\\"]]; -module.exports = { foo: (\"\": number) }; +module.exports = { foo: (\\"\\": number) }; " `; diff --git a/tests/flow/new_react/__snapshots__/jsfmt.spec.js.snap b/tests/flow/new_react/__snapshots__/jsfmt.spec.js.snap index 9af52af8d..65f22f8fe 100644 --- a/tests/flow/new_react/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/new_react/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test FeedUFI.react.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FeedUFI.react.js 1`] = ` "/** * Copyright 2004-present Facebook. All Rights Reserved. * @@ -6,28 +8,28 @@ exports[`test FeedUFI.react.js 1`] = ` * @flow */ -\'use strict\'; +'use strict'; -var UFILikeCount = require(\'UFILikeCount.react\'); -var React = require(\'react\'); +var UFILikeCount = require('UFILikeCount.react'); +var React = require('react'); var FeedUFI = React.createClass({ _renderLikeCount: function( feedback: any ) { var props = { - className: \"\", - key: \"\", + className: \\"\\", + key: \\"\\", feedback: {feedback}, - permalink: \"\", + permalink: \\"\\", }; var ignored = ; return ( ); }, @@ -49,22 +51,22 @@ module.exports = FeedUFI; * @flow */ -\"use strict\"; +\\"use strict\\"; -var UFILikeCount = require(\"UFILikeCount.react\"); -var React = require(\"react\"); +var UFILikeCount = require(\\"UFILikeCount.react\\"); +var React = require(\\"react\\"); var FeedUFI = React.createClass({ _renderLikeCount: function(feedback: any) { var props = { - className: \"\", - key: \"\", + className: \\"\\", + key: \\"\\", feedback: { feedback }, - permalink: \"\" + permalink: \\"\\" }; var ignored = ; return ( - + ); }, @@ -77,7 +79,7 @@ module.exports = FeedUFI; " `; -exports[`test Mixin.js 1`] = ` +exports[`Mixin.js 1`] = ` "/* @providesModule Mixin */ module.exports = { success: function() { } @@ -90,7 +92,7 @@ module.exports = { " `; -exports[`test UFILikeCount.react.js 1`] = ` +exports[`UFILikeCount.react.js 1`] = ` "/** * Copyright 2004-present Facebook. All Rights Reserved. * @@ -98,9 +100,9 @@ exports[`test UFILikeCount.react.js 1`] = ` * @flow */ -\'use strict\'; +'use strict'; -var React = require(\'react\'); +var React = require('react'); var UFILikeCount = React.createClass({ propTypes: { @@ -122,9 +124,9 @@ module.exports = UFILikeCount; * @flow */ -\"use strict\"; +\\"use strict\\"; -var React = require(\"react\"); +var React = require(\\"react\\"); var UFILikeCount = React.createClass({ propTypes: { @@ -141,8 +143,8 @@ module.exports = UFILikeCount; " `; -exports[`test bad_default_props.js 1`] = ` -"var React = require(\'React\'); +exports[`bad_default_props.js 1`] = ` +"var React = require('React'); type T1 = { } type T2 = { x: number } @@ -173,7 +175,7 @@ class C6 extends React.Component { // OK, recommended props: T3; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"React\"); +var React = require(\\"React\\"); type T1 = {}; type T2 = { x: number }; @@ -212,8 +214,8 @@ class C6 extends React.Component { " `; -exports[`test classes.js 1`] = ` -"var React = require(\'React\'); +exports[`classes.js 1`] = ` +"var React = require('React'); type DefaultProps = { }; type Props = { x: number }; @@ -234,7 +236,7 @@ class Foo extends React.Component { constructor(props) { super(props); - this.state = { y: \"\" }; + this.state = { y: \\"\\" }; } setState(o: { y_: string }): void { } @@ -275,7 +277,7 @@ var FooLegacy = React.createClass({ }, getInitialState(): { y: string } { - return { y: \"\" }; + return { y: \\"\\" }; }, setState(o: { y_: string }): void { }, @@ -297,7 +299,7 @@ var foo_legacy: $jsx = ; FooLegacy.bar(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"React\"); +var React = require(\\"React\\"); type DefaultProps = {}; type Props = { x: number }; @@ -318,7 +320,7 @@ class Foo extends React.Component { constructor(props) { super(props); - this.state = { y: \"\" }; + this.state = { y: \\"\\" }; } setState(o: { y_: string }): void {} @@ -356,7 +358,7 @@ var FooLegacy = React.createClass({ }, getInitialState(): { y: string } { - return { y: \"\" }; + return { y: \\"\\" }; }, setState(o: { y_: string }): void {}, @@ -377,52 +379,52 @@ FooLegacy.bar(); " `; -exports[`test import-react.js 1`] = ` +exports[`import-react.js 1`] = ` "/* @flow */ // Testing local binding of React in all kinds of ways. The only reason this // might even be an issue is that internally, the use of JSX triggers an -// implicit require(\'react\'), so any bugs in (1) interop of CJS require and ES6 -// import (2) module re-export, as used to redirect the module name \'React\' to -// \'react\' might show up here. +// implicit require('react'), so any bugs in (1) interop of CJS require and ES6 +// import (2) module re-export, as used to redirect the module name 'React' to +// 'react' might show up here. -import React from \"react\"; -//import React from \"React\"; -//var React = require(\"react\"); -//var React = require(\"React\"); +import React from \\"react\\"; +//import React from \\"React\\"; +//var React = require(\\"react\\"); +//var React = require(\\"React\\"); class HelloMessage extends React.Component { props: { name: string }; } ; // number ~/~> string error -; // ok +; // ok ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ // Testing local binding of React in all kinds of ways. The only reason this // might even be an issue is that internally, the use of JSX triggers an -// implicit require(\'react\'), so any bugs in (1) interop of CJS require and ES6 -// import (2) module re-export, as used to redirect the module name \'React\' to -// \'react\' might show up here. +// implicit require('react'), so any bugs in (1) interop of CJS require and ES6 +// import (2) module re-export, as used to redirect the module name 'React' to +// 'react' might show up here. -import React from \"react\"; -//import React from \"React\"; -//var React = require(\"react\"); -//var React = require(\"React\"); +import React from \\"react\\"; +//import React from \\"React\\"; +//var React = require(\\"react\\"); +//var React = require(\\"React\\"); class HelloMessage extends React.Component { props: { name: string }; } ; /* number ~/~> string error*/ -; // ok +; // ok " `; -exports[`test new_react.js 1`] = ` -"var React = require(\'react\'); -var Mixin = require(\'Mixin\'); +exports[`new_react.js 1`] = ` +"var React = require('react'); +var Mixin = require('Mixin'); var C = React.createClass({ mixins: [Mixin], propTypes: { @@ -454,8 +456,8 @@ var element_ = ; var x: number = C.displayName; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"react\"); -var Mixin = require(\"Mixin\"); +var React = require(\\"react\\"); +var Mixin = require(\\"Mixin\\"); var C = React.createClass({ mixins: [Mixin], propTypes: { @@ -490,8 +492,8 @@ var x: number = C.displayName; " `; -exports[`test propTypes.js 1`] = ` -"var React = require(\'react\'); +exports[`propTypes.js 1`] = ` +"var React = require('react'); var PropTypes = React.PropTypes; var C = React.createClass({ @@ -505,15 +507,15 @@ var C = React.createClass({ ; // error (label is required, value not required) var props: Array<{label: string, value?: number}> = [ {}, - {label:\"\",value:undefined}, + {label:\\"\\",value:undefined}, ]; // error (same as ^) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"react\"); +var React = require(\\"react\\"); var PropTypes = React.PropTypes; var C = React.createClass({ @@ -527,17 +529,17 @@ var C = React.createClass({ } }); -; // error (label is required, value not required) +; // error (label is required, value not required) var props: Array<{ label: string, value?: number }> = [ {}, - { label: \"\", value: undefined } + { label: \\"\\", value: undefined } ]; // error (same as ^) " `; -exports[`test props.js 1`] = ` -"var React = require(\'react\'); +exports[`props.js 1`] = ` +"var React = require('react'); var TestProps = React.createClass({ propTypes: { @@ -546,7 +548,7 @@ var TestProps = React.createClass({ }, getDefaultProps: function() { - return {x: \'\', y: 0} + return {x: '', y: 0} }, test: function() { @@ -565,7 +567,7 @@ var FooProps = React.createClass({ }); (element: $jsx); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"react\"); +var React = require(\\"react\\"); var TestProps = React.createClass({ propTypes: { x: React.PropTypes.string, @@ -573,7 +575,7 @@ var TestProps = React.createClass({ }, getDefaultProps: function() { - return { x: \"\", y: 0 }; + return { x: \\"\\", y: 0 }; }, test: function() { @@ -594,8 +596,8 @@ var FooProps = React.createClass({ " `; -exports[`test props2.js 1`] = ` -"var React = require(\'react\'); +exports[`props2.js 1`] = ` +"var React = require('react'); var C = React.createClass({ propTypes: { foo: React.PropTypes.string.isRequired, @@ -613,7 +615,7 @@ var D = React.createClass({ } }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"react\"); +var React = require(\\"react\\"); var C = React.createClass({ propTypes: { foo: React.PropTypes.string.isRequired, @@ -633,8 +635,8 @@ var D = React.createClass({ " `; -exports[`test props3.js 1`] = ` -"var React = require(\'react\'); +exports[`props3.js 1`] = ` +"var React = require('react'); var TestProps = React.createClass({ // Do something illegal inside of propTypes and make sure Flow notices propTypes: { @@ -664,8 +666,8 @@ var TestProps = React.createClass({ instanceOf_rec: React.PropTypes.instanceOf(Object).isRequired, objectOf: React.PropTypes.objectOf(React.PropTypes.string), objectOf_rec: React.PropTypes.objectOf(React.PropTypes.string).isRequired, - oneOf: React.PropTypes.oneOf([\"yes\", \"no\"]), - oneOf_rec: React.PropTypes.oneOf([\"yes\", \"no\"]).isRequired, + oneOf: React.PropTypes.oneOf([\\"yes\\", \\"no\\"]), + oneOf_rec: React.PropTypes.oneOf([\\"yes\\", \\"no\\"]).isRequired, oneOfType: React.PropTypes.oneOfType( [React.PropTypes.string, React.PropTypes.number] ), @@ -687,7 +689,7 @@ var TestProps = React.createClass({ }, }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"react\"); +var React = require(\\"react\\"); var TestProps = React.createClass({ // Do something illegal inside of propTypes and make sure Flow notices propTypes: { @@ -717,8 +719,8 @@ var TestProps = React.createClass({ instanceOf_rec: React.PropTypes.instanceOf(Object).isRequired, objectOf: React.PropTypes.objectOf(React.PropTypes.string), objectOf_rec: React.PropTypes.objectOf(React.PropTypes.string).isRequired, - oneOf: React.PropTypes.oneOf([\"yes\", \"no\"]), - oneOf_rec: React.PropTypes.oneOf([\"yes\", \"no\"]).isRequired, + oneOf: React.PropTypes.oneOf([\\"yes\\", \\"no\\"]), + oneOf_rec: React.PropTypes.oneOf([\\"yes\\", \\"no\\"]).isRequired, oneOfType: React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.number @@ -744,10 +746,10 @@ var TestProps = React.createClass({ " `; -exports[`test props4.js 1`] = ` +exports[`props4.js 1`] = ` "// @flow -import React from \"React\"; +import React from \\"React\\"; class JDiv extends React.Component { // static defaultProps: { }; @@ -756,7 +758,7 @@ class JDiv extends React.Component { }; } -// Should be a type error (\'id\' takes a string, not a number..) +// Should be a type error ('id' takes a string, not a number..) ; class Example extends React.Component { @@ -768,13 +770,13 @@ class Example extends React.Component { } React.render( - , + , document.body ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import React from \"React\"; +import React from \\"React\\"; class JDiv extends React.Component { // static defaultProps: { }; @@ -783,7 +785,7 @@ class JDiv extends React.Component { }; } -/* Should be a type error (\'id\' takes a string, not a number..)*/ +/* Should be a type error ('id' takes a string, not a number..)*/ ; class Example extends React.Component { @@ -794,12 +796,12 @@ class Example extends React.Component { } } -React.render(, document.body); +React.render(, document.body); " `; -exports[`test props5.js 1`] = ` -"var React = require(\'React\'); +exports[`props5.js 1`] = ` +"var React = require('React'); var C = React.createClass({ getDefaultProps: function() { @@ -809,7 +811,7 @@ var C = React.createClass({ module.exports = C; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"React\"); +var React = require(\\"React\\"); var C = React.createClass({ getDefaultProps: function() { @@ -821,10 +823,10 @@ module.exports = C; " `; -exports[`test state.js 1`] = ` +exports[`state.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); type State = { bar: ?{ qux: string; }; @@ -848,7 +850,7 @@ var ReactClass = React.createClass({ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); type State = { bar: ?{ qux: string } @@ -872,10 +874,10 @@ var ReactClass = React.createClass({ " `; -exports[`test state2.js 1`] = ` +exports[`state2.js 1`] = ` "// @flow -var React = require(\'react\'); +var React = require('react'); type FooState = { key: ?Object; @@ -893,7 +895,7 @@ module.exports = Comp; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var React = require(\"react\"); +var React = require(\\"react\\"); type FooState = { key: ?Object @@ -911,13 +913,13 @@ module.exports = Comp; " `; -exports[`test state3.js 1`] = ` -"var React = require(\'react\'); +exports[`state3.js 1`] = ` +"var React = require('react'); var TestState = React.createClass({ getInitialState: function(): { x: string; } { return { - x: \'\' + x: '' } }, @@ -931,11 +933,11 @@ var TestState = React.createClass({ }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"react\"); +var React = require(\\"react\\"); var TestState = React.createClass({ getInitialState: function(): { x: string } { return { - x: \"\" + x: \\"\\" }; }, @@ -950,8 +952,8 @@ var TestState = React.createClass({ " `; -exports[`test state4.js 1`] = ` -"var React = require(\'React\'); +exports[`state4.js 1`] = ` +"var React = require('React'); var C = React.createClass({ getInitialState: function() { @@ -965,7 +967,7 @@ var C = React.createClass({ }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"React\"); +var React = require(\\"React\\"); var C = React.createClass({ getInitialState: function() { @@ -980,8 +982,8 @@ var C = React.createClass({ " `; -exports[`test state5.js 1`] = ` -"var React = require(\'React\'); +exports[`state5.js 1`] = ` +"var React = require('React'); class C extends React.Component { foo(): number { @@ -989,7 +991,7 @@ class C extends React.Component { } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"React\"); +var React = require(\\"React\\"); class C extends React.Component { foo(): number { diff --git a/tests/flow/new_react/fakelib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/new_react/fakelib/__snapshots__/jsfmt.spec.js.snap index 386be1228..082a01c6c 100644 --- a/tests/flow/new_react/fakelib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/new_react/fakelib/__snapshots__/jsfmt.spec.js.snap @@ -1,12 +1,14 @@ -exports[`test type_aliases.js 1`] = ` -"declare var $React: $Exports<\'react\'>; // fake import +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type_aliases.js 1`] = ` +"declare var $React: $Exports<'react'>; // fake import // Strawman: revised definition of $jsx (alternatively, React.Element). // Using bounded poly to specify a constraint on a type parameter, and // existentials to elide type arguments. type _ReactElement, C: $React.Component> = $React.Element; type $jsx = _ReactElement<*, *, *, C>; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -declare var $React: $Exports<\"react\">; // fake import +declare var $React: $Exports<\\"react\\">; // fake import // Strawman: revised definition of $jsx (alternatively, React.Element). // Using bounded poly to specify a constraint on a type parameter, and // existentials to elide type arguments. diff --git a/tests/flow/node_haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_haste/__snapshots__/jsfmt.spec.js.snap index 760de36ab..759c21638 100644 --- a/tests/flow/node_haste/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_haste/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test client.js 1`] = ` -"var md5 = require(\'./md5\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`client.js 1`] = ` +"var md5 = require('./md5'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var md5 = require(\"./md5\"); +var md5 = require(\\"./md5\\"); " `; -exports[`test md5.js 1`] = ` +exports[`md5.js 1`] = ` "/* @providesModule md5 */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @providesModule md5 */ diff --git a/tests/flow/node_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap index f4edecce9..b11a700fa 100644 --- a/tests/flow/node_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_haste/external/_d3/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test min.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`min.js 1`] = ` "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " `; diff --git a/tests/flow/node_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap index f0e480a5a..e8efa1c65 100644 --- a/tests/flow/node_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_haste/foo/bar/__snapshots__/jsfmt.spec.js.snap @@ -1,18 +1,20 @@ -exports[`test client.js 1`] = ` -"var docblock = require(\'qux/docblock\'); -var min = require(\'d3/min.js\'); -var corge = require(\'qux/corge\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP -// make sure we don\'t pick up non-header @providesModule +exports[`client.js 1`] = ` +"var docblock = require('qux/docblock'); +var min = require('d3/min.js'); +var corge = require('qux/corge'); + +// make sure we don't pick up non-header @providesModule // annotations - see node_modules/qux/docblock.js -var unreachable = require(\'annotation\'); +var unreachable = require('annotation'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var docblock = require(\"qux/docblock\"); -var min = require(\"d3/min.js\"); -var corge = require(\"qux/corge\"); +var docblock = require(\\"qux/docblock\\"); +var min = require(\\"d3/min.js\\"); +var corge = require(\\"qux/corge\\"); -// make sure we don\'t pick up non-header @providesModule +// make sure we don't pick up non-header @providesModule // annotations - see node_modules/qux/docblock.js -var unreachable = require(\"annotation\"); +var unreachable = require(\\"annotation\\"); " `; diff --git a/tests/flow/node_haste/ws/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_haste/ws/__snapshots__/jsfmt.spec.js.snap index b53884808..3959b3ee8 100644 --- a/tests/flow/node_haste/ws/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_haste/ws/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test index.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`index.js 1`] = ` "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " `; diff --git a/tests/flow/node_haste/ws/test/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_haste/ws/test/__snapshots__/jsfmt.spec.js.snap index 188da2625..551421890 100644 --- a/tests/flow/node_haste/ws/test/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_haste/ws/test/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test client.js 1`] = ` -"var ws = require(\'../\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`client.js 1`] = ` +"var ws = require('../'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var ws = require(\"../\"); +var ws = require(\\"../\\"); " `; diff --git a/tests/flow/node_modules_with_symlinks/root/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_modules_with_symlinks/root/__snapshots__/jsfmt.spec.js.snap index 20acb26b0..3320a0505 100644 --- a/tests/flow/node_modules_with_symlinks/root/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_modules_with_symlinks/root/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test foo.js 1`] = ` -"var x = require(\'symlink_lib\'); -var y = require(\'symlink_lib_outside_root\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` +"var x = require('symlink_lib'); +var y = require('symlink_lib_outside_root'); console.log(x); console.log(y); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"symlink_lib\"); -var y = require(\"symlink_lib_outside_root\"); +var x = require(\\"symlink_lib\\"); +var y = require(\\"symlink_lib_outside_root\\"); console.log(x); console.log(y); " diff --git a/tests/flow/node_modules_with_symlinks/root/symlink_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_modules_with_symlinks/root/symlink_lib/__snapshots__/jsfmt.spec.js.snap index 249784041..78c3adac8 100644 --- a/tests/flow/node_modules_with_symlinks/root/symlink_lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_modules_with_symlinks/root/symlink_lib/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test index.js 1`] = ` -"module.exports = { bar: \"bar\" }; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`index.js 1`] = ` +"module.exports = { bar: \\"bar\\" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = { bar: \"bar\" }; +module.exports = { bar: \\"bar\\" }; " `; diff --git a/tests/flow/node_modules_with_symlinks/symlink_lib_outside_root/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_modules_with_symlinks/symlink_lib_outside_root/__snapshots__/jsfmt.spec.js.snap index 249784041..78c3adac8 100644 --- a/tests/flow/node_modules_with_symlinks/symlink_lib_outside_root/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_modules_with_symlinks/symlink_lib_outside_root/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test index.js 1`] = ` -"module.exports = { bar: \"bar\" }; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`index.js 1`] = ` +"module.exports = { bar: \\"bar\\" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = { bar: \"bar\" }; +module.exports = { bar: \\"bar\\" }; " `; diff --git a/tests/flow/node_modules_without_json/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_modules_without_json/__snapshots__/jsfmt.spec.js.snap index e8e1a1874..a58cb5f20 100644 --- a/tests/flow/node_modules_without_json/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_modules_without_json/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "// @flow -let foo = require(\'foo\'); +let foo = require('foo'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -let foo = require(\"foo\"); +let foo = require(\\"foo\\"); " `; diff --git a/tests/flow/node_tests/assert/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/assert/__snapshots__/jsfmt.spec.js.snap index a24f64937..978f1d31a 100644 --- a/tests/flow/node_tests/assert/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/assert/__snapshots__/jsfmt.spec.js.snap @@ -1,13 +1,15 @@ -exports[`test assert.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`assert.js 1`] = ` "/* @flow */ -var assert = require(\"assert\") +var assert = require(\\"assert\\") assert(true) // ok assert.ok(true) // ok ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var assert = require(\"assert\"); +var assert = require(\\"assert\\"); assert(true); // ok assert.ok(true); // ok " diff --git a/tests/flow/node_tests/basic/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic/__snapshots__/jsfmt.spec.js.snap index da8e1cb67..536a7b06f 100644 --- a/tests/flow/node_tests/basic/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/basic/__snapshots__/jsfmt.spec.js.snap @@ -1,15 +1,17 @@ -exports[`test bar.js 1`] = ` -"module.exports = \"bar\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bar.js 1`] = ` +"module.exports = \\"bar\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = \"bar\"; +module.exports = \\"bar\\"; " `; -exports[`test foo.js 1`] = ` -"var x = require(\'./bar.js\'); +exports[`foo.js 1`] = ` +"var x = require('./bar.js'); console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"./bar.js\"); +var x = require(\\"./bar.js\\"); console.log(x); " `; diff --git a/tests/flow/node_tests/basic_file/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic_file/__snapshots__/jsfmt.spec.js.snap index cfa42aa79..3852de7d4 100644 --- a/tests/flow/node_tests/basic_file/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/basic_file/__snapshots__/jsfmt.spec.js.snap @@ -1,15 +1,17 @@ -exports[`test bar.js 1`] = ` -"module.exports = \"bar\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bar.js 1`] = ` +"module.exports = \\"bar\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = \"bar\"; +module.exports = \\"bar\\"; " `; -exports[`test foo.js 1`] = ` -"var x = require(\'./bar\'); // bar.js does not work +exports[`foo.js 1`] = ` +"var x = require('./bar'); // bar.js does not work console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"./bar\"); // bar.js does not work +var x = require(\\"./bar\\"); // bar.js does not work console.log(x); " `; diff --git a/tests/flow/node_tests/basic_node_modules/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic_node_modules/__snapshots__/jsfmt.spec.js.snap index 4caf098ae..f761168d7 100644 --- a/tests/flow/node_tests/basic_node_modules/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/basic_node_modules/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test foo.js 1`] = ` -"var x = require(\'bar.js\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` +"var x = require('bar.js'); console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"bar.js\"); +var x = require(\\"bar.js\\"); console.log(x); " `; diff --git a/tests/flow/node_tests/basic_node_modules_with_path/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic_node_modules_with_path/__snapshots__/jsfmt.spec.js.snap index 68209ae16..4900c86d4 100644 --- a/tests/flow/node_tests/basic_node_modules_with_path/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/basic_node_modules_with_path/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test foo.js 1`] = ` -"var x = require(\'bar_lib/bar\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` +"var x = require('bar_lib/bar'); console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"bar_lib/bar\"); +var x = require(\\"bar_lib/bar\\"); console.log(x); " `; diff --git a/tests/flow/node_tests/basic_package/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic_package/__snapshots__/jsfmt.spec.js.snap index 68d3d5387..7bd83213b 100644 --- a/tests/flow/node_tests/basic_package/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/basic_package/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test foo.js 1`] = ` -"var x = require(\'./bar_lib\'); // \'bar_lib\' does not work! +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` +"var x = require('./bar_lib'); // 'bar_lib' does not work! console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"./bar_lib\"); // \'bar_lib\' does not work! +var x = require(\\"./bar_lib\\"); // 'bar_lib' does not work! console.log(x); " `; diff --git a/tests/flow/node_tests/basic_package/bar_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/basic_package/bar_lib/__snapshots__/jsfmt.spec.js.snap index f8677ae20..e8f131d2f 100644 --- a/tests/flow/node_tests/basic_package/bar_lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/basic_package/bar_lib/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test bar.js 1`] = ` -"module.exports = \"bar\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bar.js 1`] = ` +"module.exports = \\"bar\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = \"bar\"; +module.exports = \\"bar\\"; " `; diff --git a/tests/flow/node_tests/buffer/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/buffer/__snapshots__/jsfmt.spec.js.snap index 9cf18fa99..6f408435e 100644 --- a/tests/flow/node_tests/buffer/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/buffer/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test buffer.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`buffer.js 1`] = ` "/* @flow */ let bool: boolean = false; @@ -24,10 +26,10 @@ bool = buffer.every((element: number) => false, buffer); buffer = buffer.fill(1); buffer = buffer.fill(1, 0, 0); -buffer = buffer.fill(\"a\"); -buffer = buffer.fill(\"a\", 0, 0); -buffer = buffer.fill(\"a\", 0, 0, \"utf8\"); -buffer = buffer.fill(\"a\", \"utf8\"); +buffer = buffer.fill(\\"a\\"); +buffer = buffer.fill(\\"a\\", 0, 0); +buffer = buffer.fill(\\"a\\", 0, 0, \\"utf8\\"); +buffer = buffer.fill(\\"a\\", \\"utf8\\"); maybeNum = buffer.find((element: number, index: number, array:Uint8Array) => false); maybeNum = buffer.find((element: number, index: number, array:Uint8Array) => false, buffer); @@ -49,13 +51,13 @@ buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); const typedArray = new Uint8Array([0x34]); buffer = Buffer.from(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); buffer = Buffer.from(new Buffer(0)); -buffer = Buffer.from(\"foo\", \"utf8\"); +buffer = Buffer.from(\\"foo\\", \\"utf8\\"); // This call to from() does type check ok, but should not. Unfortunately, Buffer // extends Uint8Array but gets rid of this signature to .from(). Understandably, -// flow doesn\'t support a subclass hiding a superclass member, so this checks out as +// flow doesn't support a subclass hiding a superclass member, so this checks out as // ok, even though it is not correct. -buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72], (a:number) => a + 1, {}); // should error but doesn\'t +buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72], (a:number) => a + 1, {}); // should error but doesn't ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -82,10 +84,10 @@ bool = buffer.every((element: number) => false, buffer); buffer = buffer.fill(1); buffer = buffer.fill(1, 0, 0); -buffer = buffer.fill(\"a\"); -buffer = buffer.fill(\"a\", 0, 0); -buffer = buffer.fill(\"a\", 0, 0, \"utf8\"); -buffer = buffer.fill(\"a\", \"utf8\"); +buffer = buffer.fill(\\"a\\"); +buffer = buffer.fill(\\"a\\", 0, 0); +buffer = buffer.fill(\\"a\\", 0, 0, \\"utf8\\"); +buffer = buffer.fill(\\"a\\", \\"utf8\\"); maybeNum = buffer.find( (element: number, index: number, array: Uint8Array) => false @@ -124,16 +126,16 @@ buffer = Buffer.from( typedArray.byteLength ); buffer = Buffer.from(new Buffer(0)); -buffer = Buffer.from(\"foo\", \"utf8\"); +buffer = Buffer.from(\\"foo\\", \\"utf8\\"); // This call to from() does type check ok, but should not. Unfortunately, Buffer // extends Uint8Array but gets rid of this signature to .from(). Understandably, -// flow doesn\'t support a subclass hiding a superclass member, so this checks out as +// flow doesn't support a subclass hiding a superclass member, so this checks out as // ok, even though it is not correct. buffer = Buffer.from( [0x62, 0x75, 0x66, 0x66, 0x65, 0x72], (a: number) => a + 1, {} -); // should error but doesn\'t +); // should error but doesn't " `; diff --git a/tests/flow/node_tests/child_process/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/child_process/__snapshots__/jsfmt.spec.js.snap index 03f1c7be5..965e74e9c 100644 --- a/tests/flow/node_tests/child_process/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/child_process/__snapshots__/jsfmt.spec.js.snap @@ -1,149 +1,151 @@ -exports[`test exec.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`exec.js 1`] = ` "/* @flow */ -var exec = require(\'child_process\').exec; +var exec = require('child_process').exec; // callback only. -exec(\'ls\', function(error, stdout, stderr) { +exec('ls', function(error, stdout, stderr) { console.info(stdout); }); // options only. -exec(\'ls\', {timeout: 250}); +exec('ls', {timeout: 250}); // options + callback. -exec(\'ls\', {maxBuffer: 100}, function(error, stdout, stderr) { +exec('ls', {maxBuffer: 100}, function(error, stdout, stderr) { console.info(stdout); }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var exec = require(\"child_process\").exec; +var exec = require(\\"child_process\\").exec; // callback only. -exec(\"ls\", function(error, stdout, stderr) { +exec(\\"ls\\", function(error, stdout, stderr) { console.info(stdout); }); // options only. -exec(\"ls\", { timeout: 250 }); +exec(\\"ls\\", { timeout: 250 }); // options + callback. -exec(\"ls\", { maxBuffer: 100 }, function(error, stdout, stderr) { +exec(\\"ls\\", { maxBuffer: 100 }, function(error, stdout, stderr) { console.info(stdout); }); " `; -exports[`test execFile.js 1`] = ` +exports[`execFile.js 1`] = ` "/* @flow */ -var execFile = require(\'child_process\').execFile; +var execFile = require('child_process').execFile; // args only. -execFile(\'ls\', [\'-lh\']); +execFile('ls', ['-lh']); // callback only. -execFile(\'ls\', function(error, stdout, stderr) { +execFile('ls', function(error, stdout, stderr) { console.info(stdout); }); // options only. -execFile(\'wc\', {timeout: 250}); +execFile('wc', {timeout: 250}); // args + callback. -execFile(\'ls\', [\'-l\'], function(error, stdout, stderr) { +execFile('ls', ['-l'], function(error, stdout, stderr) { console.info(stdout); }); // args + options. -execFile(\'ls\', [\'-l\'], {timeout: 250}); +execFile('ls', ['-l'], {timeout: 250}); // Put it all together. -execFile(\'ls\', [\'-l\'], {timeout: 250}, function(error, stdout, stderr) { +execFile('ls', ['-l'], {timeout: 250}, function(error, stdout, stderr) { console.info(stdout); }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var execFile = require(\"child_process\").execFile; +var execFile = require(\\"child_process\\").execFile; // args only. -execFile(\"ls\", [\"-lh\"]); +execFile(\\"ls\\", [\\"-lh\\"]); // callback only. -execFile(\"ls\", function(error, stdout, stderr) { +execFile(\\"ls\\", function(error, stdout, stderr) { console.info(stdout); }); // options only. -execFile(\"wc\", { timeout: 250 }); +execFile(\\"wc\\", { timeout: 250 }); // args + callback. -execFile(\"ls\", [\"-l\"], function(error, stdout, stderr) { +execFile(\\"ls\\", [\\"-l\\"], function(error, stdout, stderr) { console.info(stdout); }); // args + options. -execFile(\"ls\", [\"-l\"], { timeout: 250 }); +execFile(\\"ls\\", [\\"-l\\"], { timeout: 250 }); // Put it all together. -execFile(\"ls\", [\"-l\"], { timeout: 250 }, function(error, stdout, stderr) { +execFile(\\"ls\\", [\\"-l\\"], { timeout: 250 }, function(error, stdout, stderr) { console.info(stdout); }); " `; -exports[`test execSync.js 1`] = ` +exports[`execSync.js 1`] = ` "/* @flow */ -var execSync = require(\'child_process\').execSync; +var execSync = require('child_process').execSync; -(execSync(\'ls\'): Buffer); // returns Buffer -(execSync(\'ls\', {encoding: \'buffer\'}): Buffer); // returns Buffer -(execSync(\'ls\', {encoding: \'utf8\'}): string); // returns string -(execSync(\'ls\', {timeout: \'250\'})); // error, no signatures match -(execSync(\'ls\', {stdio: \'inherit\'})); // error, no signatures match -(execSync(\'ls\', {stdio: [\'inherit\']})); // error, no signatures match +(execSync('ls'): Buffer); // returns Buffer +(execSync('ls', {encoding: 'buffer'}): Buffer); // returns Buffer +(execSync('ls', {encoding: 'utf8'}): string); // returns string +(execSync('ls', {timeout: '250'})); // error, no signatures match +(execSync('ls', {stdio: 'inherit'})); // error, no signatures match +(execSync('ls', {stdio: ['inherit']})); // error, no signatures match ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var execSync = require(\"child_process\").execSync; +var execSync = require(\\"child_process\\").execSync; -(execSync(\"ls\"): Buffer); // returns Buffer -(execSync(\"ls\", { encoding: \"buffer\" }): Buffer); // returns Buffer -(execSync(\"ls\", { encoding: \"utf8\" }): string); // returns string -execSync(\"ls\", { timeout: \"250\" }); // error, no signatures match -execSync(\"ls\", { stdio: \"inherit\" }); // error, no signatures match -execSync(\"ls\", { stdio: [\"inherit\"] }); // error, no signatures match +(execSync(\\"ls\\"): Buffer); // returns Buffer +(execSync(\\"ls\\", { encoding: \\"buffer\\" }): Buffer); // returns Buffer +(execSync(\\"ls\\", { encoding: \\"utf8\\" }): string); // returns string +execSync(\\"ls\\", { timeout: \\"250\\" }); // error, no signatures match +execSync(\\"ls\\", { stdio: \\"inherit\\" }); // error, no signatures match +execSync(\\"ls\\", { stdio: [\\"inherit\\"] }); // error, no signatures match " `; -exports[`test spawn.js 1`] = ` +exports[`spawn.js 1`] = ` "/* @flow */ -var child_process = require(\'child_process\'); +var child_process = require('child_process'); -var ls = child_process.spawn(\'ls\'); -var wc = child_process.spawn(\'wc\', [\'-l\']); +var ls = child_process.spawn('ls'); +var wc = child_process.spawn('wc', ['-l']); // args + options. -child_process.spawn(\'echo\', [\'-n\', \'\"Testing...\"\'], {env: {TEST: \'foo\'}}); +child_process.spawn('echo', ['-n', '\\"Testing...\\"'], {env: {TEST: 'foo'}}); // options only. -child_process.spawn(\'echo\', {env: {FOO: 2}}); +child_process.spawn('echo', {env: {FOO: 2}}); -ls.stdout.on(\'data\', function(data) { +ls.stdout.on('data', function(data) { wc.stdin.write(data); }); -ls.stderr.on(\'data\', function(data) { +ls.stderr.on('data', function(data) { console.warn(data); }); -ls.on(\'close\', function(code) { +ls.on('close', function(code) { if (code !== 0) { - console.warn(\'\`ls\` exited with code %s\', code); + console.warn('\`ls\` exited with code %s', code); } wc.stdin.end(); }); @@ -153,28 +155,28 @@ wc.stderr.pipe(process.stderr); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var child_process = require(\"child_process\"); +var child_process = require(\\"child_process\\"); -var ls = child_process.spawn(\"ls\"); -var wc = child_process.spawn(\"wc\", [\"-l\"]); +var ls = child_process.spawn(\\"ls\\"); +var wc = child_process.spawn(\\"wc\\", [\\"-l\\"]); // args + options. -child_process.spawn(\"echo\", [\"-n\", \'\"Testing...\"\'], { env: { TEST: \"foo\" } }); +child_process.spawn(\\"echo\\", [\\"-n\\", '\\"Testing...\\"'], { env: { TEST: \\"foo\\" } }); // options only. -child_process.spawn(\"echo\", { env: { FOO: 2 } }); +child_process.spawn(\\"echo\\", { env: { FOO: 2 } }); -ls.stdout.on(\"data\", function(data) { +ls.stdout.on(\\"data\\", function(data) { wc.stdin.write(data); }); -ls.stderr.on(\"data\", function(data) { +ls.stderr.on(\\"data\\", function(data) { console.warn(data); }); -ls.on(\"close\", function(code) { +ls.on(\\"close\\", function(code) { if (code !== 0) { - console.warn(\"\`ls\` exited with code %s\", code); + console.warn(\\"\`ls\` exited with code %s\\", code); } wc.stdin.end(); }); diff --git a/tests/flow/node_tests/crypto/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/crypto/__snapshots__/jsfmt.spec.js.snap index 5b8f998db..a08a576e1 100644 --- a/tests/flow/node_tests/crypto/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/crypto/__snapshots__/jsfmt.spec.js.snap @@ -1,78 +1,80 @@ -exports[`test crypto.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`crypto.js 1`] = ` "/* @flow */ -const crypto = require(\'crypto\'); +const crypto = require('crypto'); let tests = [ // Hmac is a duplex stream function() { - const hmac = crypto.createHmac(\'sha256\', \'a secret\'); + const hmac = crypto.createHmac('sha256', 'a secret'); - hmac.on(\'readable\', () => { + hmac.on('readable', () => { (hmac.read(): ?(string | Buffer)); (hmac.read(): number); // 4 errors: null, void, string, Buffer }); - hmac.write(\'some data to hash\'); + hmac.write('some data to hash'); hmac.write(123); // 2 errors: not a string or a Buffer hmac.end(); }, // Hmac supports update and digest functions too function(buf: Buffer) { - const hmac = crypto.createHmac(\'sha256\', \'a secret\'); + const hmac = crypto.createHmac('sha256', 'a secret'); - hmac.update(\'some data to hash\'); - hmac.update(\'foo\', \'utf8\'); - hmac.update(\'foo\', \'bogus\'); // 1 error + hmac.update('some data to hash'); + hmac.update('foo', 'utf8'); + hmac.update('foo', 'bogus'); // 1 error hmac.update(buf); - hmac.update(buf, \'utf8\'); // 1 error: no encoding when passing a buffer + hmac.update(buf, 'utf8'); // 1 error: no encoding when passing a buffer - // it\'s also chainable - (hmac.update(\'some data to hash\').update(buf).digest(): Buffer); + // it's also chainable + (hmac.update('some data to hash').update(buf).digest(): Buffer); - (hmac.digest(\'hex\'): string); + (hmac.digest('hex'): string); (hmac.digest(): Buffer); - (hmac.digest(\'hex\'): void); // 1 error + (hmac.digest('hex'): void); // 1 error (hmac.digest(): void); // 1 error } ] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -const crypto = require(\"crypto\"); +const crypto = require(\\"crypto\\"); let tests = [ // Hmac is a duplex stream function() { - const hmac = crypto.createHmac(\"sha256\", \"a secret\"); + const hmac = crypto.createHmac(\\"sha256\\", \\"a secret\\"); - hmac.on(\"readable\", () => { + hmac.on(\\"readable\\", () => { (hmac.read(): ?(string | Buffer)); (hmac.read(): number); // 4 errors: null, void, string, Buffer }); - hmac.write(\"some data to hash\"); + hmac.write(\\"some data to hash\\"); hmac.write(123); // 2 errors: not a string or a Buffer hmac.end(); }, // Hmac supports update and digest functions too function(buf: Buffer) { - const hmac = crypto.createHmac(\"sha256\", \"a secret\"); + const hmac = crypto.createHmac(\\"sha256\\", \\"a secret\\"); - hmac.update(\"some data to hash\"); - hmac.update(\"foo\", \"utf8\"); - hmac.update(\"foo\", \"bogus\"); // 1 error + hmac.update(\\"some data to hash\\"); + hmac.update(\\"foo\\", \\"utf8\\"); + hmac.update(\\"foo\\", \\"bogus\\"); // 1 error hmac.update(buf); - hmac.update(buf, \"utf8\"); // 1 error: no encoding when passing a buffer + hmac.update(buf, \\"utf8\\"); // 1 error: no encoding when passing a buffer - // it\'s also chainable - (hmac.update(\"some data to hash\").update(buf).digest(): Buffer); + // it's also chainable + (hmac.update(\\"some data to hash\\").update(buf).digest(): Buffer); - (hmac.digest(\"hex\"): string); + (hmac.digest(\\"hex\\"): string); (hmac.digest(): Buffer); - (hmac.digest(\"hex\"): void); // 1 error + (hmac.digest(\\"hex\\"): void); // 1 error (hmac.digest(): void); // 1 error } ]; diff --git a/tests/flow/node_tests/fs/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/fs/__snapshots__/jsfmt.spec.js.snap index f74f11790..f200aa9d6 100644 --- a/tests/flow/node_tests/fs/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/fs/__snapshots__/jsfmt.spec.js.snap @@ -1,70 +1,72 @@ -exports[`test fs.js 1`] = ` -"var fs = require(\"fs\"); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`fs.js 1`] = ` +"var fs = require(\\"fs\\"); /* readFile */ -fs.readFile(\"file.exp\", (_, data) => { +fs.readFile(\\"file.exp\\", (_, data) => { (data : Buffer); }); -fs.readFile(\"file.exp\", \"blah\", (_, data) => { +fs.readFile(\\"file.exp\\", \\"blah\\", (_, data) => { (data : string); }); -fs.readFile(\"file.exp\", { encoding: \"blah\" }, (_, data) => { +fs.readFile(\\"file.exp\\", { encoding: \\"blah\\" }, (_, data) => { (data : string); }); -fs.readFile(\"file.exp\", {}, (_, data) => { +fs.readFile(\\"file.exp\\", {}, (_, data) => { (data : Buffer); }); /* readFileSync */ -(fs.readFileSync(\"file.exp\") : Buffer); -(fs.readFileSync(\"file.exp\") : string); // error +(fs.readFileSync(\\"file.exp\\") : Buffer); +(fs.readFileSync(\\"file.exp\\") : string); // error -(fs.readFileSync(\"file.exp\", \"blah\") : string); -(fs.readFileSync(\"file.exp\", \"blah\") : Buffer); // error +(fs.readFileSync(\\"file.exp\\", \\"blah\\") : string); +(fs.readFileSync(\\"file.exp\\", \\"blah\\") : Buffer); // error -(fs.readFileSync(\"file.exp\", { encoding: \"blah\" }) : string); -(fs.readFileSync(\"file.exp\", { encoding: \"blah\" }) : Buffer); // error +(fs.readFileSync(\\"file.exp\\", { encoding: \\"blah\\" }) : string); +(fs.readFileSync(\\"file.exp\\", { encoding: \\"blah\\" }) : Buffer); // error -(fs.readFileSync(\"file.exp\", {}) : Buffer); -(fs.readFileSync(\"file.exp\", {}) : string); // error +(fs.readFileSync(\\"file.exp\\", {}) : Buffer); +(fs.readFileSync(\\"file.exp\\", {}) : string); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var fs = require(\"fs\"); +var fs = require(\\"fs\\"); /* readFile */ -fs.readFile(\"file.exp\", (_, data) => { +fs.readFile(\\"file.exp\\", (_, data) => { (data: Buffer); }); -fs.readFile(\"file.exp\", \"blah\", (_, data) => { +fs.readFile(\\"file.exp\\", \\"blah\\", (_, data) => { (data: string); }); -fs.readFile(\"file.exp\", { encoding: \"blah\" }, (_, data) => { +fs.readFile(\\"file.exp\\", { encoding: \\"blah\\" }, (_, data) => { (data: string); }); -fs.readFile(\"file.exp\", {}, (_, data) => { +fs.readFile(\\"file.exp\\", {}, (_, data) => { (data: Buffer); }); /* readFileSync */ -(fs.readFileSync(\"file.exp\"): Buffer); -(fs.readFileSync(\"file.exp\"): string); // error +(fs.readFileSync(\\"file.exp\\"): Buffer); +(fs.readFileSync(\\"file.exp\\"): string); // error -(fs.readFileSync(\"file.exp\", \"blah\"): string); -(fs.readFileSync(\"file.exp\", \"blah\"): Buffer); // error +(fs.readFileSync(\\"file.exp\\", \\"blah\\"): string); +(fs.readFileSync(\\"file.exp\\", \\"blah\\"): Buffer); // error -(fs.readFileSync(\"file.exp\", { encoding: \"blah\" }): string); -(fs.readFileSync(\"file.exp\", { encoding: \"blah\" }): Buffer); // error +(fs.readFileSync(\\"file.exp\\", { encoding: \\"blah\\" }): string); +(fs.readFileSync(\\"file.exp\\", { encoding: \\"blah\\" }): Buffer); // error -(fs.readFileSync(\"file.exp\", {}): Buffer); -(fs.readFileSync(\"file.exp\", {}): string); // error +(fs.readFileSync(\\"file.exp\\", {}): Buffer); +(fs.readFileSync(\\"file.exp\\", {}): string); // error " `; diff --git a/tests/flow/node_tests/json_file/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/json_file/__snapshots__/jsfmt.spec.js.snap index dcc63119d..71e060189 100644 --- a/tests/flow/node_tests/json_file/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/json_file/__snapshots__/jsfmt.spec.js.snap @@ -1,50 +1,52 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "// @flow -let data = require(\'./package/index.json\'); +let data = require('./package/index.json'); (data.foo: void); // error, should be object literal (data.foo.bar: void); // error, should be boolean (data.abc: boolean); // error, should be ?string -let data2 = require(\'./package\'); +let data2 = require('./package'); (data2.baz: void); // error, should be string -let data3 = require(\'./package2\'); +let data3 = require('./package2'); (data3.foo: void); // error, should be number (not string! index.js wins) -let data4 = require(\'./json_array\'); +let data4 = require('./json_array'); (data4: Array); (data4: void); // error, should be Array -(require(\'./json_string\'): void); // error, should be string -(require(\'./json_number\'): void); // error, should be number -(require(\'./json_true\'): void); // error, should be true -(require(\'./json_false\'): void); // error, should be false -(require(\'./json_null\'): void); // error, should be null -(require(\'./json_negative_number\'): -1); // ok +(require('./json_string'): void); // error, should be string +(require('./json_number'): void); // error, should be number +(require('./json_true'): void); // error, should be true +(require('./json_false'): void); // error, should be false +(require('./json_null'): void); // error, should be null +(require('./json_negative_number'): -1); // ok ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -let data = require(\"./package/index.json\"); +let data = require(\\"./package/index.json\\"); (data.foo: void); // error, should be object literal (data.foo.bar: void); // error, should be boolean (data.abc: boolean); // error, should be ?string -let data2 = require(\"./package\"); +let data2 = require(\\"./package\\"); (data2.baz: void); // error, should be string -let data3 = require(\"./package2\"); +let data3 = require(\\"./package2\\"); (data3.foo: void); // error, should be number (not string! index.js wins) -let data4 = require(\"./json_array\"); +let data4 = require(\\"./json_array\\"); (data4: Array); (data4: void); // error, should be Array -(require(\"./json_string\"): void); // error, should be string -(require(\"./json_number\"): void); // error, should be number -(require(\"./json_true\"): void); // error, should be true -(require(\"./json_false\"): void); // error, should be false -(require(\"./json_null\"): void); // error, should be null -(require(\"./json_negative_number\"): -1); // ok +(require(\\"./json_string\\"): void); // error, should be string +(require(\\"./json_number\\"): void); // error, should be number +(require(\\"./json_true\\"): void); // error, should be true +(require(\\"./json_false\\"): void); // error, should be false +(require(\\"./json_null\\"): void); // error, should be null +(require(\\"./json_negative_number\\"): -1); // ok " `; diff --git a/tests/flow/node_tests/json_file/package2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/json_file/package2/__snapshots__/jsfmt.spec.js.snap index e8c294c95..b7ae926b8 100644 --- a/tests/flow/node_tests/json_file/package2/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/json_file/package2/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test index.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`index.js 1`] = ` "// @flow module.exports = { diff --git a/tests/flow/node_tests/os/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/os/__snapshots__/jsfmt.spec.js.snap index 817756af0..db73cfcc6 100644 --- a/tests/flow/node_tests/os/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/os/__snapshots__/jsfmt.spec.js.snap @@ -1,33 +1,35 @@ -exports[`test userInfo.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`userInfo.js 1`] = ` "/* @flow */ -var os = require(\'os\'); +var os = require('os'); var u1 = os.userInfo(); (u1.username: string); (u1.username: Buffer); // error -var u2 = os.userInfo({encoding: \'utf8\'}); +var u2 = os.userInfo({encoding: 'utf8'}); (u2.username: string); (u2.username: Buffer); // error -var u3 = os.userInfo({encoding: \'buffer\'}); +var u3 = os.userInfo({encoding: 'buffer'}); (u3.username: string); // error (u3.username: Buffer); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var os = require(\"os\"); +var os = require(\\"os\\"); var u1 = os.userInfo(); (u1.username: string); (u1.username: Buffer); // error -var u2 = os.userInfo({ encoding: \"utf8\" }); +var u2 = os.userInfo({ encoding: \\"utf8\\" }); (u2.username: string); (u2.username: Buffer); // error -var u3 = os.userInfo({ encoding: \"buffer\" }); +var u3 = os.userInfo({ encoding: \\"buffer\\" }); (u3.username: string); // error (u3.username: Buffer); " diff --git a/tests/flow/node_tests/package_file/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/package_file/__snapshots__/jsfmt.spec.js.snap index 91c60d46b..93a7aa6e3 100644 --- a/tests/flow/node_tests/package_file/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/package_file/__snapshots__/jsfmt.spec.js.snap @@ -1,15 +1,17 @@ -exports[`test bar_lib.js 1`] = ` -"module.exports = \"bar_lib\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bar_lib.js 1`] = ` +"module.exports = \\"bar_lib\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = \"bar_lib\"; +module.exports = \\"bar_lib\\"; " `; -exports[`test foo.js 1`] = ` -"var x: string = require(\'./bar_lib\'); // \'bar_lib\' does not work! +exports[`foo.js 1`] = ` +"var x: string = require('./bar_lib'); // 'bar_lib' does not work! console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x: string = require(\"./bar_lib\"); // \'bar_lib\' does not work! +var x: string = require(\\"./bar_lib\\"); // 'bar_lib' does not work! console.log(x); " `; diff --git a/tests/flow/node_tests/package_file/bar_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/package_file/bar_lib/__snapshots__/jsfmt.spec.js.snap index ef9feb9ab..35ab1a61b 100644 --- a/tests/flow/node_tests/package_file/bar_lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/package_file/bar_lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test bar.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bar.js 1`] = ` "module.exports = 0; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ module.exports = 0; diff --git a/tests/flow/node_tests/package_file_node_modules/foo/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/package_file_node_modules/foo/__snapshots__/jsfmt.spec.js.snap index c478de1f6..3715733f4 100644 --- a/tests/flow/node_tests/package_file_node_modules/foo/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/package_file_node_modules/foo/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test foo.js 1`] = ` -"var x: string = require(\'bar_lib\'); // \'bar_lib\' does not work! +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` +"var x: string = require('bar_lib'); // 'bar_lib' does not work! console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x: string = require(\"bar_lib\"); // \'bar_lib\' does not work! +var x: string = require(\\"bar_lib\\"); // 'bar_lib' does not work! console.log(x); " `; diff --git a/tests/flow/node_tests/path_node_modules/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/path_node_modules/__snapshots__/jsfmt.spec.js.snap index 51bc929a6..61bc8b8ec 100644 --- a/tests/flow/node_tests/path_node_modules/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/path_node_modules/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test foo.js 1`] = ` -"var x = require(\'bar_lib/src/lib/bar\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` +"var x = require('bar_lib/src/lib/bar'); console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"bar_lib/src/lib/bar\"); +var x = require(\\"bar_lib/src/lib/bar\\"); console.log(x); " `; diff --git a/tests/flow/node_tests/path_node_modules_with_short_main/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/path_node_modules_with_short_main/__snapshots__/jsfmt.spec.js.snap index d2e4c58fe..a9c2f03c3 100644 --- a/tests/flow/node_tests/path_node_modules_with_short_main/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/path_node_modules_with_short_main/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test foo.js 1`] = ` -"var x = require(\'bar_lib\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` +"var x = require('bar_lib'); console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"bar_lib\"); +var x = require(\\"bar_lib\\"); console.log(x); " `; diff --git a/tests/flow/node_tests/path_node_modules_without_main/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/path_node_modules_without_main/__snapshots__/jsfmt.spec.js.snap index d2e4c58fe..a9c2f03c3 100644 --- a/tests/flow/node_tests/path_node_modules_without_main/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/path_node_modules_without_main/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test foo.js 1`] = ` -"var x = require(\'bar_lib\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` +"var x = require('bar_lib'); console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"bar_lib\"); +var x = require(\\"bar_lib\\"); console.log(x); " `; diff --git a/tests/flow/node_tests/path_package/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/path_package/__snapshots__/jsfmt.spec.js.snap index e77df4833..023ba873c 100644 --- a/tests/flow/node_tests/path_package/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/path_package/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test foo.js 1`] = ` -"var x = require(\'bar_lib/src/lib\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`foo.js 1`] = ` +"var x = require('bar_lib/src/lib'); console.log(x); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var x = require(\"bar_lib/src/lib\"); +var x = require(\\"bar_lib/src/lib\\"); console.log(x); " `; diff --git a/tests/flow/node_tests/stream/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/stream/__snapshots__/jsfmt.spec.js.snap index 22dea08fc..9fb02e3e7 100644 --- a/tests/flow/node_tests/stream/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/stream/__snapshots__/jsfmt.spec.js.snap @@ -1,25 +1,27 @@ -exports[`test stream.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`stream.js 1`] = ` "/* @flow */ -var child_process = require(\'child_process\'); -var fs = require(\'fs\'); -var stream = require(\'stream\'); -var ls = child_process.spawn(\'ls\'); +var child_process = require('child_process'); +var fs = require('fs'); +var stream = require('stream'); +var ls = child_process.spawn('ls'); -var data = \"foo\"; +var data = \\"foo\\"; ls.stdin.write(data); -ls.stdin.write(data, \"utf-8\"); +ls.stdin.write(data, \\"utf-8\\"); ls.stdin.write(data, () => {}); -ls.stdin.write(data, \"utf-8\", () => {}); +ls.stdin.write(data, \\"utf-8\\", () => {}); ls.stdin.end(); ls.stdin.end(data); -ls.stdin.end(data, \"utf-8\"); +ls.stdin.end(data, \\"utf-8\\"); ls.stdin.end(data, () => {}); -ls.stdin.end(data, \"utf-8\", () => {}); +ls.stdin.end(data, \\"utf-8\\", () => {}); -var ws = fs.createWriteStream(\'/dev/null\'); +var ws = fs.createWriteStream('/dev/null'); ls.stdout.pipe(ws).end(); class MyReadStream extends stream.Readable {} @@ -35,25 +37,25 @@ new MyReadStream() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var child_process = require(\"child_process\"); -var fs = require(\"fs\"); -var stream = require(\"stream\"); -var ls = child_process.spawn(\"ls\"); +var child_process = require(\\"child_process\\"); +var fs = require(\\"fs\\"); +var stream = require(\\"stream\\"); +var ls = child_process.spawn(\\"ls\\"); -var data = \"foo\"; +var data = \\"foo\\"; ls.stdin.write(data); -ls.stdin.write(data, \"utf-8\"); +ls.stdin.write(data, \\"utf-8\\"); ls.stdin.write(data, () => {}); -ls.stdin.write(data, \"utf-8\", () => {}); +ls.stdin.write(data, \\"utf-8\\", () => {}); ls.stdin.end(); ls.stdin.end(data); -ls.stdin.end(data, \"utf-8\"); +ls.stdin.end(data, \\"utf-8\\"); ls.stdin.end(data, () => {}); -ls.stdin.end(data, \"utf-8\", () => {}); +ls.stdin.end(data, \\"utf-8\\", () => {}); -var ws = fs.createWriteStream(\"/dev/null\"); +var ws = fs.createWriteStream(\\"/dev/null\\"); ls.stdout.pipe(ws).end(); class MyReadStream extends stream.Readable {} diff --git a/tests/flow/node_tests/timers/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/timers/__snapshots__/jsfmt.spec.js.snap index 3a4aa256d..fdfad78c7 100644 --- a/tests/flow/node_tests/timers/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/timers/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test timers.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`timers.js 1`] = ` "// @flow function setImmediateCallback(): number { diff --git a/tests/flow/node_tests/url/__snapshots__/jsfmt.spec.js.snap b/tests/flow/node_tests/url/__snapshots__/jsfmt.spec.js.snap index f335f9ef1..c9285b71a 100644 --- a/tests/flow/node_tests/url/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/node_tests/url/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test url.js 1`] = ` -"const url = require(\'url\'); -url.format(url.parse(\'https://example.com/foo\')); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`url.js 1`] = ` +"const url = require('url'); +url.format(url.parse('https://example.com/foo')); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -const url = require(\"url\"); -url.format(url.parse(\"https://example.com/foo\")); +const url = require(\\"url\\"); +url.format(url.parse(\\"https://example.com/foo\\")); " `; diff --git a/tests/flow/nullable/__snapshots__/jsfmt.spec.js.snap b/tests/flow/nullable/__snapshots__/jsfmt.spec.js.snap index a91442a3a..f0aea86fc 100644 --- a/tests/flow/nullable/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/nullable/__snapshots__/jsfmt.spec.js.snap @@ -1,19 +1,21 @@ -exports[`test maybe.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`maybe.js 1`] = ` "// @flow // unwrapping nested maybes should work -((\'foo\': ?(?string)): ?string); // ok +(('foo': ?(?string)): ?string); // ok ((123: ?(?number)): ?string); // error (only num ~> string) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow // unwrapping nested maybes should work -((\"foo\": ??string): ?string); // ok +((\\"foo\\": ??string): ?string); // ok ((123: ??number): ?string); // error (only num ~> string) " `; -exports[`test nullable.js 1`] = ` +exports[`nullable.js 1`] = ` "function foo():string { return null; } function bar():?string { return null; } @@ -61,21 +63,21 @@ var array_of_nullable: Array = [null, 3]; " `; -exports[`test simple_nullable.js 1`] = ` +exports[`simple_nullable.js 1`] = ` "function foo(x:?string) {} function bar(x:?number) {} -foo(\'hmm\'); -bar(\'hmm\'); +foo('hmm'); +bar('hmm'); function fn(data: ?{}) {} -fn({some: \'literal\'}); +fn({some: 'literal'}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function foo(x: ?string) {} function bar(x: ?number) {} -foo(\"hmm\"); -bar(\"hmm\"); +foo(\\"hmm\\"); +bar(\\"hmm\\"); function fn(data: ?{}) {} -fn({ some: \"literal\" }); +fn({ some: \\"literal\\" }); " `; diff --git a/tests/flow/number_constants/__snapshots__/jsfmt.spec.js.snap b/tests/flow/number_constants/__snapshots__/jsfmt.spec.js.snap index e68013db9..295ad2ef4 100644 --- a/tests/flow/number_constants/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/number_constants/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test number_constants.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`number_constants.js 1`] = ` "var a: number = Number.MAX_SAFE_INTEGER; var b: string = Number.MAX_SAFE_INTEGER; var c: number = Number.MIN_SAFE_INTEGER; diff --git a/tests/flow/object-method/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object-method/__snapshots__/jsfmt.spec.js.snap index 13d76e253..e50c533cb 100644 --- a/tests/flow/object-method/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/object-method/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test id.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`id.js 1`] = ` "declare function id(_: X): X; module.exports = id; @@ -9,18 +11,18 @@ module.exports = id; " `; -exports[`test subtype.js 1`] = ` +exports[`subtype.js 1`] = ` "interface Interface { m(): void; } -import type { ObjectType } from \'./test\'; +import type { ObjectType } from './test'; function subtypeCheck(x: Interface): ObjectType { return x; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ interface Interface { m(): void } -import type { ObjectType } from \"./test\"; +import type { ObjectType } from \\"./test\\"; function subtypeCheck(x: Interface): ObjectType { return x; @@ -28,8 +30,8 @@ function subtypeCheck(x: Interface): ObjectType { " `; -exports[`test test.js 1`] = ` -"const id = require(\'./id\'); +exports[`test.js 1`] = ` +"const id = require('./id'); export type ObjectType = { +m: () => void, @@ -43,7 +45,7 @@ module.exports = id( methodCaller ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -const id = require(\"./id\"); +const id = require(\\"./id\\"); export type ObjectType = { +m: () => void @@ -57,7 +59,7 @@ module.exports = id(methodCaller); " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "/* @flow */ function f() { @@ -96,7 +98,7 @@ b.f(); // error, property \`p\` not found " `; -exports[`test test3.js 1`] = ` +exports[`test3.js 1`] = ` "/* @flow */ function foo() { diff --git a/tests/flow/object_annot/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object_annot/__snapshots__/jsfmt.spec.js.snap index 7d72fa4b3..124de1878 100644 --- a/tests/flow/object_annot/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/object_annot/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "function foo(x: Array): Array { return x.sort((a, b) => a.foo - b.foo); } diff --git a/tests/flow/object_api/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object_api/__snapshots__/jsfmt.spec.js.snap index 1725d0c33..46f6f8ae6 100644 --- a/tests/flow/object_api/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/object_api/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test a.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a.js 1`] = ` "/* @flow */ module.exports = { a() {} };~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -8,38 +10,38 @@ module.exports = { a() {} }; " `; -exports[`test b.js 1`] = ` +exports[`b.js 1`] = ` "/* @flow */ -var a = require(\'./a\'); +var a = require('./a'); var b = Object.assign({ bar() {}, ...{} }, a); b.a(); // works here module.exports = b; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var a = require(\"./a\"); +var a = require(\\"./a\\"); var b = Object.assign({ bar() {}, ...{} }, a); b.a(); // works here module.exports = b; " `; -exports[`test c.js 1`] = ` +exports[`c.js 1`] = ` "/* @flow */ -var c = require(\'./b\'); +var c = require('./b'); c.a(); c.foo();~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var c = require(\"./b\"); +var c = require(\\"./b\\"); c.a(); c.foo(); " `; -exports[`test object_assign.js 1`] = ` +exports[`object_assign.js 1`] = ` "/* @flow */ var export_ = Object.assign({}, { @@ -70,7 +72,7 @@ module.exports = export_; " `; -exports[`test object_create.js 1`] = ` +exports[`object_create.js 1`] = ` "/* @flow */ class C { foo: string; } @@ -81,10 +83,10 @@ class C { foo: string; } // OK, \`instanceof C\` would be true (Object.create(new C): C); -// error, object literals don\'t structurally match instances -({ foo: \"foo\" }: C); +// error, object literals don't structurally match instances +({ foo: \\"foo\\" }: C); -// error, object types don\'t structurally match instances +// error, object types don't structurally match instances type O = { foo: string; } declare var o: O; (o: C); @@ -101,17 +103,17 @@ class C { // OK, \`instanceof C\` would be true (Object.create(new C()): C); -// error, object literals don\'t structurally match instances -({ foo: \"foo\" }: C); +// error, object literals don't structurally match instances +({ foo: \\"foo\\" }: C); -// error, object types don\'t structurally match instances +// error, object types don't structurally match instances type O = { foo: string }; declare var o: O; (o: C); " `; -exports[`test object_getprototypeof.js 1`] = ` +exports[`object_getprototypeof.js 1`] = ` "// @flow class Foo {} @@ -138,11 +140,11 @@ let tests = [ " `; -exports[`test object_keys.js 1`] = ` +exports[`object_keys.js 1`] = ` "/* @flow */ -var sealed = {one: \'one\', two: \'two\'}; -(Object.keys(sealed): Array<\'one\'|\'two\'>); +var sealed = {one: 'one', two: 'two'}; +(Object.keys(sealed): Array<'one'|'two'>); (Object.keys(sealed): void); // error, Array var unsealed = {}; @@ -163,19 +165,19 @@ class Foo { foo() {} } // constructor and foo not enumerable -(Object.keys(new Foo()): Array<\'error\'>); // error: prop ~> error +(Object.keys(new Foo()): Array<'error'>); // error: prop ~> error class Bar extends Foo { bar_prop: string; bar() {} } // only own enumerable props -(Object.keys(new Bar()): Array<\'error\'>); // error: bar_prop ~> error +(Object.keys(new Bar()): Array<'error'>); // error: bar_prop ~> error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var sealed = { one: \"one\", two: \"two\" }; -(Object.keys(sealed): Array<\"one\" | \"two\">); +var sealed = { one: \\"one\\", two: \\"two\\" }; +(Object.keys(sealed): Array<\\"one\\" | \\"two\\">); (Object.keys(sealed): void); // error, Array var unsealed = {}; @@ -196,18 +198,18 @@ class Foo { foo() {} } // constructor and foo not enumerable -(Object.keys(new Foo()): Array<\"error\">); // error: prop ~> error +(Object.keys(new Foo()): Array<\\"error\\">); // error: prop ~> error class Bar extends Foo { bar_prop: string; bar() {} } // only own enumerable props -(Object.keys(new Bar()): Array<\"error\">); // error: bar_prop ~> error +(Object.keys(new Bar()): Array<\\"error\\">); // error: bar_prop ~> error " `; -exports[`test object_missing.js 1`] = ` +exports[`object_missing.js 1`] = ` "// @flow let tests = [ @@ -226,7 +228,7 @@ let tests = [ " `; -exports[`test object_prototype.js 1`] = ` +exports[`object_prototype.js 1`] = ` "/* @flow */ function takesABool(x: boolean) {} @@ -236,10 +238,10 @@ function takesAnObject(x: Object) {} class Foo {} -var a = { foo: \'bar\' }; -var b = { foo: \'bar\', ...{}}; -var c = { foo: \'bar\', toString: function(): number { return 123; }}; -var d : { [key: string]: string } = { foo: \'bar\' }; +var a = { foo: 'bar' }; +var b = { foo: 'bar', ...{}}; +var c = { foo: 'bar', toString: function(): number { return 123; }}; +var d : { [key: string]: string } = { foo: 'bar' }; var x = new Date(); var y = new Foo(); @@ -257,7 +259,7 @@ var aToString2 = a.toString; takesAString(aToString2()); // set -b.toString = function(): string { return \'foo\'; }; +b.toString = function(): string { return 'foo'; }; c.toString = function(): number { return 123; }; // override @@ -277,7 +279,7 @@ takesAString(y.toString()); (123).toString; (123).toString = function() {}; // error (123).toString(2); -(123).toString(\'foo\'); // error +(123).toString('foo'); // error (123).toString(null); // error @@ -286,12 +288,12 @@ takesAString(y.toString()); // // call -takesABool(a.hasOwnProperty(\'foo\')); +takesABool(a.hasOwnProperty('foo')); // get var aHasOwnProperty : (prop: string) => boolean = a.hasOwnProperty; var aHasOwnProperty2 = a.hasOwnProperty; -takesABool(aHasOwnProperty2(\'bar\')); +takesABool(aHasOwnProperty2('bar')); // set b.hasOwnProperty = function() { return false; }; @@ -299,11 +301,11 @@ b.hasOwnProperty = function() { return false; }; // ... on a built-in instance var xHasOwnProperty : number = x.hasOwnProperty; // error var xHasOwnProperty2 : (prop: string) => number = x.hasOwnProperty; // error -takesABool(x.hasOwnProperty(\'foo\')); +takesABool(x.hasOwnProperty('foo')); // ... on an instance var yHasOwnProperty : number = y.hasOwnProperty; // error -takesABool(y.hasOwnProperty(\'foo\')); +takesABool(y.hasOwnProperty('foo')); // @@ -311,12 +313,12 @@ takesABool(y.hasOwnProperty(\'foo\')); // // call -takesABool(a.propertyIsEnumerable(\'foo\')); +takesABool(a.propertyIsEnumerable('foo')); // get var aPropertyIsEnumerable : (prop: string) => boolean = a.propertyIsEnumerable; var aPropertyIsEnumerable2 = a.propertyIsEnumerable; -takesABool(aPropertyIsEnumerable2(\'bar\')); +takesABool(aPropertyIsEnumerable2('bar')); // set b.propertyIsEnumerable = function() { return false; }; @@ -325,11 +327,11 @@ b.propertyIsEnumerable = function() { return false; }; var xPropertyIsEnumerable : number = x.propertyIsEnumerable; // error var xPropertyIsEnumerable2 : (prop: string) => number = x.propertyIsEnumerable; // error -takesABool(x.propertyIsEnumerable(\'foo\')); +takesABool(x.propertyIsEnumerable('foo')); // ... on an instance var yPropertyIsEnumerable : number = y.propertyIsEnumerable; // error -takesABool(y.propertyIsEnumerable(\'foo\')); +takesABool(y.propertyIsEnumerable('foo')); // @@ -356,7 +358,7 @@ var yValueOf : number = y.valueOf; // error takesAnObject(y.valueOf()); // ... on a literal -var strValueOf : string = (\"foo\").valueOf(); +var strValueOf : string = (\\"foo\\").valueOf(); var numValueOf : number = (123).valueOf(); var boolValueOf : boolean = (true).valueOf(); @@ -373,7 +375,7 @@ var aToLocaleString2 = a.toLocaleString; takesAString(aToLocaleString2()); // set -b.toLocaleString = function() { return \'derp\'; }; +b.toLocaleString = function() { return 'derp'; }; // ... on a built-in instance var xToLocaleString : number = x.toLocaleString; // error @@ -401,15 +403,15 @@ function takesAnObject(x: Object) {} class Foo {} -var a = { foo: \"bar\" }; -var b = { foo: \"bar\", ...{} }; +var a = { foo: \\"bar\\" }; +var b = { foo: \\"bar\\", ...{} }; var c = { - foo: \"bar\", + foo: \\"bar\\", toString: function(): number { return 123; } }; -var d: { [key: string]: string } = { foo: \"bar\" }; +var d: { [key: string]: string } = { foo: \\"bar\\" }; var x = new Date(); var y = new Foo(); @@ -428,7 +430,7 @@ takesAString(aToString2()); // set b.toString = function(): string { - return \"foo\"; + return \\"foo\\"; }; c.toString = function(): number { return 123; @@ -451,7 +453,7 @@ takesAString(y.toString()); (123).toString; (123).toString = function() {}; // error (123).toString(2); -(123).toString(\"foo\"); // error +(123).toString(\\"foo\\"); // error (123).toString(null); // error // @@ -459,12 +461,12 @@ takesAString(y.toString()); // // call -takesABool(a.hasOwnProperty(\"foo\")); +takesABool(a.hasOwnProperty(\\"foo\\")); // get var aHasOwnProperty: (prop: string) => boolean = a.hasOwnProperty; var aHasOwnProperty2 = a.hasOwnProperty; -takesABool(aHasOwnProperty2(\"bar\")); +takesABool(aHasOwnProperty2(\\"bar\\")); // set b.hasOwnProperty = function() { @@ -474,23 +476,23 @@ b.hasOwnProperty = function() { // ... on a built-in instance var xHasOwnProperty: number = x.hasOwnProperty; // error var xHasOwnProperty2: (prop: string) => number = x.hasOwnProperty; // error -takesABool(x.hasOwnProperty(\"foo\")); +takesABool(x.hasOwnProperty(\\"foo\\")); // ... on an instance var yHasOwnProperty: number = y.hasOwnProperty; // error -takesABool(y.hasOwnProperty(\"foo\")); +takesABool(y.hasOwnProperty(\\"foo\\")); // // propertyIsEnumerable // // call -takesABool(a.propertyIsEnumerable(\"foo\")); +takesABool(a.propertyIsEnumerable(\\"foo\\")); // get var aPropertyIsEnumerable: (prop: string) => boolean = a.propertyIsEnumerable; var aPropertyIsEnumerable2 = a.propertyIsEnumerable; -takesABool(aPropertyIsEnumerable2(\"bar\")); +takesABool(aPropertyIsEnumerable2(\\"bar\\")); // set b.propertyIsEnumerable = function() { @@ -500,11 +502,11 @@ b.propertyIsEnumerable = function() { // ... on a built-in instance var xPropertyIsEnumerable: number = x.propertyIsEnumerable; // error var xPropertyIsEnumerable2: (prop: string) => number = x.propertyIsEnumerable; // error -takesABool(x.propertyIsEnumerable(\"foo\")); +takesABool(x.propertyIsEnumerable(\\"foo\\")); // ... on an instance var yPropertyIsEnumerable: number = y.propertyIsEnumerable; // error -takesABool(y.propertyIsEnumerable(\"foo\")); +takesABool(y.propertyIsEnumerable(\\"foo\\")); // // valueOf @@ -532,7 +534,7 @@ var yValueOf: number = y.valueOf; // error takesAnObject(y.valueOf()); // ... on a literal -var strValueOf: string = \"foo\".valueOf(); +var strValueOf: string = \\"foo\\".valueOf(); var numValueOf: number = (123).valueOf(); var boolValueOf: boolean = true.valueOf(); @@ -550,7 +552,7 @@ takesAString(aToLocaleString2()); // set b.toLocaleString = function() { - return \"derp\"; + return \\"derp\\"; }; // ... on a built-in instance diff --git a/tests/flow/object_assign/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object_assign/__snapshots__/jsfmt.spec.js.snap index c2782cb28..93b138d47 100644 --- a/tests/flow/object_assign/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/object_assign/__snapshots__/jsfmt.spec.js.snap @@ -1,24 +1,26 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/** * @flow */ -var EventEmitter = require(\'events\').EventEmitter; +var EventEmitter = require('events').EventEmitter; // This pattern seems to cause the trouble. var Bad = Object.assign({}, EventEmitter.prototype, { - foo: function(): string { return \'hi\'; } + foo: function(): string { return 'hi'; } }); -// Calling Bad.foo() in the same file doesn\'t error +// Calling Bad.foo() in the same file doesn't error var bad: number = Bad.foo(); -// Doesn\'t repro if I extend the class myself +// Doesn't repro if I extend the class myself class MyEventEmitter extends events$EventEmitter {} var Good = Object.assign({}, MyEventEmitter.prototype, { - foo: function(): string { return \'hi\'; } + foo: function(): string { return 'hi'; } }); -// Calling Good.foo() in the same file doesn\'t error +// Calling Good.foo() in the same file doesn't error var good: number = Good.foo(); module.exports = { @@ -30,26 +32,26 @@ module.exports = { * @flow */ -var EventEmitter = require(\"events\").EventEmitter; +var EventEmitter = require(\\"events\\").EventEmitter; // This pattern seems to cause the trouble. var Bad = Object.assign({}, EventEmitter.prototype, { foo: function(): string { - return \"hi\"; + return \\"hi\\"; } }); -// Calling Bad.foo() in the same file doesn\'t error +// Calling Bad.foo() in the same file doesn't error var bad: number = Bad.foo(); -// Doesn\'t repro if I extend the class myself +// Doesn't repro if I extend the class myself class MyEventEmitter extends events$EventEmitter {} var Good = Object.assign({}, MyEventEmitter.prototype, { foo: function(): string { - return \"hi\"; + return \\"hi\\"; } }); -// Calling Good.foo() in the same file doesn\'t error +// Calling Good.foo() in the same file doesn't error var good: number = Good.foo(); module.exports = { @@ -59,12 +61,12 @@ module.exports = { " `; -exports[`test B.js 1`] = ` +exports[`B.js 1`] = ` "/** * @flow */ -var A = require(\'./A.js\'); +var A = require('./A.js'); var good: number = A.Good.foo(); @@ -82,7 +84,7 @@ A.js|8 col 23 error| object literal * @flow */ -var A = require(\"./A.js\"); +var A = require(\\"./A.js\\"); var good: number = A.Good.foo(); @@ -98,41 +100,41 @@ A.js|8 col 23 error| object literal " `; -exports[`test apply.js 1`] = ` +exports[`apply.js 1`] = ` "// @flow -(Object.assign.apply(null, [{}, {a: 1}, {b: \'foo\'}]): {a: number, b: string}); -(Object.assign({}, ...[{a: 1}, {b: \'foo\'}]): {a: number, b: string}); +(Object.assign.apply(null, [{}, {a: 1}, {b: 'foo'}]): {a: number, b: string}); +(Object.assign({}, ...[{a: 1}, {b: 'foo'}]): {a: number, b: string}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -(Object.assign.apply(null, [{}, { a: 1 }, { b: \"foo\" }]): { +(Object.assign.apply(null, [{}, { a: 1 }, { b: \\"foo\\" }]): { a: number, b: string }); -(Object.assign({}, ...[{ a: 1 }, { b: \"foo\" }]): { a: number, b: string }); +(Object.assign({}, ...[{ a: 1 }, { b: \\"foo\\" }]): { a: number, b: string }); " `; -exports[`test non_objects.js 1`] = ` +exports[`non_objects.js 1`] = ` "/* @flow */ -Object.assign(\"123\", {a: \"foo\"}); -Object.assign(123, {a: \"foo\"}); -Object.assign({a: \"foo\"}, 123); +Object.assign(\\"123\\", {a: \\"foo\\"}); +Object.assign(123, {a: \\"foo\\"}); +Object.assign({a: \\"foo\\"}, 123); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -Object.assign(\"123\", { a: \"foo\" }); -Object.assign(123, { a: \"foo\" }); -Object.assign({ a: \"foo\" }, 123); +Object.assign(\\"123\\", { a: \\"foo\\" }); +Object.assign(123, { a: \\"foo\\" }); +Object.assign({ a: \\"foo\\" }, 123); " `; -exports[`test undefined.js 1`] = ` +exports[`undefined.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); type DefaultProps = { foo: number, @@ -153,7 +155,7 @@ class MyReactThing extends React.Component { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); type DefaultProps = { foo: number diff --git a/tests/flow/object_freeze/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object_freeze/__snapshots__/jsfmt.spec.js.snap index e825894ab..1994cb924 100644 --- a/tests/flow/object_freeze/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/object_freeze/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test object_freeze.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`object_freeze.js 1`] = ` "/* @flow */ -var foo = Object.freeze({bar: \'12345\'}); -foo.bar = \'23456\'; // error +var foo = Object.freeze({bar: '12345'}); +foo.bar = '23456'; // error -Object.assign(foo, {bar: \'12345\'}); // error +Object.assign(foo, {bar: '12345'}); // error var baz = {baz: 12345}; -var bliffl = Object.freeze({bar: \'12345\', ...baz}); -bliffl.bar = \'23456\'; // error +var bliffl = Object.freeze({bar: '12345', ...baz}); +bliffl.bar = '23456'; // error bliffl.baz = 3456; // error bliffl.corge; // error bliffl.constructor = baz; // error @@ -18,18 +20,18 @@ baz.baz = 0; var x : number = Object.freeze(123); -var xx : { x: number } = Object.freeze({ x: \"error\" }) +var xx : { x: number } = Object.freeze({ x: \\"error\\" }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var foo = Object.freeze({ bar: \"12345\" }); -foo.bar = \"23456\"; // error +var foo = Object.freeze({ bar: \\"12345\\" }); +foo.bar = \\"23456\\"; // error -Object.assign(foo, { bar: \"12345\" }); // error +Object.assign(foo, { bar: \\"12345\\" }); // error var baz = { baz: 12345 }; -var bliffl = Object.freeze({ bar: \"12345\", ...baz }); -bliffl.bar = \"23456\"; // error +var bliffl = Object.freeze({ bar: \\"12345\\", ...baz }); +bliffl.bar = \\"23456\\"; // error bliffl.baz = 3456; // error bliffl.corge; // error bliffl.constructor = baz; // error @@ -39,6 +41,6 @@ baz.baz = 0; var x: number = Object.freeze(123); -var xx: { x: number } = Object.freeze({ x: \"error\" }); +var xx: { x: number } = Object.freeze({ x: \\"error\\" }); " `; diff --git a/tests/flow/object_is/__snapshots__/jsfmt.spec.js.snap b/tests/flow/object_is/__snapshots__/jsfmt.spec.js.snap index baa1d1b28..bbb4af7e1 100644 --- a/tests/flow/object_is/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/object_is/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test object_is.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`object_is.js 1`] = ` "Object.is(1, 1); Object.is(1, 2); Object.is(1, {}); @@ -17,10 +19,10 @@ Object.is(emptyObject, emptyArray); var squared = x => x * x; Object.is(squared, squared); -var a: boolean = Object.is(\'a\', \'a\'); -var b: string = Object.is(\'a\', \'a\'); -var c: boolean = Object.is(\'a\'); -var d: boolean = Object.is(\'a\', \'b\', \'c\'); +var a: boolean = Object.is('a', 'a'); +var b: string = Object.is('a', 'a'); +var c: boolean = Object.is('a'); +var d: boolean = Object.is('a', 'b', 'c'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Object.is(1, 1); Object.is(1, 2); @@ -40,9 +42,9 @@ Object.is(emptyObject, emptyArray); var squared = x => x * x; Object.is(squared, squared); -var a: boolean = Object.is(\"a\", \"a\"); -var b: string = Object.is(\"a\", \"a\"); -var c: boolean = Object.is(\"a\"); -var d: boolean = Object.is(\"a\", \"b\", \"c\"); +var a: boolean = Object.is(\\"a\\", \\"a\\"); +var b: string = Object.is(\\"a\\", \\"a\\"); +var c: boolean = Object.is(\\"a\\"); +var d: boolean = Object.is(\\"a\\", \\"b\\", \\"c\\"); " `; diff --git a/tests/flow/objects/__snapshots__/jsfmt.spec.js.snap b/tests/flow/objects/__snapshots__/jsfmt.spec.js.snap index e5ebc4b7c..dfdbf1d99 100644 --- a/tests/flow/objects/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/objects/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test conversion.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`conversion.js 1`] = ` "/* @flow */ -(Object({foo: \'bar\'}): {foo: string}); -(Object(\"123\"): String); +(Object({foo: 'bar'}): {foo: string}); +(Object(\\"123\\"): String); (Object(123): Number); (Object(true): Boolean); (Object(null): {}); @@ -11,9 +13,9 @@ exports[`test conversion.js 1`] = ` (Object(undefined): Number); // error var x = Object(null); -x.foo = \"bar\"; +x.foo = \\"bar\\"; -var y = Object(\"123\"); +var y = Object(\\"123\\"); (y.charAt(0): string); var z = Object(123); // error (next line makes this not match any signatures) @@ -21,8 +23,8 @@ var z = Object(123); // error (next line makes this not match any signatures) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -(Object({ foo: \"bar\" }): { foo: string }); -(Object(\"123\"): String); +(Object({ foo: \\"bar\\" }): { foo: string }); +(Object(\\"123\\"): String); (Object(123): Number); (Object(true): Boolean); (Object(null): {}); @@ -31,9 +33,9 @@ var z = Object(123); // error (next line makes this not match any signatures) (Object(undefined): Number); // error var x = Object(null); -x.foo = \"bar\"; +x.foo = \\"bar\\"; -var y = Object(\"123\"); +var y = Object(\\"123\\"); (y.charAt(0): string); var z = Object(123); // error (next line makes this not match any signatures) @@ -41,53 +43,53 @@ var z = Object(123); // error (next line makes this not match any signatures) " `; -exports[`test objects.js 1`] = ` +exports[`objects.js 1`] = ` "/* @flow */ -var x : {\'123\': string, bar: string} = {\'123\': \'val\', bar: \'bar\'}; -(x.foo : string); // error, key doesn\'t exist -(x[\'foo\'] : string); // error, key doesn\'t exist -(x[123] : boolean); // TODO: use the number\'s value to error here +var x : {'123': string, bar: string} = {'123': 'val', bar: 'bar'}; +(x.foo : string); // error, key doesn't exist +(x['foo'] : string); // error, key doesn't exist +(x[123] : boolean); // TODO: use the number's value to error here (x.bar: boolean); // error, string !~> boolean -(x[\'123\'] : boolean); // error, string !~> boolean -x[\'123\'] = false; // error, boolean !~> string -x[123] = false; // TODO: use the number\'s value to error here -x[\'foo\'+\'bar\'] = \'derp\'; // ok since we can\'t tell -(x[\`foo\`]: string); // error, key doesn\'t exist +(x['123'] : boolean); // error, string !~> boolean +x['123'] = false; // error, boolean !~> string +x[123] = false; // TODO: use the number's value to error here +x['foo'+'bar'] = 'derp'; // ok since we can't tell +(x[\`foo\`]: string); // error, key doesn't exist -var y : {foo: string} = {foo: \'bar\'}; -y[\'foo\'] = 123; // error, number !~> string -y[\'bar\'] = \'abc\'; // error, property not found +var y : {foo: string} = {foo: 'bar'}; +y['foo'] = 123; // error, number !~> string +y['bar'] = 'abc'; // error, property not found -(y[\'hasOwnProperty\']: string); // error, prototype method is not a string +(y['hasOwnProperty']: string); // error, prototype method is not a string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var x: { \"123\": string, bar: string } = { \"123\": \"val\", bar: \"bar\" }; -(x.foo: string); // error, key doesn\'t exist -(x[\"foo\"]: string); // error, key doesn\'t exist -(x[123]: boolean); // TODO: use the number\'s value to error here +var x: { \\"123\\": string, bar: string } = { \\"123\\": \\"val\\", bar: \\"bar\\" }; +(x.foo: string); // error, key doesn't exist +(x[\\"foo\\"]: string); // error, key doesn't exist +(x[123]: boolean); // TODO: use the number's value to error here (x.bar: boolean); // error, string !~> boolean -(x[\"123\"]: boolean); // error, string !~> boolean -x[\"123\"] = false; // error, boolean !~> string -x[123] = false; // TODO: use the number\'s value to error here -x[\"foo\" + \"bar\"] = \"derp\"; // ok since we can\'t tell -(x[\`foo\`]: string); // error, key doesn\'t exist +(x[\\"123\\"]: boolean); // error, string !~> boolean +x[\\"123\\"] = false; // error, boolean !~> string +x[123] = false; // TODO: use the number's value to error here +x[\\"foo\\" + \\"bar\\"] = \\"derp\\"; // ok since we can't tell +(x[\`foo\`]: string); // error, key doesn't exist -var y: { foo: string } = { foo: \"bar\" }; -y[\"foo\"] = 123; // error, number !~> string -y[\"bar\"] = \"abc\"; // error, property not found +var y: { foo: string } = { foo: \\"bar\\" }; +y[\\"foo\\"] = 123; // error, number !~> string +y[\\"bar\\"] = \\"abc\\"; // error, property not found -(y[\"hasOwnProperty\"]: string); // error, prototype method is not a string +(y[\\"hasOwnProperty\\"]: string); // error, prototype method is not a string " `; -exports[`test unaliased_assign.js 1`] = ` +exports[`unaliased_assign.js 1`] = ` "/** * test handling of unaliased value assignment. * * An unaliased object rvalue may be assigned to a supertype lvalue, - * because later widening mutations on the rvalue can\'t break assumptions + * because later widening mutations on the rvalue can't break assumptions * made by other lvalues. * * However, upon assignment the rvalue must take on the type of the @@ -97,25 +99,25 @@ exports[`test unaliased_assign.js 1`] = ` * @flow */ -var glob: { x: string } = { x: \"hey\" }; +var glob: { x: string } = { x: \\"hey\\" }; function assign_then_alias() { var obj: { x: string | number }; - obj = { x: \"hey\" }; + obj = { x: \\"hey\\" }; glob = obj; // error: subsequent assignment might make glob.x a number } function assign_then_widen() { var obj: { x: string | number }; - obj = { x: \"hey\" }; - obj.x = 10; // ok, by lvalue\'s given type + obj = { x: \\"hey\\" }; + obj.x = 10; // ok, by lvalue's given type } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * test handling of unaliased value assignment. * * An unaliased object rvalue may be assigned to a supertype lvalue, - * because later widening mutations on the rvalue can\'t break assumptions + * because later widening mutations on the rvalue can't break assumptions * made by other lvalues. * * However, upon assignment the rvalue must take on the type of the @@ -125,18 +127,18 @@ function assign_then_widen() { * @flow */ -var glob: { x: string } = { x: \"hey\" }; +var glob: { x: string } = { x: \\"hey\\" }; function assign_then_alias() { var obj: { x: string | number }; - obj = { x: \"hey\" }; + obj = { x: \\"hey\\" }; glob = obj; // error: subsequent assignment might make glob.x a number } function assign_then_widen() { var obj: { x: string | number }; - obj = { x: \"hey\" }; - obj.x = 10; // ok, by lvalue\'s given type + obj = { x: \\"hey\\" }; + obj.x = 10; // ok, by lvalue's given type } " `; diff --git a/tests/flow/objmap/__snapshots__/jsfmt.spec.js.snap b/tests/flow/objmap/__snapshots__/jsfmt.spec.js.snap index c7ed42fc7..c1720fda5 100644 --- a/tests/flow/objmap/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/objmap/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test objmap.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`objmap.js 1`] = ` "declare function promiseAllByKey(o: O): Promise<$ObjMap>; declare function keyMirror(o: O): $ObjMapi(k:K) => K>; @@ -7,15 +9,15 @@ var o = keyMirror({ BAR: null, }); -(o.FOO : \'FOO\'); // ok -(o.FOO : \'BAR\'); // error, \'FOO\' incompatible with \'BAR\' +(o.FOO : 'FOO'); // ok +(o.FOO : 'BAR'); // error, 'FOO' incompatible with 'BAR' promiseAllByKey({ foo: Promise.resolve(0), - bar: \'bar\', + bar: 'bar', }).then(o => { (o.foo: string); // error, number ~> string - (o.bar: \'bar\'); // ok + (o.bar: 'bar'); // ok }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare function promiseAllByKey(o: O): Promise<$ObjMap>; @@ -26,15 +28,15 @@ var o = keyMirror({ BAR: null }); -(o.FOO: \"FOO\"); // ok -(o.FOO: \"BAR\"); // error, \'FOO\' incompatible with \'BAR\' +(o.FOO: \\"FOO\\"); // ok +(o.FOO: \\"BAR\\"); // error, 'FOO' incompatible with 'BAR' promiseAllByKey({ foo: Promise.resolve(0), - bar: \"bar\" + bar: \\"bar\\" }).then(o => { (o.foo: string); // error, number ~> string - (o.bar: \"bar\"); // ok + (o.bar: \\"bar\\"); // ok }); " `; diff --git a/tests/flow/optional/__snapshots__/jsfmt.spec.js.snap b/tests/flow/optional/__snapshots__/jsfmt.spec.js.snap index e66dabded..7c1df7b85 100644 --- a/tests/flow/optional/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/optional/__snapshots__/jsfmt.spec.js.snap @@ -1,15 +1,17 @@ -exports[`test client_optional.js 1`] = ` -"var qux = require(\'./optional\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`client_optional.js 1`] = ` +"var qux = require('./optional'); qux(0); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var qux = require(\"./optional\"); +var qux = require(\\"./optional\\"); qux(0); " `; -exports[`test default.js 1`] = ` +exports[`default.js 1`] = ` "function f(foo, bar = foo): [T, T] { return [foo, bar]; } @@ -20,7 +22,7 @@ function f(foo, bar = foo): [T, T] { " `; -exports[`test generic.js 1`] = ` +exports[`generic.js 1`] = ` "function x(x: T = 0) {} class C { @@ -35,7 +37,7 @@ class C { " `; -exports[`test maybe.js 1`] = ` +exports[`maybe.js 1`] = ` "function foo(x?: string): ?string { return x; } @@ -46,7 +48,7 @@ function foo(x?: string): ?string { " `; -exports[`test nullable.js 1`] = ` +exports[`nullable.js 1`] = ` "/* @flow */ function optionalNullable1(x: {y?: ?number}) { @@ -149,17 +151,17 @@ function optionalNullable8(x: { y?: ?number }) { " `; -exports[`test optional.js 1`] = ` +exports[`optional.js 1`] = ` "function bar(x?,y?) { x * 0; } bar(0); var foo:(x?:number)=>void = bar; foo(); -function qux(x=\"hello\",...y):string { foo(x); return y[0]; } +function qux(x=\\"hello\\",...y):string { foo(x); return y[0]; } qux(0,0); -qux(0,...[\"\",42]); +qux(0,...[\\"\\",42]); module.exports = qux; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -171,27 +173,27 @@ bar(0); var foo: (x?: number) => void = bar; foo(); -function qux(x = \"hello\", ...y): string { +function qux(x = \\"hello\\", ...y): string { foo(x); return y[0]; } qux(0, 0); -qux(0, ...[\"\", 42]); +qux(0, ...[\\"\\", 42]); module.exports = qux; " `; -exports[`test optional_param.js 1`] = ` +exports[`optional_param.js 1`] = ` "/* @flow */ function foo(x?: string): string { - if (x == null) { return \'foo\'; } + if (x == null) { return 'foo'; } return x; } function bar(obj: {x?: string}): string { - if (obj.x == null) { return \'foo\'; } + if (obj.x == null) { return 'foo'; } return obj.x; } @@ -201,17 +203,17 @@ function baz(bar?) { } function testOptionalNullable(x?: ?string): string { - if (x == null) { return \'foo\'; } + if (x == null) { return 'foo'; } return x; } -function testOptionalNullableDefault(x?: ?string = \"hi\"): string { - if (x == null) { return \'foo\'; } +function testOptionalNullableDefault(x?: ?string = \\"hi\\"): string { + if (x == null) { return 'foo'; } return x; } function testOptionalNullableProperty(obj: {x?: ?string}): string { - if (obj.x == null) { return \'foo\'; } + if (obj.x == null) { return 'foo'; } return obj.x; } @@ -223,14 +225,14 @@ function testOptionalNullableFlowingToNullable(x?: ?string): ?string { /* @flow */ function foo(x?: string): string { if (x == null) { - return \"foo\"; + return \\"foo\\"; } return x; } function bar(obj: { x?: string }): string { if (obj.x == null) { - return \"foo\"; + return \\"foo\\"; } return obj.x; } @@ -244,21 +246,21 @@ function baz(bar?) { function testOptionalNullable(x?: ?string): string { if (x == null) { - return \"foo\"; + return \\"foo\\"; } return x; } -function testOptionalNullableDefault(x?: ?string = \"hi\"): string { +function testOptionalNullableDefault(x?: ?string = \\"hi\\"): string { if (x == null) { - return \"foo\"; + return \\"foo\\"; } return x; } function testOptionalNullableProperty(obj: { x?: ?string }): string { if (obj.x == null) { - return \"foo\"; + return \\"foo\\"; } return obj.x; } @@ -270,7 +272,7 @@ function testOptionalNullableFlowingToNullable(x?: ?string): ?string { " `; -exports[`test optional_param2.js 1`] = ` +exports[`optional_param2.js 1`] = ` "declare class I { map( mapper: (value?: V) => M @@ -287,11 +289,11 @@ var j: I = i.map(id => id); " `; -exports[`test optional_param3.js 1`] = ` +exports[`optional_param3.js 1`] = ` "function foo(x?: number) {} foo(undefined); // ok -function bar(x = \"bar\"): string { +function bar(x = \\"bar\\"): string { return x; } bar(undefined); // ok @@ -299,14 +301,14 @@ bar(undefined); // ok function foo(x?: number) {} foo(undefined); // ok -function bar(x = \"bar\"): string { +function bar(x = \\"bar\\"): string { return x; } bar(undefined); // ok " `; -exports[`test optional_param4.js 1`] = ` +exports[`optional_param4.js 1`] = ` "/* @flow */ function foo(x?: number, ...y: Array): [?number, Array] { @@ -315,7 +317,7 @@ function foo(x?: number, ...y: Array): [?number, Array] { foo(); // OK foo(123), // OK -foo(123, \'hello\'); // OK +foo(123, 'hello'); // OK foo(true); // ERROR boolean ~> number @@ -328,14 +330,14 @@ function foo(x?: number, ...y: Array): [?number, Array] { } foo(); // OK -foo(123), foo(123, \"hello\"); // OK // OK +foo(123), foo(123, \\"hello\\"); // OK // OK foo(true); // ERROR boolean ~> number foo(123, true); // ERROR boolean ~> string " `; -exports[`test undefined.js 1`] = ` +exports[`undefined.js 1`] = ` "var x; function foo(bar? = undefined) { @@ -358,7 +360,7 @@ function bar() { " `; -exports[`test undefined2.js 1`] = ` +exports[`undefined2.js 1`] = ` "var x; function foo(bar?) { diff --git a/tests/flow/optional_props/__snapshots__/jsfmt.spec.js.snap b/tests/flow/optional_props/__snapshots__/jsfmt.spec.js.snap index 5a7aba489..7b95834ab 100644 --- a/tests/flow/optional_props/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/optional_props/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "var x: { } = { foo: 0 }; var y: { foo?: string } = x; // OK in TypeScript, not OK in Flow -var z: string = y.foo || \"\"; +var z: string = y.foo || \\"\\"; var o = { }; y = o; // OK; we know that narrowing could not have happened @@ -10,12 +12,12 @@ o.foo = 0; // future widening is constrained function bar(config: { foo?: number }) {} bar({}); -bar({foo: \"\"}); +bar({foo: \\"\\"}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var x: {} = { foo: 0 }; var y: { foo?: string } = x; // OK in TypeScript, not OK in Flow -var z: string = y.foo || \"\"; +var z: string = y.foo || \\"\\"; var o = {}; y = o; // OK; we know that narrowing could not have happened @@ -23,11 +25,11 @@ o.foo = 0; // future widening is constrained function bar(config: { foo?: number }) {} bar({}); -bar({ foo: \"\" }); +bar({ foo: \\"\\" }); " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "var a: { foo?: string } = {}; a.foo = undefined; // This is not an error a.foo = null; // But this is an error @@ -58,12 +60,12 @@ var f: { foo?: ?string } = { foo: null }; // Also fine " `; -exports[`test test3.js 1`] = ` +exports[`test3.js 1`] = ` "// @flow /* object literals are sealed. this is simply a heuristic - decision: most of the time, the rule gives the \'right\' + decision: most of the time, the rule gives the 'right' errors. an exception is when a literal is used as an initializer @@ -72,7 +74,7 @@ exports[`test test3.js 1`] = ` the problem becomes visible when a property assignment is then used to (legitimately) extend the object with an - optional property - the variable\'s specific (path- + optional property - the variable's specific (path- dependent) type has become that of the literal which. without adjustment, will reject the property addition. @@ -84,15 +86,15 @@ exports[`test test3.js 1`] = ` // x has optional property b. // (note that the initializer here does not play into -// the problem, it\'s just a placeholder. initializers +// the problem, it's just a placeholder. initializers // do not narrow the types of annotated variables as do // subsequent assignments.) // var x: { a: number, b?: number } = { a: 0 }; // now assign an object literal lacking property b. -// the literal\'s type is sealed and has only a at creation. -// but it then flows, specific ~> general, to x\'s annotation +// the literal's type is sealed and has only a at creation. +// but it then flows, specific ~> general, to x's annotation // type. at that point, it acquires b as an optional property. // x = { a: 0 }; @@ -104,7 +106,7 @@ x.b = 1; class A { x: { a: number, b?: string }; foo() { - // Something similar should happen here, but doesn\'t: the problem is + // Something similar should happen here, but doesn't: the problem is // made explicit by adding generics (see test3_failure.js introduced by // D2747512). There is a race between writing b on the object literal // type and adding b as an optional property to it, since in general we @@ -112,7 +114,7 @@ class A { // annotation will be processed before the flow involving the // access. Here we lose the race and get an error on the write. this.x = { a: 123 }; - this.x.b = \'hello\'; + this.x.b = 'hello'; } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -120,7 +122,7 @@ class A { /* object literals are sealed. this is simply a heuristic - decision: most of the time, the rule gives the \'right\' + decision: most of the time, the rule gives the 'right' errors. an exception is when a literal is used as an initializer @@ -129,7 +131,7 @@ class A { the problem becomes visible when a property assignment is then used to (legitimately) extend the object with an - optional property - the variable\'s specific (path- + optional property - the variable's specific (path- dependent) type has become that of the literal which. without adjustment, will reject the property addition. @@ -141,15 +143,15 @@ class A { // x has optional property b. // (note that the initializer here does not play into -// the problem, it\'s just a placeholder. initializers +// the problem, it's just a placeholder. initializers // do not narrow the types of annotated variables as do // subsequent assignments.) // var x: { a: number, b?: number } = { a: 0 }; // now assign an object literal lacking property b. -// the literal\'s type is sealed and has only a at creation. -// but it then flows, specific ~> general, to x\'s annotation +// the literal's type is sealed and has only a at creation. +// but it then flows, specific ~> general, to x's annotation // type. at that point, it acquires b as an optional property. // x = { a: 0 }; @@ -161,7 +163,7 @@ x.b = 1; class A { x: { a: number, b?: string }; foo() { - // Something similar should happen here, but doesn\'t: the problem is + // Something similar should happen here, but doesn't: the problem is // made explicit by adding generics (see test3_failure.js introduced by // D2747512). There is a race between writing b on the object literal // type and adding b as an optional property to it, since in general we @@ -169,20 +171,20 @@ class A { // annotation will be processed before the flow involving the // access. Here we lose the race and get an error on the write. this.x = { a: 123 }; - this.x.b = \"hello\"; + this.x.b = \\"hello\\"; } } " `; -exports[`test test3_failure.js 1`] = ` +exports[`test3_failure.js 1`] = ` "// generalization of failure in test3.js class A { o: O; foo() { this.o.x = { a: 123 }; - this.o.x.b = \'hello\'; // this is a spurious error (see test3.js for details) + this.o.x.b = 'hello'; // this is a spurious error (see test3.js for details) } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -192,7 +194,7 @@ class A { o: O; foo() { this.o.x = { a: 123 }; - this.o.x.b = \"hello\"; // this is a spurious error (see test3.js for details) + this.o.x.b = \\"hello\\"; // this is a spurious error (see test3.js for details) } } " diff --git a/tests/flow/overload/__snapshots__/jsfmt.spec.js.snap b/tests/flow/overload/__snapshots__/jsfmt.spec.js.snap index 50fb19d9a..813dfaaea 100644 --- a/tests/flow/overload/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/overload/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test overload.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`overload.js 1`] = ` "/** * tests of overload selection * * @flow */ -var x1: number = \"\".match(0)[0]; -var x2: number = \"\".match(/pattern/)[0]; -var x3: string = \"\".replace(/pattern/,\"...\"); -var x4: number = \"\".split(/pattern/)[0]; +var x1: number = \\"\\".match(0)[0]; +var x2: number = \\"\\".match(/pattern/)[0]; +var x3: string = \\"\\".replace(/pattern/,\\"...\\"); +var x4: number = \\"\\".split(/pattern/)[0]; declare class C { foo(x:number): number; @@ -21,11 +23,11 @@ declare class C { var a = new C(); a.foo(0); // ok -a.foo(\"hey\"); // ok +a.foo(\\"hey\\"); // ok a.foo(true); // error, function cannot be called on intersection type a.bar({ a: 0 }); // ok -a.bar({ a: \"hey\" }); // ok +a.bar({ a: \\"hey\\" }); // ok a.bar({ a: true }); // error, function cannot be called on intersection type declare var x: { a: boolean; } & { b: string }; @@ -47,7 +49,7 @@ var y:number = new Dummy().dumb(foo); function bar1(x:number):Array { return []; } var z1:number = new Dummy().dumber(bar1); -function bar2(x:number):string { return \"...\"; } +function bar2(x:number):string { return \\"...\\"; } var z2:Array = new Dummy().dumber(bar2); */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -57,10 +59,10 @@ var z2:Array = new Dummy().dumber(bar2); * @flow */ -var x1: number = \"\".match(0)[0]; -var x2: number = \"\".match(/pattern/)[0]; -var x3: string = \"\".replace(/pattern/, \"...\"); -var x4: number = \"\".split(/pattern/)[0]; +var x1: number = \\"\\".match(0)[0]; +var x2: number = \\"\\".match(/pattern/)[0]; +var x3: string = \\"\\".replace(/pattern/, \\"...\\"); +var x4: number = \\"\\".split(/pattern/)[0]; declare class C { foo(x: number): number, @@ -73,11 +75,11 @@ declare class C { var a = new C(); a.foo(0); // ok -a.foo(\"hey\"); // ok +a.foo(\\"hey\\"); // ok a.foo(true); // error, function cannot be called on intersection type a.bar({ a: 0 }); // ok -a.bar({ a: \"hey\" }); // ok +a.bar({ a: \\"hey\\" }); // ok a.bar({ a: true }); // error, function cannot be called on intersection type declare var x: { a: boolean } & { b: string }; @@ -99,13 +101,13 @@ var y:number = new Dummy().dumb(foo); function bar1(x:number):Array { return []; } var z1:number = new Dummy().dumber(bar1); -function bar2(x:number):string { return \"...\"; } +function bar2(x:number):string { return \\"...\\"; } var z2:Array = new Dummy().dumber(bar2); */ " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "function foo() { var output = new FakeUint8Array(); output.set(new FakeUint8Array(), 0); // matches one of the overloads of set @@ -118,26 +120,26 @@ function foo() { " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "declare class Foo { - bar(x: \'hmm\'): number; + bar(x: 'hmm'): number; bar(x: string): string; } var foo = new Foo; -(foo.bar(\'hmm\'): number); // OK -(foo.bar(\'hmmm\'): number); // error +(foo.bar('hmm'): number); // OK +(foo.bar('hmmm'): number); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare class Foo { - bar(x: \"hmm\"): number, + bar(x: \\"hmm\\"): number, bar(x: string): string } var foo = new Foo(); -(foo.bar(\"hmm\"): number); // OK -(foo.bar(\"hmmm\"): number); // error +(foo.bar(\\"hmm\\"): number); // OK +(foo.bar(\\"hmmm\\"): number); // error " `; -exports[`test test3.js 1`] = ` +exports[`test3.js 1`] = ` "// passing a union-like thing into an overload is ok // if overload handles each branch of union-like thing @@ -184,17 +186,17 @@ h(x_h.p); // ok " `; -exports[`test union.js 1`] = ` +exports[`union.js 1`] = ` "function foo (x: $Either,U>): Array { return []; } var x1:number = foo(0)[0]; -var x2:string = foo([\"\"])[0]; +var x2:string = foo([\\"\\"])[0]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function foo(x: $Either, U>): Array { return []; } var x1: number = foo(0)[0]; -var x2: string = foo([\"\"])[0]; +var x2: string = foo([\\"\\"])[0]; " `; diff --git a/tests/flow/overload/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/overload/lib/__snapshots__/jsfmt.spec.js.snap index 22b1fa795..a4b3da9fb 100644 --- a/tests/flow/overload/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/overload/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test lib.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`lib.js 1`] = ` "declare class FakeUint8Array { set(index: number, value: number): void; set(array: FakeUint8Array | Array, offset?: number): void; diff --git a/tests/flow/parse/__snapshots__/jsfmt.spec.js.snap b/tests/flow/parse/__snapshots__/jsfmt.spec.js.snap index f36792e2f..9132e2aca 100644 --- a/tests/flow/parse/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/parse/__snapshots__/jsfmt.spec.js.snap @@ -1,26 +1,28 @@ -exports[`test no_parse_error.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`no_parse_error.js 1`] = ` "/* @flow */ -var x = \'Test\'; +var x = 'Test'; var y = 5 / x; var z: { type: number, y: string -} = {type: 1, y: \'hey\'}; +} = {type: 1, y: 'hey'}; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var x = \"Test\"; +var x = \\"Test\\"; var y = 5 / x; var z: { type: number, y: string -} = { type: 1, y: \"hey\" }; +} = { type: 1, y: \\"hey\\" }; " `; diff --git a/tests/flow/parse_error_haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/parse_error_haste/__snapshots__/jsfmt.spec.js.snap index 25681c2c9..c29fce308 100644 --- a/tests/flow/parse_error_haste/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/parse_error_haste/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test Client.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Client.js 1`] = ` "/** * Client imports some but not all modules, * triggering/suppressing parse errors. @@ -6,10 +8,10 @@ exports[`test Client.js 1`] = ` */ // non-flow files should not show parse errors -var A = require(\"Foo\"); // non-Flow file @providesModule Foo -var B = require(\"./NoProvides\"); // non-Flow file +var A = require(\\"Foo\\"); // non-Flow file @providesModule Foo +var B = require(\\"./NoProvides\\"); // non-Flow file -var C = require(\"./ParseError\"); // Flow file +var C = require(\\"./ParseError\\"); // Flow file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Client imports some but not all modules, @@ -18,9 +20,9 @@ var C = require(\"./ParseError\"); // Flow file */ // non-flow files should not show parse errors -var A = require(\"Foo\"); // non-Flow file @providesModule Foo -var B = require(\"./NoProvides\"); // non-Flow file +var A = require(\\"Foo\\"); // non-Flow file @providesModule Foo +var B = require(\\"./NoProvides\\"); // non-Flow file -var C = require(\"./ParseError\"); // Flow file +var C = require(\\"./ParseError\\"); // Flow file " `; diff --git a/tests/flow/parse_error_node/__snapshots__/jsfmt.spec.js.snap b/tests/flow/parse_error_node/__snapshots__/jsfmt.spec.js.snap index aa09d48dd..794d5d41e 100644 --- a/tests/flow/parse_error_node/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/parse_error_node/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test Client.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Client.js 1`] = ` "/** * Client imports some but not all modules, * triggering/suppressing parse errors. @@ -6,9 +8,9 @@ exports[`test Client.js 1`] = ` */ // non-flow files should not give parse errors -var A = require(\"./Imported\"); // non-Flow file @providesModule Foo +var A = require(\\"./Imported\\"); // non-Flow file @providesModule Foo -var B = require(\"./ParseError\"); // Flow file +var B = require(\\"./ParseError\\"); // Flow file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * Client imports some but not all modules, @@ -17,8 +19,8 @@ var B = require(\"./ParseError\"); // Flow file */ // non-flow files should not give parse errors -var A = require(\"./Imported\"); // non-Flow file @providesModule Foo +var A = require(\\"./Imported\\"); // non-Flow file @providesModule Foo -var B = require(\"./ParseError\"); // Flow file +var B = require(\\"./ParseError\\"); // Flow file " `; diff --git a/tests/flow/path/__snapshots__/jsfmt.spec.js.snap b/tests/flow/path/__snapshots__/jsfmt.spec.js.snap index 282608fed..967267362 100644 --- a/tests/flow/path/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/path/__snapshots__/jsfmt.spec.js.snap @@ -1,15 +1,17 @@ -exports[`test while.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`while.js 1`] = ` "var x = 1; -while(typeof x == \"number\" || typeof x == \"string\") { +while(typeof x == \\"number\\" || typeof x == \\"string\\") { x = x + 1; - if (true) x = \"\"; + if (true) x = \\"\\"; } var z:number = x; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var x = 1; -while (typeof x == \"number\" || typeof x == \"string\") { +while (typeof x == \\"number\\" || typeof x == \\"string\\") { x = x + 1; - if (true) x = \"\"; + if (true) x = \\"\\"; } var z: number = x; " diff --git a/tests/flow/plsummit/__snapshots__/jsfmt.spec.js.snap b/tests/flow/plsummit/__snapshots__/jsfmt.spec.js.snap index a45cfc412..5c941a0ac 100644 --- a/tests/flow/plsummit/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/plsummit/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test arrays.js 1`] = ` -"function foo(x) { return [x, x > 0, \"number \" + x]; } +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`arrays.js 1`] = ` +"function foo(x) { return [x, x > 0, \\"number \\" + x]; } var [n, b, s] = foo(42); n * s.length; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function foo(x) { - return [x, x > 0, \"number \" + x]; + return [x, x > 0, \\"number \\" + x]; } var [n, b, s] = foo(42); @@ -13,7 +15,7 @@ n * s.length; " `; -exports[`test export_class.js 1`] = ` +exports[`export_class.js 1`] = ` "class C { x: number; constructor(x: number) { this.x = x; } @@ -32,7 +34,7 @@ module.exports = C; " `; -exports[`test generics.js 1`] = ` +exports[`generics.js 1`] = ` "/* @flow */ var r: number = 0; @@ -48,18 +50,18 @@ function foo(x: X): X { " `; -exports[`test import_class.js 1`] = ` -"var C = require(\'./export_class\'); +exports[`import_class.js 1`] = ` +"var C = require('./export_class'); -var c = new C(\"\"); +var c = new C(\\"\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var C = require(\"./export_class\"); +var C = require(\\"./export_class\\"); -var c = new C(\"\"); +var c = new C(\\"\\"); " `; -exports[`test locals.js 1`] = ` +exports[`locals.js 1`] = ` "/* @flow */ function foo() { @@ -68,7 +70,7 @@ function foo() { } function bar(x: ?string): number { - if (x == null) x = \"\"; + if (x == null) x = \\"\\"; return x.length; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -80,13 +82,13 @@ function foo() { } function bar(x: ?string): number { - if (x == null) x = \"\"; + if (x == null) x = \\"\\"; return x.length; } " `; -exports[`test objects.js 1`] = ` +exports[`objects.js 1`] = ` "function C() { this.x = 0; } C.prototype.foo = function() { return this.x; } @@ -95,7 +97,7 @@ var x: string = c.foo(); function foo() { return this.y; } function bar() { return this.foo(); } -var o = { y: \"\", foo: foo, bar: bar }; +var o = { y: \\"\\", foo: foo, bar: bar }; var o2 = { y: 0, foo: foo, bar: bar }; o.bar(); @@ -117,7 +119,7 @@ function foo() { function bar() { return this.foo(); } -var o = { y: \"\", foo: foo, bar: bar }; +var o = { y: \\"\\", foo: foo, bar: bar }; var o2 = { y: 0, foo: foo, bar: bar }; o.bar(); diff --git a/tests/flow/poly/__snapshots__/jsfmt.spec.js.snap b/tests/flow/poly/__snapshots__/jsfmt.spec.js.snap index eaeb0ef07..48d7a7075 100644 --- a/tests/flow/poly/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/poly/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test annot.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`annot.js 1`] = ` "class A { } new A; // OK, implicitly inferred type args class B extends A { } // OK, same as above @@ -7,7 +9,7 @@ function foo(b): A { // ok but unsafe, caller may assume any type arg return b ? (new A: A): (new A: A); } -function bar(): A<*> { // error, * can\'t be {} and {x: string} at the same time +function bar(): A<*> { // error, * can't be {} and {x: string} at the same time return (new A: A<{}>) || (new A: A<{x: string}>); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -21,13 +23,13 @@ function foo(b): A { } function bar(): A<*> { - // error, * can\'t be {} and {x: string} at the same time + // error, * can't be {} and {x: string} at the same time return (new A(): A<{}>) || (new A(): A<{ x: string }>); } " `; -exports[`test implicit_bounded_instantiation.js 1`] = ` +exports[`implicit_bounded_instantiation.js 1`] = ` "// @flow class Base {} @@ -72,7 +74,7 @@ a.meth(new Base()); // Error: Base ~> Middle " `; -exports[`test issue-1029.js 1`] = ` +exports[`issue-1029.js 1`] = ` "// @flow // naive unification causes combinatorial explosion here, @@ -113,7 +115,7 @@ unbox(bool); " `; -exports[`test poly.js 1`] = ` +exports[`poly.js 1`] = ` "class Foo { x:T; constructor(x:T) { this.x = x; } @@ -131,7 +133,7 @@ declare var Q: { var foo = new Foo(0); var x:string = foo.x; -var z:Foo = Q.bar(foo,\"\"); +var z:Foo = Q.bar(foo,\\"\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class Foo { x: T; @@ -154,11 +156,11 @@ declare var Q: { var foo = new Foo(0); var x: string = foo.x; -var z: Foo = Q.bar(foo, \"\"); +var z: Foo = Q.bar(foo, \\"\\"); " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "class C { foo(x: X): X { return x; } foo_(x: X): number { return x; } diff --git a/tests/flow/poly_class_export/__snapshots__/jsfmt.spec.js.snap b/tests/flow/poly_class_export/__snapshots__/jsfmt.spec.js.snap index 9aa417947..db73d5173 100644 --- a/tests/flow/poly_class_export/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/poly_class_export/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "// @flow class A { @@ -17,10 +19,10 @@ module.exports = A; " `; -exports[`test B.js 1`] = ` +exports[`B.js 1`] = ` "// @flow -let A = require(\'./A\'); +let A = require('./A'); class B extends A { constructor() { @@ -32,7 +34,7 @@ module.exports = new B(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -let A = require(\"./A\"); +let A = require(\\"./A\\"); class B extends A { constructor() { @@ -44,10 +46,10 @@ module.exports = new B(); " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` "// @flow -// This test exports a function whose return type is the class\'s \`this\` type. +// This test exports a function whose return type is the class's \`this\` type. // It should be inferred (no annotation required). class Foo { @@ -62,7 +64,7 @@ export function f(x: Foo) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -// This test exports a function whose return type is the class\'s \`this\` type. +// This test exports a function whose return type is the class's \`this\` type. // It should be inferred (no annotation required). class Foo { diff --git a/tests/flow/poly_overload/decls/__snapshots__/jsfmt.spec.js.snap b/tests/flow/poly_overload/decls/__snapshots__/jsfmt.spec.js.snap index b6eae8e73..84559bd92 100644 --- a/tests/flow/poly_overload/decls/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/poly_overload/decls/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test typescript-deferred.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript-deferred.js 1`] = ` "interface Some {} interface Other { x: X; } interface None {} diff --git a/tests/flow/predicates-abstract/__snapshots__/jsfmt.spec.js.snap b/tests/flow/predicates-abstract/__snapshots__/jsfmt.spec.js.snap index 745490772..80832bdb6 100644 --- a/tests/flow/predicates-abstract/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/predicates-abstract/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test filter.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`filter.js 1`] = ` "// @flow // Filter the contents of an array @@ -10,7 +12,7 @@ const barr = my_filter(arr, is_string); (barr: Array); function is_string(x): %checks { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow @@ -27,12 +29,12 @@ const barr = my_filter(arr, is_string); (barr: Array); function is_string(x): %checks { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } " `; -exports[`test filter-union.js 1`] = ` +exports[`filter-union.js 1`] = ` "// @flow // Filter the contents of an array @@ -40,16 +42,16 @@ exports[`test filter-union.js 1`] = ` declare function my_filter>(v: Array, cb: P): Array<$Refine>; -type A = { kind: \'A\', u: number } -type B = { kind: \'B\', v: string } -type C = { kind: \'C\', y: boolean } -type D = { kind: \'D\', x: boolean } -type E = { kind: \'E\', y: boolean } +type A = { kind: 'A', u: number } +type B = { kind: 'B', v: string } +type C = { kind: 'C', y: boolean } +type D = { kind: 'D', x: boolean } +type E = { kind: 'E', y: boolean } declare var ab: Array; -(my_filter(ab, (x): %checks => x.kind === \'A\'): Array); // OK -(my_filter(ab, (x): %checks => x.kind !== \'A\'): Array); // OK +(my_filter(ab, (x): %checks => x.kind === 'A'): Array); // OK +(my_filter(ab, (x): %checks => x.kind !== 'A'): Array); // OK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow @@ -60,24 +62,24 @@ declare function my_filter>( cb: P ): Array<$Refine>; -type A = { kind: \"A\", u: number }; -type B = { kind: \"B\", v: string }; -type C = { kind: \"C\", y: boolean }; -type D = { kind: \"D\", x: boolean }; -type E = { kind: \"E\", y: boolean }; +type A = { kind: \\"A\\", u: number }; +type B = { kind: \\"B\\", v: string }; +type C = { kind: \\"C\\", y: boolean }; +type D = { kind: \\"D\\", x: boolean }; +type E = { kind: \\"E\\", y: boolean }; declare var ab: Array; -(my_filter(ab, (x): %checks => x.kind === \"A\"): Array); // OK -(my_filter(ab, (x): %checks => x.kind !== \"A\"): Array); // OK +(my_filter(ab, (x): %checks => x.kind === \\"A\\"): Array); // OK +(my_filter(ab, (x): %checks => x.kind !== \\"A\\"): Array); // OK " `; -exports[`test refine.js 1`] = ` +exports[`refine.js 1`] = ` "// @flow /* - $Pred is an \"abstract predicate type\", i.e. denotes a (function) type that + $Pred is an \\"abstract predicate type\\", i.e. denotes a (function) type that refines N variables. So if \`cb\` is a function, then it should be refining exactly N argument. It is abstract in that we do not need to specify: (a) which variables are going to be refined (just the number), or (b) what @@ -114,17 +116,17 @@ declare function refine2>(v: T, w: T, cb: P): $Refine; // { if (cb(v, w)) { return w; } else { throw new Error(); } } function is_string(x): boolean %checks { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } function is_string_and_number(x, y): %checks { - return typeof x === \"string\" && typeof y === \"number\"; + return typeof x === \\"string\\" && typeof y === \\"number\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow /* - $Pred is an \"abstract predicate type\", i.e. denotes a (function) type that + $Pred is an \\"abstract predicate type\\", i.e. denotes a (function) type that refines N variables. So if \`cb\` is a function, then it should be refining exactly N argument. It is abstract in that we do not need to specify: (a) which variables are going to be refined (just the number), or (b) what @@ -164,16 +166,16 @@ declare function refine2>(v: T, w: T, cb: P): $Refine; // { if (cb(v, w)) { return w; } else { throw new Error(); } } function is_string(x): boolean %checks { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } function is_string_and_number(x, y): %checks { - return typeof x === \"string\" && typeof y === \"number\"; + return typeof x === \\"string\\" && typeof y === \\"number\\"; } " `; -exports[`test sanity-filter.js 1`] = ` +exports[`sanity-filter.js 1`] = ` "// @flow declare function my_filter>(v: Array, cb: P): Array<$Refine>; @@ -190,11 +192,11 @@ const d = my_filter(c, is_string_regular); (d: Array); function is_string(x): boolean %checks { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } function is_string_regular(x): boolean { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow @@ -215,16 +217,16 @@ const d = my_filter(c, is_string_regular); (d: Array); function is_string(x): boolean %checks { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } function is_string_regular(x): boolean { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } " `; -exports[`test sanity-filter-union.js 1`] = ` +exports[`sanity-filter-union.js 1`] = ` "// @flow // Filter the contents of an array @@ -232,16 +234,16 @@ exports[`test sanity-filter-union.js 1`] = ` declare function my_filter>(v: Array, cb: P): Array<$Refine>; -type A = { kind: \'A\', u: number } -type B = { kind: \'B\', v: string } -type C = { kind: \'C\', y: boolean } -type D = { kind: \'D\', x: boolean } -type E = { kind: \'E\', y: boolean } +type A = { kind: 'A', u: number } +type B = { kind: 'B', v: string } +type C = { kind: 'C', y: boolean } +type D = { kind: 'D', x: boolean } +type E = { kind: 'E', y: boolean } declare var ab: Array; -(my_filter(ab, (x): %checks => x.kind === \'A\'): Array); // ERROR -(my_filter(ab, (x): %checks => x.kind !== \'A\'): Array); // ERROR +(my_filter(ab, (x): %checks => x.kind === 'A'): Array); // ERROR +(my_filter(ab, (x): %checks => x.kind !== 'A'): Array); // ERROR ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow @@ -252,20 +254,20 @@ declare function my_filter>( cb: P ): Array<$Refine>; -type A = { kind: \"A\", u: number }; -type B = { kind: \"B\", v: string }; -type C = { kind: \"C\", y: boolean }; -type D = { kind: \"D\", x: boolean }; -type E = { kind: \"E\", y: boolean }; +type A = { kind: \\"A\\", u: number }; +type B = { kind: \\"B\\", v: string }; +type C = { kind: \\"C\\", y: boolean }; +type D = { kind: \\"D\\", x: boolean }; +type E = { kind: \\"E\\", y: boolean }; declare var ab: Array; -(my_filter(ab, (x): %checks => x.kind === \"A\"): Array); // ERROR -(my_filter(ab, (x): %checks => x.kind !== \"A\"): Array); // ERROR +(my_filter(ab, (x): %checks => x.kind === \\"A\\"): Array); // ERROR +(my_filter(ab, (x): %checks => x.kind !== \\"A\\"): Array); // ERROR " `; -exports[`test sanity-refine.js 1`] = ` +exports[`sanity-refine.js 1`] = ` "// @flow // Sanity check A: the refinment position index is outside of the allowed range @@ -288,7 +290,7 @@ var e = refine3(c, d, e, is_string_and_number); (e: string); function is_string_and_number(x, y): %checks { - return typeof x === \"string\" && typeof y === \"number\"; + return typeof x === \\"string\\" && typeof y === \\"number\\"; } @@ -300,15 +302,15 @@ var e = refine(a, is_string_regular); // ERROR: is_string_regular is not a //////////////////////////////////////////////////////////////////////////////// function is_string(x): %checks { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } function is_string_regular(x) { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } function is_string_and_number(x, y): %checks { - return typeof x === \"string\" && typeof y === \"number\"; + return typeof x === \\"string\\" && typeof y === \\"number\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow @@ -337,7 +339,7 @@ var e = refine3(c, d, e, is_string_and_number); (e: string); function is_string_and_number(x, y): %checks { - return typeof x === \"string\" && typeof y === \"number\"; + return typeof x === \\"string\\" && typeof y === \\"number\\"; } // Sanity check C: expecting a predicate function but passed a non-predicate one @@ -348,15 +350,15 @@ var e = refine(a, is_string_regular); // ERROR: is_string_regular is not a //////////////////////////////////////////////////////////////////////////////// function is_string(x): %checks { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } function is_string_regular(x) { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } function is_string_and_number(x, y): %checks { - return typeof x === \"string\" && typeof y === \"number\"; + return typeof x === \\"string\\" && typeof y === \\"number\\"; } " `; diff --git a/tests/flow/predicates-declared/__snapshots__/jsfmt.spec.js.snap b/tests/flow/predicates-declared/__snapshots__/jsfmt.spec.js.snap index 1e9f8a684..f5607ea0a 100644 --- a/tests/flow/predicates-declared/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/predicates-declared/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test function-bind.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`function-bind.js 1`] = ` "// @flow // Sanity checks: @@ -37,7 +39,7 @@ class D { } declare var m: Function; -const x = \"\"; +const x = \\"\\"; if (m.bind(this)(x)) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow @@ -78,16 +80,16 @@ class D { } declare var m: Function; -const x = \"\"; +const x = \\"\\"; if (m.bind(this)(x)) { } " `; -exports[`test function-union.js 1`] = ` +exports[`function-union.js 1`] = ` "// @flow -declare function f1(x: mixed): boolean %checks(typeof x === \"string\"); +declare function f1(x: mixed): boolean %checks(typeof x === \\"string\\"); declare function f2(x: mixed): boolean %checks(Array.isArray(x)); declare var cond: boolean; @@ -106,7 +108,7 @@ function foo(x: number | string | Array): number { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -declare function f1(x: mixed): boolean %checks(typeof x === \"string\"); +declare function f1(x: mixed): boolean %checks(typeof x === \\"string\\"); declare function f2(x: mixed): boolean %checks(Array.isArray(x)); declare var cond: boolean; @@ -124,11 +126,11 @@ function foo(x: number | string | Array): number { " `; -exports[`test is-string-decl.js 1`] = ` +exports[`is-string-decl.js 1`] = ` "// @flow -declare function is_string(x: mixed): boolean %checks(typeof x === \"string\"); -declare function is_number(x: mixed): boolean %checks(typeof x === \"number\"); +declare function is_string(x: mixed): boolean %checks(typeof x === \\"string\\"); +declare function is_number(x: mixed): boolean %checks(typeof x === \\"number\\"); // Feature check: function foo(x: string | Array): string { @@ -146,8 +148,8 @@ function foo(x: string | Array): string { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -declare function is_string(x: mixed): boolean %checks(typeof x === \"string\"); -declare function is_number(x: mixed): boolean %checks(typeof x === \"number\"); +declare function is_string(x: mixed): boolean %checks(typeof x === \\"string\\"); +declare function is_number(x: mixed): boolean %checks(typeof x === \\"number\\"); // Feature check: function foo(x: string | Array): string { @@ -165,7 +167,7 @@ function foo(x: string | Array): string { " `; -exports[`test logical-or.js 1`] = ` +exports[`logical-or.js 1`] = ` "// @flow // Sanity check: @@ -173,11 +175,11 @@ exports[`test logical-or.js 1`] = ` // expressions (e.g. \`||\`) declare function r(x: string): number; -var s = \'a\'; +var s = 'a'; var n = r(s) || 1; (n: number); -var x = \"\"; +var x = \\"\\"; if (x = r(s) || 1) { (x: number); } @@ -196,11 +198,11 @@ function foo(x: mixed) { return 1; } // expressions (e.g. \`||\`) declare function r(x: string): number; -var s = \"a\"; +var s = \\"a\\"; var n = r(s) || 1; (n: number); -var x = \"\"; +var x = \\"\\"; if (x = r(s) || 1) { (x: number); } @@ -216,7 +218,7 @@ Number(dollars) || 0; " `; -exports[`test object-invariant.js 1`] = ` +exports[`object-invariant.js 1`] = ` "// @flow // Sanity check: @@ -233,13 +235,13 @@ type Invitee = { function f(_this: { m: ?Meeting }): string { if (!_this.m) { - return \"0\"; + return \\"0\\"; } if (_this.m.es.some((a) => a.fbid === 0)) { } - return \"3\"; + return \\"3\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow @@ -258,27 +260,27 @@ type Invitee = { function f(_this: { m: ?Meeting }): string { if (!_this.m) { - return \"0\"; + return \\"0\\"; } if (_this.m.es.some(a => a.fbid === 0)) { } - return \"3\"; + return \\"3\\"; } " `; -exports[`test orig-string-tag-check.js 1`] = ` +exports[`orig-string-tag-check.js 1`] = ` "// @flow // The original first-order case function foo(x: string | Array): string { - if (typeof x === \"string\") { - return x; // [ERROR] x: Array doesn\'t match return type + if (typeof x === \\"string\\") { + return x; // [ERROR] x: Array doesn't match return type } else { - return x.join(); // [ERROR] x: string doesn\'t have .join method + return x.join(); // [ERROR] x: string doesn't have .join method } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -287,16 +289,16 @@ function foo(x: string | Array): string { // The original first-order case function foo(x: string | Array): string { - if (typeof x === \"string\") { - return x; // [ERROR] x: Array doesn\'t match return type + if (typeof x === \\"string\\") { + return x; // [ERROR] x: Array doesn't match return type } else { - return x.join(); // [ERROR] x: string doesn\'t have .join method + return x.join(); // [ERROR] x: string doesn't have .join method } } " `; -exports[`test sanity-fall-through.js 1`] = ` +exports[`sanity-fall-through.js 1`] = ` "// @flow // Sanity check: @@ -306,7 +308,7 @@ declare function pred(x: T): boolean; function foo(s: Array): string { if (pred(s)) { - return \"1\"; + return \\"1\\"; } return 1; } @@ -320,14 +322,14 @@ declare function pred(x: T): boolean; function foo(s: Array): string { if (pred(s)) { - return \"1\"; + return \\"1\\"; } return 1; } " `; -exports[`test sanity-invalid-calls.js 1`] = ` +exports[`sanity-invalid-calls.js 1`] = ` "// @flow // Sanity check: @@ -338,14 +340,14 @@ declare function pred(x: T): boolean; function foo(s: Array): string { if ((1)(s)) { - return \"1\"; + return \\"1\\"; } - if ((pred + 1)(\"s\")) { - return \"1\"; + if ((pred + 1)(\\"s\\")) { + return \\"1\\"; } - return \"1\" + return \\"1\\" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow @@ -357,23 +359,23 @@ declare function pred(x: T): boolean; function foo(s: Array): string { if (1(s)) { - return \"1\"; + return \\"1\\"; } - if ((pred + 1)(\"s\")) { - return \"1\"; + if ((pred + 1)(\\"s\\")) { + return \\"1\\"; } - return \"1\"; + return \\"1\\"; } " `; -exports[`test sanity-is-string-bug.js 1`] = ` +exports[`sanity-is-string-bug.js 1`] = ` "// @flow -declare function is_string(x: mixed): boolean %checks(typeof x === \"string\"); -declare function is_number(x: mixed): boolean %checks(typeof x === \"number\"); +declare function is_string(x: mixed): boolean %checks(typeof x === \\"string\\"); +declare function is_number(x: mixed): boolean %checks(typeof x === \\"number\\"); // Sanity check: // - Erroneous logic @@ -388,8 +390,8 @@ function bar(x: string | Array): string { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -declare function is_string(x: mixed): boolean %checks(typeof x === \"string\"); -declare function is_number(x: mixed): boolean %checks(typeof x === \"number\"); +declare function is_string(x: mixed): boolean %checks(typeof x === \\"string\\"); +declare function is_number(x: mixed): boolean %checks(typeof x === \\"number\\"); // Sanity check: // - Erroneous logic @@ -404,7 +406,7 @@ function bar(x: string | Array): string { " `; -exports[`test sanity-parameter-mismatch.js 1`] = ` +exports[`sanity-parameter-mismatch.js 1`] = ` "// @flow // Sanity check: make sure the parameters are checked as usual @@ -412,7 +414,7 @@ exports[`test sanity-parameter-mismatch.js 1`] = ` declare function foo( input: mixed, types: string | Array -): boolean %checks(typeof input === \"string\" || Array.isArray(input)); +): boolean %checks(typeof input === \\"string\\" || Array.isArray(input)); foo(3, 3); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -423,27 +425,27 @@ foo(3, 3); declare function foo( input: mixed, types: string | Array -): boolean %checks(typeof input === \"string\" || Array.isArray(input)); +): boolean %checks(typeof input === \\"string\\" || Array.isArray(input)); foo(3, 3); " `; -exports[`test sanity-pred-with-body.js 1`] = ` +exports[`sanity-pred-with-body.js 1`] = ` "// @flow // Sanity check: // - predicate functions cannot have bodies (can only be declarations) -function pred(x: mixed): boolean %checks(typeof x === \"string\") { // error: cannot use pred type here - return typeof x === \"string\"; +function pred(x: mixed): boolean %checks(typeof x === \\"string\\") { // error: cannot use pred type here + return typeof x === \\"string\\"; } function foo(x: string | Array): string { if (pred(x)) { return x; } - return \"1\" + return \\"1\\" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow @@ -451,21 +453,21 @@ function foo(x: string | Array): string { // Sanity check: // - predicate functions cannot have bodies (can only be declarations) -function pred(x: mixed): boolean %checks(typeof x === \"string\") { +function pred(x: mixed): boolean %checks(typeof x === \\"string\\") { // error: cannot use pred type here - return typeof x === \"string\"; + return typeof x === \\"string\\"; } function foo(x: string | Array): string { if (pred(x)) { return x; } - return \"1\"; + return \\"1\\"; } " `; -exports[`test sanity-return-type.js 1`] = ` +exports[`sanity-return-type.js 1`] = ` "// @flow declare function f2(x: mixed): string %checks(Array.isArray(x)); diff --git a/tests/flow/predicates-inferred/__snapshots__/jsfmt.spec.js.snap b/tests/flow/predicates-inferred/__snapshots__/jsfmt.spec.js.snap index 984cd45bf..719c9d226 100644 --- a/tests/flow/predicates-inferred/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/predicates-inferred/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test sanity.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`sanity.js 1`] = ` "// @flow -// Sanity check: shouldn\'t be allowed to declare a predicate AND use \`chekcs\` +// Sanity check: shouldn't be allowed to declare a predicate AND use \`chekcs\` -function check(y): %checks(typeof y === \"string\") { - return typeof y === \"number\"; +function check(y): %checks(typeof y === \\"string\\") { + return typeof y === \\"number\\"; } declare var y: number | boolean; @@ -16,7 +18,7 @@ if (check(y)) { // Sanity: disallowed body function indirect_is_number(y): %checks { var y = 1; - return typeof y === \"number\"; + return typeof y === \\"number\\"; } function bak(z: string | number): number { @@ -29,10 +31,10 @@ function bak(z: string | number): number { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -// Sanity check: shouldn\'t be allowed to declare a predicate AND use \`chekcs\` +// Sanity check: shouldn't be allowed to declare a predicate AND use \`chekcs\` -function check(y): %checks(typeof y === \"string\") { - return typeof y === \"number\"; +function check(y): %checks(typeof y === \\"string\\") { + return typeof y === \\"number\\"; } declare var y: number | boolean; @@ -44,7 +46,7 @@ if (check(y)) { // Sanity: disallowed body function indirect_is_number(y): %checks { var y = 1; - return typeof y === \"number\"; + return typeof y === \\"number\\"; } function bak(z: string | number): number { @@ -57,16 +59,16 @@ function bak(z: string | number): number { " `; -exports[`test sanity-multi-params.js 1`] = ` +exports[`sanity-multi-params.js 1`] = ` "// @flow // Feature: multi params function multi_param(w,x,y,z): %checks { - return typeof z === \"string\"; + return typeof z === \\"string\\"; } function foo(x: string | Array): string { - if (multi_param(\"1\", \"2\", x, \"3\")) { + if (multi_param(\\"1\\", \\"2\\", x, \\"3\\")) { return x; } else { return x.join(); @@ -77,11 +79,11 @@ function foo(x: string | Array): string { // Feature: multi params function multi_param(w, x, y, z): %checks { - return typeof z === \"string\"; + return typeof z === \\"string\\"; } function foo(x: string | Array): string { - if (multi_param(\"1\", \"2\", x, \"3\")) { + if (multi_param(\\"1\\", \\"2\\", x, \\"3\\")) { return x; } else { return x.join(); @@ -90,7 +92,7 @@ function foo(x: string | Array): string { " `; -exports[`test sanity-ordering.js 1`] = ` +exports[`sanity-ordering.js 1`] = ` "// @flow declare var key: string; @@ -101,8 +103,8 @@ if (dotAccess(obj)) { } function dotAccess(head, create) { - const path = \'path.location\'; - const stack = path.split(\'.\'); + const path = 'path.location'; + const stack = path.split('.'); do { const key = stack.shift(); head = head[key] || create && (head[key] = {}); @@ -120,8 +122,8 @@ if (dotAccess(obj)) { } function dotAccess(head, create) { - const path = \"path.location\"; - const stack = path.split(\".\"); + const path = \\"path.location\\"; + const stack = path.split(\\".\\"); do { const key = stack.shift(); head = head[key] || create && (head[key] = {}); @@ -131,7 +133,7 @@ function dotAccess(head, create) { " `; -exports[`test sanity-unbound-var.js 1`] = ` +exports[`sanity-unbound-var.js 1`] = ` "// @flow declare var y: mixed; @@ -139,7 +141,7 @@ declare var y: mixed; // Sanity check: this should fail, because the preficate function // checks \`y\` instead of \`x\`. function err(x): %checks { - return typeof y === \"string\"; + return typeof y === \\"string\\"; } function foo(x: string | Array): string { @@ -157,7 +159,7 @@ declare var y: mixed; // Sanity check: this should fail, because the preficate function // checks \`y\` instead of \`x\`. function err(x): %checks { - return typeof y === \"string\"; + return typeof y === \\"string\\"; } function foo(x: string | Array): string { @@ -170,19 +172,19 @@ function foo(x: string | Array): string { " `; -exports[`test simple-predicate-func.js 1`] = ` +exports[`simple-predicate-func.js 1`] = ` "// @flow function is_string(y): %checks { - return typeof y === \"string\"; + return typeof y === \\"string\\"; } function is_bool(y): %checks { - return typeof y === \"boolean\"; + return typeof y === \\"boolean\\"; } function is_number(y): %checks { - return typeof y === \"number\"; + return typeof y === \\"number\\"; } // Feature check: @@ -222,11 +224,11 @@ function baz(z: string | number): number { // Feature: multi params function multi_param(w,x,y,z): %checks { - return typeof z === \"string\"; + return typeof z === \\"string\\"; } function foo(x: string | Array): string { - if (multi_param(\"1\", \"2\", \"3\", x)) { + if (multi_param(\\"1\\", \\"2\\", \\"3\\", x)) { return x; } else { return x.join(); @@ -248,15 +250,15 @@ declare function from_two_strings(x: string, y: string): void; // @flow function is_string(y): %checks { - return typeof y === \"string\"; + return typeof y === \\"string\\"; } function is_bool(y): %checks { - return typeof y === \"boolean\"; + return typeof y === \\"boolean\\"; } function is_number(y): %checks { - return typeof y === \"number\"; + return typeof y === \\"number\\"; } // Feature check: @@ -296,11 +298,11 @@ function baz(z: string | number): number { // Feature: multi params function multi_param(w, x, y, z): %checks { - return typeof z === \"string\"; + return typeof z === \\"string\\"; } function foo(x: string | Array): string { - if (multi_param(\"1\", \"2\", \"3\", x)) { + if (multi_param(\\"1\\", \\"2\\", \\"3\\", x)) { return x; } else { return x.join(); @@ -321,7 +323,7 @@ declare function from_two_strings(x: string, y: string): void; " `; -exports[`test simple-predicate-func-post.js 1`] = ` +exports[`simple-predicate-func-post.js 1`] = ` "// @flow // Feature check: @@ -341,7 +343,7 @@ function foo(x: string | Array): string { } function is_string(x): %checks { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow @@ -363,7 +365,7 @@ function foo(x: string | Array): string { } function is_string(x): %checks { - return typeof x === \"string\"; + return typeof x === \\"string\\"; } " `; diff --git a/tests/flow/predicates-parsing/__snapshots__/jsfmt.spec.js.snap b/tests/flow/predicates-parsing/__snapshots__/jsfmt.spec.js.snap index a62065f6d..c99f4ab08 100644 --- a/tests/flow/predicates-parsing/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/predicates-parsing/__snapshots__/jsfmt.spec.js.snap @@ -1,19 +1,21 @@ -exports[`test fail-0.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`fail-0.js 1`] = ` "// @flow -// Error: \'declare\', \'checks\' but missing predicate +// Error: 'declare', 'checks' but missing predicate declare function f2(x: mixed): boolean %checks; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -// Error: \'declare\', \'checks\' but missing predicate +// Error: 'declare', 'checks' but missing predicate declare function f2(x: mixed): boolean %checks; " `; -exports[`test fail-1.js 1`] = ` +exports[`fail-1.js 1`] = ` "// @flow // Error: no return statement @@ -28,7 +30,7 @@ function f6(x: mixed): %checks(x !== null) {} " `; -exports[`test fail-2.js 1`] = ` +exports[`fail-2.js 1`] = ` "// @flow var a2 = (x: mixed): %checks (x !== null) => { // Error: body form @@ -45,7 +47,7 @@ var a2 = (x: mixed): %checks(x !== null) => { " `; -exports[`test fail-3.js 1`] = ` +exports[`fail-3.js 1`] = ` "// @flow // Cannot declare predicate with a function body is present. @@ -66,7 +68,7 @@ var a2 = (x: mixed): %checks(x !== null) => x !== null; " `; -exports[`test pass.js 1`] = ` +exports[`pass.js 1`] = ` "// @flow declare function f1(x: mixed): boolean; diff --git a/tests/flow/private/__snapshots__/jsfmt.spec.js.snap b/tests/flow/private/__snapshots__/jsfmt.spec.js.snap index 39d08444b..363cb23b2 100644 --- a/tests/flow/private/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/private/__snapshots__/jsfmt.spec.js.snap @@ -1,9 +1,11 @@ -exports[`test private.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`private.js 1`] = ` "class A { x: number; _x: string; __x: number; - constructor() { this.x = 0; this._x = \"\"; this.__x = 0; } + constructor() { this.x = 0; this._x = \\"\\"; this.__x = 0; } } class B extends A { @@ -20,7 +22,7 @@ class A { __x: number; constructor() { this.x = 0; - this._x = \"\"; + this._x = \\"\\"; this.__x = 0; } } diff --git a/tests/flow/promises/__snapshots__/jsfmt.spec.js.snap b/tests/flow/promises/__snapshots__/jsfmt.spec.js.snap index abd7104a9..f2d5f1915 100644 --- a/tests/flow/promises/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/promises/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test all.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`all.js 1`] = ` "// @flow declare var pstr: Promise; @@ -81,12 +83,12 @@ function tes2(val: Map>) { " `; -exports[`test covariance.js 1`] = ` +exports[`covariance.js 1`] = ` "/* @flow */ async function testAll() { /* This is a test case from https://github.com/facebook/flow/issues/1143 - * which was previously an error due to Array\'s invariance and an improper + * which was previously an error due to Array's invariance and an improper * definition of Promise.all */ const x: Array> = []; const y: Promise> = Promise.all(x); @@ -103,7 +105,7 @@ async function testRace() { async function testAll() { /* This is a test case from https://github.com/facebook/flow/issues/1143 - * which was previously an error due to Array\'s invariance and an improper + * which was previously an error due to Array's invariance and an improper * definition of Promise.all */ const x: Array> = []; const y: Promise> = Promise.all(x); @@ -118,7 +120,7 @@ async function testRace() { " `; -exports[`test promise.js 1`] = ` +exports[`promise.js 1`] = ` "/** * @flow */ @@ -173,10 +175,10 @@ new Promise(function(resolve, reject) { if (Math.random()) { resolve(42); } else { - resolve(\'str\'); + resolve('str'); } }).then(function(numOrStr) { - if (typeof numOrStr === \'string\') { + if (typeof numOrStr === 'string') { var a: string = numOrStr; } else { var b: number = numOrStr; @@ -215,10 +217,10 @@ new Promise(function(resolve, reject) { if (Math.random()) { reject(42); } else { - reject(\'str\'); + reject('str'); } }).catch(function(numOrStr) { - if (typeof numOrStr === \'string\') { + if (typeof numOrStr === 'string') { var a: string = numOrStr; } else { var b: number = numOrStr; @@ -276,7 +278,7 @@ Promise.reject(Promise.resolve(0)).then(function(num) { // resolvedPromise.then():T -> then(T) Promise.resolve(0) - .then(function(num) { return \'asdf\'; }) + .then(function(num) { return 'asdf'; }) .then(function(str) { var a: string = str; var b: number = str; // Error: string ~> number @@ -284,7 +286,7 @@ Promise.resolve(0) // resolvedPromise.then():Promise -> then(T) Promise.resolve(0) - .then(function(num) { return Promise.resolve(\'asdf\'); }) + .then(function(num) { return Promise.resolve('asdf'); }) .then(function(str) { var a: string = str; var b: number = str; // Error: string ~> number @@ -292,7 +294,7 @@ Promise.resolve(0) // resolvedPromise.then():Promise> -> then(T) Promise.resolve(0) - .then(function(num) { return Promise.resolve(Promise.resolve(\'asdf\')); }) + .then(function(num) { return Promise.resolve(Promise.resolve('asdf')); }) .then(function(str) { var a: string = str; var b: number = str; // Error: string ~> number @@ -301,7 +303,7 @@ Promise.resolve(0) // TODO: resolvedPromise.then() -> catch(T) Promise.resolve(0) .then(function(num) { - throw \'str\'; + throw 'str'; }) .catch(function(str) { var a: string = str; @@ -316,7 +318,7 @@ Promise.resolve(0) // rejectedPromise.catch():U -> then(U) Promise.reject(0) - .catch(function(num) { return \'asdf\'; }) + .catch(function(num) { return 'asdf'; }) .then(function(str) { var a: string = str; var b: number = str; // Error: string ~> number @@ -324,7 +326,7 @@ Promise.reject(0) // rejectedPromise.catch():Promise -> then(U) Promise.reject(0) - .catch(function(num) { return Promise.resolve(\'asdf\'); }) + .catch(function(num) { return Promise.resolve('asdf'); }) .then(function(str) { var a: string = str; var b: number = str; // Error: string ~> number @@ -332,7 +334,7 @@ Promise.reject(0) // rejectedPromise.catch():Promise> -> then(U) Promise.reject(0) - .catch(function(num) { return Promise.resolve(Promise.resolve(\'asdf\')); }) + .catch(function(num) { return Promise.resolve(Promise.resolve('asdf')); }) .then(function(str) { var a: string = str; var b: number = str; // Error: string ~> number @@ -407,10 +409,10 @@ new Promise(function(resolve, reject) { if (Math.random()) { resolve(42); } else { - resolve(\"str\"); + resolve(\\"str\\"); } }).then(function(numOrStr) { - if (typeof numOrStr === \"string\") { + if (typeof numOrStr === \\"string\\") { var a: string = numOrStr; } else { var b: number = numOrStr; @@ -451,10 +453,10 @@ new Promise(function(resolve, reject) { if (Math.random()) { reject(42); } else { - reject(\"str\"); + reject(\\"str\\"); } }).catch(function(numOrStr) { - if (typeof numOrStr === \"string\") { + if (typeof numOrStr === \\"string\\") { var a: string = numOrStr; } else { var b: number = numOrStr; @@ -513,7 +515,7 @@ Promise.reject(Promise.resolve(0)).then(function(num) { // resolvedPromise.then():T -> then(T) Promise.resolve(0) .then(function(num) { - return \"asdf\"; + return \\"asdf\\"; }) .then(function(str) { var a: string = str; @@ -523,7 +525,7 @@ Promise.resolve(0) // resolvedPromise.then():Promise -> then(T) Promise.resolve(0) .then(function(num) { - return Promise.resolve(\"asdf\"); + return Promise.resolve(\\"asdf\\"); }) .then(function(str) { var a: string = str; @@ -533,7 +535,7 @@ Promise.resolve(0) // resolvedPromise.then():Promise> -> then(T) Promise.resolve(0) .then(function(num) { - return Promise.resolve(Promise.resolve(\"asdf\")); + return Promise.resolve(Promise.resolve(\\"asdf\\")); }) .then(function(str) { var a: string = str; @@ -543,7 +545,7 @@ Promise.resolve(0) // TODO: resolvedPromise.then() -> catch(T) Promise.resolve(0) .then(function(num) { - throw \"str\"; + throw \\"str\\"; }) .catch(function(str) { var a: string = str; @@ -559,7 +561,7 @@ Promise.resolve(0) // rejectedPromise.catch():U -> then(U) Promise.reject(0) .catch(function(num) { - return \"asdf\"; + return \\"asdf\\"; }) .then(function(str) { var a: string = str; @@ -569,7 +571,7 @@ Promise.reject(0) // rejectedPromise.catch():Promise -> then(U) Promise.reject(0) .catch(function(num) { - return Promise.resolve(\"asdf\"); + return Promise.resolve(\\"asdf\\"); }) .then(function(str) { var a: string = str; @@ -579,7 +581,7 @@ Promise.reject(0) // rejectedPromise.catch():Promise> -> then(U) Promise.reject(0) .catch(function(num) { - return Promise.resolve(Promise.resolve(\"asdf\")); + return Promise.resolve(Promise.resolve(\\"asdf\\")); }) .then(function(str) { var a: string = str; @@ -596,7 +598,7 @@ Promise.resolve(0).catch(function(err) {}).then(function(num) { " `; -exports[`test resolve_global.js 1`] = ` +exports[`resolve_global.js 1`] = ` "/** * test Promise name resolution * @flow @@ -612,7 +614,7 @@ class Promise {} */ async function foo(x: boolean) { if (x) { - return {bar: \'baz\'}; + return {bar: 'baz'}; } else { return null; } @@ -654,7 +656,7 @@ class Promise {} */ async function foo(x: boolean) { if (x) { - return { bar: \"baz\" }; + return { bar: \\"baz\\" }; } else { return null; } @@ -683,7 +685,7 @@ async function baz(): Promise { " `; -exports[`test resolve_void.js 1`] = ` +exports[`resolve_void.js 1`] = ` "// @flow (Promise.resolve(): Promise); // error diff --git a/tests/flow/pure_component/__snapshots__/jsfmt.spec.js.snap b/tests/flow/pure_component/__snapshots__/jsfmt.spec.js.snap index 8ed4c953f..cbf8baad6 100644 --- a/tests/flow/pure_component/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/pure_component/__snapshots__/jsfmt.spec.js.snap @@ -1,12 +1,14 @@ -exports[`test test.js 1`] = ` -"var React = require(\'react\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` +"var React = require('react'); class C extends React.PureComponent { props: { x: number }; } (); // error (\`x\` is a required prop) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var React = require(\"react\"); +var React = require(\\"react\\"); class C extends React.PureComponent { props: { x: number }; diff --git a/tests/flow/qualified/__snapshots__/jsfmt.spec.js.snap b/tests/flow/qualified/__snapshots__/jsfmt.spec.js.snap index ce5a3a1d2..78ab0f044 100644 --- a/tests/flow/qualified/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/qualified/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test qualified.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`qualified.js 1`] = ` "class C { } var M = { C: C }; @@ -10,7 +12,7 @@ declare var of_type_foo: foo; type bar = typeof of_type_foo.bar; var a: bar = 42; -var b: bar = \'asdf\'; // Error: string ~> number +var b: bar = 'asdf'; // Error: string ~> number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class C {} var M = { C: C }; @@ -23,6 +25,6 @@ declare var of_type_foo: foo; type bar = typeof of_type_foo.bar; var a: bar = 42; -var b: bar = \"asdf\"; // Error: string ~> number +var b: bar = \\"asdf\\"; // Error: string ~> number " `; diff --git a/tests/flow/react/__snapshots__/jsfmt.spec.js.snap b/tests/flow/react/__snapshots__/jsfmt.spec.js.snap index e3190c87c..5cbf44da0 100644 --- a/tests/flow/react/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/react/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test ArityError.react.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ArityError.react.js 1`] = ` "/** * @providesModule ArityError.react */ -var React = require(\'react\'); +var React = require('react'); var AudienceInsightsContainer = React.createClass({ renderComponent(AudienceInsights: ReactClass<*>) { return ; @@ -14,7 +16,7 @@ module.exports = AudienceInsightsContainer; /** * @providesModule ArityError.react */ -var React = require(\"react\"); +var React = require(\\"react\\"); var AudienceInsightsContainer = React.createClass({ renderComponent(AudienceInsights: ReactClass<*>) { return ; @@ -25,36 +27,36 @@ module.exports = AudienceInsightsContainer; " `; -exports[`test createElement_string.js 1`] = ` +exports[`createElement_string.js 1`] = ` "// @flow -import React from \'react\'; +import React from 'react'; class Bar extends React.Component {} class Foo extends React.Component { render() { - const Cmp = Math.random() < 0.5 ? \'div\' : Bar; + const Cmp = Math.random() < 0.5 ? 'div' : Bar; return (); } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import React from \"react\"; +import React from \\"react\\"; class Bar extends React.Component {} class Foo extends React.Component { render() { - const Cmp = Math.random() < 0.5 ? \"div\" : Bar; + const Cmp = Math.random() < 0.5 ? \\"div\\" : Bar; return ; } } " `; -exports[`test createElementRequiredProp_string.js 1`] = ` +exports[`createElementRequiredProp_string.js 1`] = ` "// @flow -import React from \'react\'; +import React from 'react'; class Bar extends React.Component { props: { @@ -71,13 +73,13 @@ class Bar extends React.Component { class Foo extends React.Component { render() { - const Cmp = Math.random() < 0.5 ? \'div\' : Bar; + const Cmp = Math.random() < 0.5 ? 'div' : Bar; return (); } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import React from \"react\"; +import React from \\"react\\"; class Bar extends React.Component { props: { @@ -94,36 +96,36 @@ class Bar extends React.Component { class Foo extends React.Component { render() { - const Cmp = Math.random() < 0.5 ? \"div\" : Bar; + const Cmp = Math.random() < 0.5 ? \\"div\\" : Bar; return ; } } " `; -exports[`test import_react.js 1`] = ` +exports[`import_react.js 1`] = ` "/* @flow */ -import react from \"react\"; -import {Component} from \"react\"; +import react from \\"react\\"; +import {Component} from \\"react\\"; var a: Component<*,*,*> = new react.Component(); var b: number = new react.Component(); // Error: ReactComponent ~> number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -import react from \"react\"; -import { Component } from \"react\"; +import react from \\"react\\"; +import { Component } from \\"react\\"; var a: Component<*, *, *> = new react.Component(); var b: number = new react.Component(); // Error: ReactComponent ~> number " `; -exports[`test jsx_spread.js 1`] = ` +exports[`jsx_spread.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); var Foo = React.createClass({ propTypes: { bar: React.PropTypes.string.isRequired, @@ -135,7 +137,7 @@ var blah = ; // error bar, number given string expected ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); var Foo = React.createClass({ propTypes: { bar: React.PropTypes.string.isRequired @@ -147,10 +149,10 @@ var blah = ; // error bar, number given string expected " `; -exports[`test proptype_arrayOf.js 1`] = ` +exports[`proptype_arrayOf.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); var Example = React.createClass({ propTypes: { arr: React.PropTypes.arrayOf(React.PropTypes.number).isRequired @@ -161,11 +163,11 @@ var ok_empty = var ok_numbers = var fail_not_array = -var fail_mistyped_elems = +var fail_mistyped_elems = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); var Example = React.createClass({ propTypes: { arr: React.PropTypes.arrayOf(React.PropTypes.number).isRequired @@ -176,14 +178,14 @@ var ok_empty = ; var ok_numbers = ; var fail_not_array = ; -var fail_mistyped_elems = ; +var fail_mistyped_elems = ; " `; -exports[`test proptype_func.js 1`] = ` +exports[`proptype_func.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); var Example = React.createClass({ propTypes: { func: React.PropTypes.func.isRequired @@ -198,7 +200,7 @@ var fail_mistyped = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); var Example = React.createClass({ propTypes: { func: React.PropTypes.func.isRequired @@ -213,13 +215,13 @@ var fail_mistyped = ; " `; -exports[`test proptype_missing.js 1`] = ` +exports[`proptype_missing.js 1`] = ` "/* @flow */ -/* If you create a react component with createClass() but don\'t specify the +/* If you create a react component with createClass() but don't specify the * propTypes, what should the type of props be? * - * It used to be an empty object, but we didn\'t enforce that correctly, so + * It used to be an empty object, but we didn't enforce that correctly, so * people could do whatever they wanted with this.props. * * As of 0.21.0 it started to be an error when people used this.props in a @@ -227,15 +229,15 @@ exports[`test proptype_missing.js 1`] = ` * enforced, so glevi changed this.props to be Object by default. * * We may change this back to the empty object at some point and fix the - * situations where it didn\'t used to error + * situations where it didn't used to error */ var React = React.createClass({ getID(): string { - // So this would have been an error in 0.21.0 if we didn\'t make this.props + // So this would have been an error in 0.21.0 if we didn't make this.props // Object switch (this.props.name) { - case \'a\': return \'Bob\'; - default: return \'Alice\'; + case 'a': return 'Bob'; + default: return 'Alice'; } }, @@ -247,10 +249,10 @@ var React = React.createClass({ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -/* If you create a react component with createClass() but don\'t specify the +/* If you create a react component with createClass() but don't specify the * propTypes, what should the type of props be? * - * It used to be an empty object, but we didn\'t enforce that correctly, so + * It used to be an empty object, but we didn't enforce that correctly, so * people could do whatever they wanted with this.props. * * As of 0.21.0 it started to be an error when people used this.props in a @@ -258,17 +260,17 @@ var React = React.createClass({ * enforced, so glevi changed this.props to be Object by default. * * We may change this back to the empty object at some point and fix the - * situations where it didn\'t used to error + * situations where it didn't used to error */ var React = React.createClass({ getID(): string { - // So this would have been an error in 0.21.0 if we didn\'t make this.props + // So this would have been an error in 0.21.0 if we didn't make this.props // Object switch (this.props.name) { - case \"a\": - return \"Bob\"; + case \\"a\\": + return \\"Bob\\"; default: - return \"Alice\"; + return \\"Alice\\"; } }, @@ -280,10 +282,10 @@ var React = React.createClass({ " `; -exports[`test proptype_object.js 1`] = ` +exports[`proptype_object.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); var Example = React.createClass({ propTypes: { object: React.PropTypes.object.isRequired @@ -291,13 +293,13 @@ var Example = React.createClass({ }); var ok_empty = ; -var ok_props = ; +var ok_props = ; var fail_mistyped = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); var Example = React.createClass({ propTypes: { object: React.PropTypes.object.isRequired @@ -305,16 +307,16 @@ var Example = React.createClass({ }); var ok_empty = ; -var ok_props = ; +var ok_props = ; var fail_mistyped = ; " `; -exports[`test proptype_objectOf.js 1`] = ` +exports[`proptype_objectOf.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); var Example = React.createClass({ propTypes: { obj: React.PropTypes.objectOf(React.PropTypes.number).isRequired @@ -325,11 +327,11 @@ var ok_empty = var ok_numbers = var fail_not_object = -var fail_mistyped_props = +var fail_mistyped_props = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); var Example = React.createClass({ propTypes: { obj: React.PropTypes.objectOf(React.PropTypes.number).isRequired @@ -340,41 +342,41 @@ var ok_empty = ; var ok_numbers = ; var fail_not_object = ; -var fail_mistyped_props = ; +var fail_mistyped_props = ; " `; -exports[`test proptype_oneOf.js 1`] = ` +exports[`proptype_oneOf.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); var Example = React.createClass({ propTypes: { - literal: React.PropTypes.oneOf([\"foo\"]).isRequired + literal: React.PropTypes.oneOf([\\"foo\\"]).isRequired }, }); -var ex1 = ; -var ex2 = ; +var ex1 = ; +var ex2 = ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); var Example = React.createClass({ propTypes: { - literal: React.PropTypes.oneOf([\"foo\"]).isRequired + literal: React.PropTypes.oneOf([\\"foo\\"]).isRequired } }); -var ex1 = ; -var ex2 = ; +var ex1 = ; +var ex2 = ; " `; -exports[`test proptype_oneOfType.js 1`] = ` +exports[`proptype_oneOfType.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); var Example = React.createClass({ propTypes: { prop: React.PropTypes.oneOfType([ @@ -383,7 +385,7 @@ var Example = React.createClass({ ]).isRequired }, render() { - if (typeof this.props.prop === \"string\") { + if (typeof this.props.prop === \\"string\\") { return
{this.props.prop}
} else { return
{this.props.prop.toFixed(2)}
@@ -392,13 +394,13 @@ var Example = React.createClass({ }); var ok_number = ; -var ok_string = ; +var ok_string = ; var fail_bool = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); var Example = React.createClass({ propTypes: { prop: React.PropTypes.oneOfType([ @@ -407,7 +409,7 @@ var Example = React.createClass({ ]).isRequired }, render() { - if (typeof this.props.prop === \"string\") { + if (typeof this.props.prop === \\"string\\") { return
{this.props.prop}
; } else { return
{this.props.prop.toFixed(2)}
; @@ -416,7 +418,7 @@ var Example = React.createClass({ }); var ok_number = ; -var ok_string = ; +var ok_string = ; var fail_bool = ; " diff --git a/tests/flow/react_functional/__snapshots__/jsfmt.spec.js.snap b/tests/flow/react_functional/__snapshots__/jsfmt.spec.js.snap index 1eddc5db0..5220665d9 100644 --- a/tests/flow/react_functional/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/react_functional/__snapshots__/jsfmt.spec.js.snap @@ -1,28 +1,30 @@ -exports[`test test.js 1`] = ` -"import React from \"react\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` +"import React from \\"react\\"; function F(props: { foo: string }) {} ; // error: missing \`foo\` ; // error: number ~> string -; // ok +; // ok // props subtyping is property-wise covariant function G(props: { foo: string|numner }) {} -; // ok +; // ok var Z = 0; ; // error, expected React component ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import React from \"react\"; +import React from \\"react\\"; function F(props: { foo: string }) {} ; /* error: missing \`foo\`*/ ; /* error: number ~> string*/ -; // ok +; // ok // props subtyping is property-wise covariant function G(props: { foo: string | numner }) {} -; // ok +; // ok var Z = 0; ; // error, expected React component diff --git a/tests/flow/react_modules/__snapshots__/jsfmt.spec.js.snap b/tests/flow/react_modules/__snapshots__/jsfmt.spec.js.snap index b92ca2221..de9496c13 100644 --- a/tests/flow/react_modules/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/react_modules/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,9 @@ -exports[`test createclass-callsite.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`createclass-callsite.js 1`] = ` "/* @flow */ -var React = require(\'react\'); -var Hello = require(\'./createclass-module\'); +var React = require('react'); +var Hello = require('./createclass-module'); var HelloLocal = React.createClass({ propTypes: { @@ -27,8 +29,8 @@ var Callsite = React.createClass({ module.exports = Callsite; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); -var Hello = require(\"./createclass-module\"); +var React = require(\\"react\\"); +var Hello = require(\\"./createclass-module\\"); var HelloLocal = React.createClass({ propTypes: { @@ -55,9 +57,9 @@ module.exports = Callsite; " `; -exports[`test createclass-module.js 1`] = ` +exports[`createclass-module.js 1`] = ` "/* @flow */ -var React = require(\'react\'); +var React = require('react'); var Hello = React.createClass({ propTypes: { @@ -72,7 +74,7 @@ var Hello = React.createClass({ module.exports = Hello; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var React = require(\"react\"); +var React = require(\\"react\\"); var Hello = React.createClass({ propTypes: { @@ -88,10 +90,10 @@ module.exports = Hello; " `; -exports[`test es6class-types-callsite.js 1`] = ` +exports[`es6class-types-callsite.js 1`] = ` "/* @flow */ -import React from \'react\'; -import Hello from \'./es6class-types-module\'; +import React from 'react'; +import Hello from './es6class-types-module'; type Props = {name: string}; @@ -117,8 +119,8 @@ class Callsite extends React.Component { module.exports = Callsite; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -import React from \"react\"; -import Hello from \"./es6class-types-module\"; +import React from \\"react\\"; +import Hello from \\"./es6class-types-module\\"; type Props = { name: string }; @@ -145,9 +147,9 @@ module.exports = Callsite; " `; -exports[`test es6class-types-module.js 1`] = ` +exports[`es6class-types-module.js 1`] = ` "/* @flow */ -import React from \'react\'; +import React from 'react'; type Props = {name: string}; @@ -163,7 +165,7 @@ class Hello extends React.Component<{}, Props, void>{ module.exports = Hello; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -import React from \"react\"; +import React from \\"react\\"; type Props = { name: string }; diff --git a/tests/flow/rec/__snapshots__/jsfmt.spec.js.snap b/tests/flow/rec/__snapshots__/jsfmt.spec.js.snap index c384a6371..45268ba2f 100644 --- a/tests/flow/rec/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/rec/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test issue-598.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`issue-598.js 1`] = ` "/* @flow */ type F
= { foo(x: A): F } @@ -49,7 +51,7 @@ function identity(val: A): Functor { " `; -exports[`test issue-1228.js 1`] = ` +exports[`issue-1228.js 1`] = ` "/* @flow */ type Task @@ -73,7 +75,7 @@ function id(x: Task): Task { " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "class P { x: X; } // this is like Promise type Pstar = X | Pstar>; // this is like Promise* @@ -112,7 +114,7 @@ pstar = (new P(): P>); // OK " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "var a = []; // Array ~> a function bar() { a = a.concat([]); // terminate despite expanding types: @@ -177,7 +179,7 @@ class C extends B {} " `; -exports[`test test3.js 1`] = ` +exports[`test3.js 1`] = ` "type I = () => I>; type J = () => J>; @@ -214,14 +216,14 @@ function bar(x: P): () => P { " `; -exports[`test test4.js 1`] = ` +exports[`test4.js 1`] = ` "type T = T // cycle in type alias should not cause non-termination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ type T = T; // cycle in type alias should not cause non-termination " `; -exports[`test test5.js 1`] = ` +exports[`test5.js 1`] = ` "/* @flow */ type NestedArray = Array>; diff --git a/tests/flow/recheck-haste/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck-haste/__snapshots__/jsfmt.spec.js.snap index 20f2fcbc8..cc86c4f5d 100644 --- a/tests/flow/recheck-haste/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck-haste/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A1.js 1`] = ` "/** * @providesModule A * @flow @@ -11,13 +13,13 @@ exports[`test A1.js 1`] = ` " `; -exports[`test A3.js 1`] = ` +exports[`A3.js 1`] = ` "// @flow -require(\'A\'); +require('A'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -require(\"A\"); +require(\\"A\\"); " `; diff --git a/tests/flow/recheck-haste/tmp1A/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck-haste/tmp1A/__snapshots__/jsfmt.spec.js.snap index 4fcf0c3b3..f7da4e1fd 100644 --- a/tests/flow/recheck-haste/tmp1A/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck-haste/tmp1A/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A2.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A2.js 1`] = ` "/** * @providesModule B * @flow diff --git a/tests/flow/recheck-haste/tmp2A/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck-haste/tmp2A/__snapshots__/jsfmt.spec.js.snap index 8c30b90d1..a0752a656 100644 --- a/tests/flow/recheck-haste/tmp2A/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck-haste/tmp2A/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test A3.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A3.js 1`] = ` "// @flow -require(\'B\'); +require('B'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -require(\"B\"); +require(\\"B\\"); " `; diff --git a/tests/flow/recheck/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/__snapshots__/jsfmt.spec.js.snap index 1d76eff3e..03e960245 100644 --- a/tests/flow/recheck/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test a1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a1.js 1`] = ` "// @flow function foo(x: number): string { return 5; } @@ -19,37 +21,37 @@ module.exports = foo; " `; -exports[`test a2.js 1`] = ` +exports[`a2.js 1`] = ` "// @flow -const foo = require(\'./a1\'); +const foo = require('./a1'); -module.exports = foo(\"\"); +module.exports = foo(\\"\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -const foo = require(\"./a1\"); +const foo = require(\\"./a1\\"); -module.exports = foo(\"\"); +module.exports = foo(\\"\\"); " `; -exports[`test a3.js 1`] = ` +exports[`a3.js 1`] = ` "// @flow -const five = require(\'./a2\'); +const five = require('./a2'); (five + five: string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -const five = require(\"./a2\"); +const five = require(\\"./a2\\"); (five + five: string); " `; -exports[`test b0.js 1`] = ` +exports[`b0.js 1`] = ` "// @flow class C { x: C; } @@ -70,10 +72,10 @@ module.exports = { C, E }; " `; -exports[`test b1.js 1`] = ` +exports[`b1.js 1`] = ` "// @flow -import { C, E } from \"./b0\"; +import { C, E } from \\"./b0\\"; function foo() { return C; } function bar() { return E; } let X = foo(); @@ -83,7 +85,7 @@ module.exports = { C, D }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { C, E } from \"./b0\"; +import { C, E } from \\"./b0\\"; function foo() { return C; } @@ -97,33 +99,33 @@ module.exports = { C, D }; " `; -exports[`test b2.js 1`] = ` +exports[`b2.js 1`] = ` "// @flow -module.exports = require(\"./b1\"); +module.exports = require(\\"./b1\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -module.exports = require(\"./b1\"); +module.exports = require(\\"./b1\\"); " `; -exports[`test b3.js 1`] = ` +exports[`b3.js 1`] = ` "// @flow -import { C, D } from \"./b2\"; +import { C, D } from \\"./b2\\"; (new D: C); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { C, D } from \"./b2\"; +import { C, D } from \\"./b2\\"; (new D(): C); " `; -exports[`test c1.js 1`] = ` +exports[`c1.js 1`] = ` "// @flow export function foo(props: { x: number }) { } @@ -134,10 +136,10 @@ export function foo(props: { x: number }) {} " `; -exports[`test c2.js 1`] = ` +exports[`c2.js 1`] = ` "// @flow -import { foo } from \"./c1\"; +import { foo } from \\"./c1\\"; export function bar(props: { x: number }) { foo({ x: 0 }); @@ -145,7 +147,7 @@ export function bar(props: { x: number }) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { foo } from \"./c1\"; +import { foo } from \\"./c1\\"; export function bar(props: { x: number }) { foo({ x: 0 }); @@ -153,22 +155,22 @@ export function bar(props: { x: number }) { " `; -exports[`test c3.js 1`] = ` +exports[`c3.js 1`] = ` "// @flow -import { bar } from \"./c2\"; +import { bar } from \\"./c2\\"; bar({ x: 0 }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { bar } from \"./c2\"; +import { bar } from \\"./c2\\"; bar({ x: 0 }); " `; -exports[`test d1.js 1`] = ` +exports[`d1.js 1`] = ` "// @flow export class A {} @@ -183,65 +185,65 @@ export var x = new A(); " `; -exports[`test d2.js 1`] = ` +exports[`d2.js 1`] = ` "// @flow -import {A, x} from \"./d1\"; +import {A, x} from \\"./d1\\"; export var y: A = x; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { A, x } from \"./d1\"; +import { A, x } from \\"./d1\\"; export var y: A = x; " `; -exports[`test e1.js 1`] = ` +exports[`e1.js 1`] = ` "// @flow export type Action = - | { type: \'FOO\' } - | { type: \'BAR\' } + | { type: 'FOO' } + | { type: 'BAR' } ; export const LIFE = 42; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -export type Action = { type: \"FOO\" } | { type: \"BAR\" }; +export type Action = { type: \\"FOO\\" } | { type: \\"BAR\\" }; export const LIFE = 42; " `; -exports[`test e2.js 1`] = ` +exports[`e2.js 1`] = ` "// @flow -import type { Action } from \'./e1\'; +import type { Action } from './e1'; const f = (): Action => { - return { type: \'FOO\' }; + return { type: 'FOO' }; } -import { LIFE } from \'./e1\'; +import { LIFE } from './e1'; (LIFE: 42); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import type { Action } from \"./e1\"; +import type { Action } from \\"./e1\\"; const f = (): Action => { - return { type: \"FOO\" }; + return { type: \\"FOO\\" }; }; -import { LIFE } from \"./e1\"; +import { LIFE } from \\"./e1\\"; (LIFE: 42); " `; -exports[`test f1.js 1`] = ` +exports[`f1.js 1`] = ` "// @flow type T = { x: number }; @@ -266,20 +268,20 @@ module.exports = { a, b, c }; " `; -exports[`test f2.js 1`] = ` +exports[`f2.js 1`] = ` "// @flow -var { a, b, c } = require(\'./f1\'); +var { a, b, c } = require('./f1'); (c: { x: number }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var { a, b, c } = require(\"./f1\"); +var { a, b, c } = require(\\"./f1\\"); (c: { x: number }); " `; -exports[`test g1.js 1`] = ` +exports[`g1.js 1`] = ` "// @flow export class C { } @@ -290,10 +292,10 @@ export class C {} " `; -exports[`test g2.js 1`] = ` +exports[`g2.js 1`] = ` "// @flow -import { C } from \'./g1\'; +import { C } from './g1'; class D extends C { } @@ -301,7 +303,7 @@ module.exports = { D }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { C } from \"./g1\"; +import { C } from \\"./g1\\"; class D extends C {} @@ -309,24 +311,24 @@ module.exports = { D }; " `; -exports[`test g3.js 1`] = ` +exports[`g3.js 1`] = ` "// @flow -import { C } from \'./g1\'; -import { D } from \'./g2\'; +import { C } from './g1'; +import { D } from './g2'; (new D: C) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { C } from \"./g1\"; -import { D } from \"./g2\"; +import { C } from \\"./g1\\"; +import { D } from \\"./g2\\"; (new D(): C); " `; -exports[`test h1.js 1`] = ` +exports[`h1.js 1`] = ` "// @flow export type Foo = number; @@ -337,13 +339,13 @@ export type Foo = number; " `; -exports[`test h2.js 1`] = ` +exports[`h2.js 1`] = ` "// @flow -import type { Foo } from \'./h1\'; +import type { Foo } from './h1'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import type { Foo } from \"./h1\"; +import type { Foo } from \\"./h1\\"; " `; diff --git a/tests/flow/recheck/tmp1a/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1a/__snapshots__/jsfmt.spec.js.snap index c8d930b6b..a7bf1066a 100644 --- a/tests/flow/recheck/tmp1a/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp1a/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test a1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a1.js 1`] = ` "// @flow function foo(x: number): number { return 5; } diff --git a/tests/flow/recheck/tmp1b/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1b/__snapshots__/jsfmt.spec.js.snap index 7dee64f8a..4d9305e86 100644 --- a/tests/flow/recheck/tmp1b/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp1b/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,9 @@ -exports[`test b1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`b1.js 1`] = ` "// @flow -import { C, E } from \"./b0\"; +import { C, E } from \\"./b0\\"; function foo() { return C; } function bar() { return E; } let X = bar(); @@ -11,7 +13,7 @@ module.exports = { C, D }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { C, E } from \"./b0\"; +import { C, E } from \\"./b0\\"; function foo() { return C; } diff --git a/tests/flow/recheck/tmp1c/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1c/__snapshots__/jsfmt.spec.js.snap index 840c1bd69..e04c0c1db 100644 --- a/tests/flow/recheck/tmp1c/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp1c/__snapshots__/jsfmt.spec.js.snap @@ -1,7 +1,9 @@ -exports[`test c2.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`c2.js 1`] = ` "// @flow -import { foo } from \"./c1\"; +import { foo } from \\"./c1\\"; export function bar(props: { y: number }) { foo({ y: 0 }); @@ -9,7 +11,7 @@ export function bar(props: { y: number }) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import { foo } from \"./c1\"; +import { foo } from \\"./c1\\"; export function bar(props: { y: number }) { foo({ y: 0 }); diff --git a/tests/flow/recheck/tmp1d/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1d/__snapshots__/jsfmt.spec.js.snap index dabcd3910..0146cfd68 100644 --- a/tests/flow/recheck/tmp1d/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp1d/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test d1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`d1.js 1`] = ` "// @flow export class A {} diff --git a/tests/flow/recheck/tmp1e/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1e/__snapshots__/jsfmt.spec.js.snap index 50af3a5cc..338e2c12e 100644 --- a/tests/flow/recheck/tmp1e/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp1e/__snapshots__/jsfmt.spec.js.snap @@ -1,25 +1,27 @@ -exports[`test e2.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`e2.js 1`] = ` "// @flow -import type { Action } from \'./e1\'; +import type { Action } from './e1'; const f = (): Action => { - return { type: \'QUX\' }; + return { type: 'QUX' }; } -import { LIFE } from \'./e1\'; +import { LIFE } from './e1'; (LIFE: 42); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import type { Action } from \"./e1\"; +import type { Action } from \\"./e1\\"; const f = (): Action => { - return { type: \"QUX\" }; + return { type: \\"QUX\\" }; }; -import { LIFE } from \"./e1\"; +import { LIFE } from \\"./e1\\"; (LIFE: 42); " diff --git a/tests/flow/recheck/tmp1f/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1f/__snapshots__/jsfmt.spec.js.snap index 13b7d0e59..6553b5426 100644 --- a/tests/flow/recheck/tmp1f/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp1f/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test f1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`f1.js 1`] = ` "// @flow type T = { x: number }; diff --git a/tests/flow/recheck/tmp1g/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1g/__snapshots__/jsfmt.spec.js.snap index fceca8ac2..e96b4760d 100644 --- a/tests/flow/recheck/tmp1g/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp1g/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test g1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`g1.js 1`] = ` "// @flow export class C { } diff --git a/tests/flow/recheck/tmp1h/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp1h/__snapshots__/jsfmt.spec.js.snap index 5cc6aa017..2a51a4a36 100644 --- a/tests/flow/recheck/tmp1h/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp1h/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test h1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`h1.js 1`] = ` "// @flow export type Bar = number; diff --git a/tests/flow/recheck/tmp2a/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp2a/__snapshots__/jsfmt.spec.js.snap index 33762bb7c..c5c79c97d 100644 --- a/tests/flow/recheck/tmp2a/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp2a/__snapshots__/jsfmt.spec.js.snap @@ -1,9 +1,11 @@ -exports[`test a1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`a1.js 1`] = ` "// @flow function foo(x: number): number { return 5; } -foo(\"\"); +foo(\\"\\"); module.exports = foo; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -13,7 +15,7 @@ function foo(x: number): number { return 5; } -foo(\"\"); +foo(\\"\\"); module.exports = foo; " diff --git a/tests/flow/recheck/tmp2b/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp2b/__snapshots__/jsfmt.spec.js.snap index da59130e5..570b1b193 100644 --- a/tests/flow/recheck/tmp2b/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp2b/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test b0.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`b0.js 1`] = ` "// @flow class C { x: C; } diff --git a/tests/flow/recheck/tmp2c/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp2c/__snapshots__/jsfmt.spec.js.snap index 0a6ff906a..e6791e86d 100644 --- a/tests/flow/recheck/tmp2c/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp2c/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test c1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`c1.js 1`] = ` "// @flow export function foo(props: { y: number }) { } diff --git a/tests/flow/recheck/tmp2e/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp2e/__snapshots__/jsfmt.spec.js.snap index 5cd4c3eef..6465844df 100644 --- a/tests/flow/recheck/tmp2e/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp2e/__snapshots__/jsfmt.spec.js.snap @@ -1,16 +1,18 @@ -exports[`test e1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`e1.js 1`] = ` "// @flow export type Action = - | { type: \'QUX\' } - | { type: \'BAR\' } + | { type: 'QUX' } + | { type: 'BAR' } ; export const LIFE = 42; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -export type Action = { type: \"QUX\" } | { type: \"BAR\" }; +export type Action = { type: \\"QUX\\" } | { type: \\"BAR\\" }; export const LIFE = 42; " diff --git a/tests/flow/recheck/tmp2f/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp2f/__snapshots__/jsfmt.spec.js.snap index aad2f1ae8..30f154f4d 100644 --- a/tests/flow/recheck/tmp2f/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp2f/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test f1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`f1.js 1`] = ` "// @flow type T = { x: number }; diff --git a/tests/flow/recheck/tmp3e/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp3e/__snapshots__/jsfmt.spec.js.snap index 6e7d6813c..4b6f3ecb3 100644 --- a/tests/flow/recheck/tmp3e/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp3e/__snapshots__/jsfmt.spec.js.snap @@ -1,43 +1,45 @@ -exports[`test e1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`e1.js 1`] = ` "// @flow export type Action = - | { type: \'QUX\' } - | { type: \'BAR\' } + | { type: 'QUX' } + | { type: 'BAR' } ; export const LIFE = 0; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -export type Action = { type: \"QUX\" } | { type: \"BAR\" }; +export type Action = { type: \\"QUX\\" } | { type: \\"BAR\\" }; export const LIFE = 0; " `; -exports[`test e2.js 1`] = ` +exports[`e2.js 1`] = ` "// @flow -import type { Action } from \'./e1\'; +import type { Action } from './e1'; const f = (): Action => { - return { type: \'QUX\' }; + return { type: 'QUX' }; } -import { LIFE } from \'./e1\'; +import { LIFE } from './e1'; (LIFE: 0); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -import type { Action } from \"./e1\"; +import type { Action } from \\"./e1\\"; const f = (): Action => { - return { type: \"QUX\" }; + return { type: \\"QUX\\" }; }; -import { LIFE } from \"./e1\"; +import { LIFE } from \\"./e1\\"; (LIFE: 0); " diff --git a/tests/flow/recheck/tmp3f/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp3f/__snapshots__/jsfmt.spec.js.snap index e5f5d7304..ab6afe322 100644 --- a/tests/flow/recheck/tmp3f/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp3f/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test f1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`f1.js 1`] = ` "// @flow type T = { x: number }; diff --git a/tests/flow/recheck/tmp4f/__snapshots__/jsfmt.spec.js.snap b/tests/flow/recheck/tmp4f/__snapshots__/jsfmt.spec.js.snap index eb242225c..4e7f58b3d 100644 --- a/tests/flow/recheck/tmp4f/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/recheck/tmp4f/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test f1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`f1.js 1`] = ` "// @flow type T = { x: number }; diff --git a/tests/flow/record/__snapshots__/jsfmt.spec.js.snap b/tests/flow/record/__snapshots__/jsfmt.spec.js.snap index 14bd118fa..5a1baaf07 100644 --- a/tests/flow/record/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/record/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test test.js 1`] = ` -"type Key1 = \'foo\' | \'bar\'; // make an enum type with known key set +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` +"type Key1 = 'foo' | 'bar'; // make an enum type with known key set var o1: {[key: Key1]: number} = { foo: 0, - bar: \"\", // error: string ~/~ number + bar: \\"\\", // error: string ~/~ number }; o1.foo; // OK o1.qux; // error: qux not found @@ -15,7 +17,7 @@ o2.bar; // OK to access bar o2.qux; // error: qux not found class C { - x: $Subtype<{[key: $Keys]: any}>; // object with larger key set than X\'s + x: $Subtype<{[key: $Keys]: any}>; // object with larger key set than X's } class D extends C<{foo: number, bar: string}> { x: { foo: number, qux: boolean }; // error: qux not found @@ -24,10 +26,10 @@ class D extends C<{foo: number, bar: string}> { type AnyKey = $Keys; var o3: {[key: AnyKey]: number} = { foo: 0 }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -type Key1 = \"foo\" | \"bar\"; // make an enum type with known key set +type Key1 = \\"foo\\" | \\"bar\\"; // make an enum type with known key set var o1: { [key: Key1]: number } = { foo: 0, - bar: \"\" // error: string ~/~ number + bar: \\"\\" // error: string ~/~ number }; o1.foo; // OK o1.qux; // error: qux not found @@ -40,7 +42,7 @@ o2.bar; // OK to access bar o2.qux; // error: qux not found class C { - x: $Subtype<{ [key: $Keys]: any }>; // object with larger key set than X\'s + x: $Subtype<{ [key: $Keys]: any }>; // object with larger key set than X's } class D extends C<{ foo: number, bar: string }> { x: { foo: number, qux: boolean }; // error: qux not found diff --git a/tests/flow/refi/__snapshots__/jsfmt.spec.js.snap b/tests/flow/refi/__snapshots__/jsfmt.spec.js.snap index bab6e1cc3..e371d8f01 100644 --- a/tests/flow/refi/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/refi/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test bound.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bound.js 1`] = ` "// refinements of bound vars (closed-over locals) // should have the same lifetimes as heap objects. -var x : ?string = \"xxx\"; +var x : ?string = \\"xxx\\"; var tests = [ @@ -38,7 +40,7 @@ var tests = // requires further remedial work in Env function() { if (x != null) { - alert(\"\"); + alert(\\"\\"); var y : string = x; // not ok } }, @@ -56,18 +58,18 @@ var tests = }, function() { - var y : string = x != null ? x : \"\"; // ok + var y : string = x != null ? x : \\"\\"; // ok }, function() { - var y : string = x || \"\"; // ok + var y : string = x || \\"\\"; // ok }, ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // refinements of bound vars (closed-over locals) // should have the same lifetimes as heap objects. -var x: ?string = \"xxx\"; +var x: ?string = \\"xxx\\"; var tests = [ function() { @@ -103,7 +105,7 @@ var tests = [ // requires further remedial work in Env function() { if (x != null) { - alert(\"\"); + alert(\\"\\"); var y : string = x; // not ok } }, @@ -122,62 +124,62 @@ var tests = [ }, function() { - var y: string = x != null ? x : \"\"; // ok + var y: string = x != null ? x : \\"\\"; // ok }, function() { - var y: string = x || \"\"; // ok + var y: string = x || \\"\\"; // ok } ]; " `; -exports[`test heap.js 1`] = ` +exports[`heap.js 1`] = ` "var tests = [ function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; var y : string = x.p; // not ok }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p != null) { var y : string = x.p; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p == null) {} else { var y : string = x.p; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p == null) return; var y : string = x.p; // ok }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (!(x.p != null)) {} else { var y : string = x.p; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p != null) { - alert(\"\"); + alert(\\"\\"); var y : string = x.p; // not ok } }, function () { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p != null) { x.p = null; var y : string = x.p; // not ok @@ -185,13 +187,13 @@ exports[`test heap.js 1`] = ` }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p != null) {} var y : string = x.p; // not ok }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p != null) { } else { var y : string = x.p; // not ok @@ -199,17 +201,17 @@ exports[`test heap.js 1`] = ` }, function() { - var x : {p:?string} = {p:\"xxx\"}; - var y : string = x.p != null ? x.p : \"\"; // ok + var x : {p:?string} = {p:\\"xxx\\"}; + var y : string = x.p != null ? x.p : \\"\\"; // ok }, function() { - var x : {p:?string} = {p:\"xxx\"}; - var y : string = x.p || \"\"; // ok + var x : {p:?string} = {p:\\"xxx\\"}; + var y : string = x.p || \\"\\"; // ok }, function() { - var x : {p:string | string[]} = {p:[\"xxx\"]}; + var x : {p:string | string[]} = {p:[\\"xxx\\"]}; if (Array.isArray(x.p)) { var y : string[] = x.p; // ok } else { @@ -220,7 +222,7 @@ exports[`test heap.js 1`] = ` function() { var x : {y: ?string} = {y: null}; if (!x.y) { - x.y = \"foo\"; + x.y = \\"foo\\"; } (x.y: string); }, @@ -229,7 +231,7 @@ exports[`test heap.js 1`] = ` var x : {y: ?string} = {y: null}; if (x.y) { } else { - x.y = \"foo\"; + x.y = \\"foo\\"; } (x.y: string); }, @@ -245,27 +247,27 @@ exports[`test heap.js 1`] = ` function() { var x : {y: ?string} = {y: null}; if (x.y) { - x.y = \"foo\"; + x.y = \\"foo\\"; } else { - x.y = \"bar\"; + x.y = \\"bar\\"; } (x.y : string); }, function() { var x : {y: string | number | boolean} = {y: false}; - if (typeof x.y == \"number\") { - x.y = \"foo\"; + if (typeof x.y == \\"number\\") { + x.y = \\"foo\\"; } (x.y : string); // error, could also be boolean }, function() { var x : {y: string | number | boolean} = {y: false}; - if (typeof x.y == \"number\") { - x.y = \"foo\"; - } else if (typeof x.y == \"boolean\") { - x.y = \"bar\"; + if (typeof x.y == \\"number\\") { + x.y = \\"foo\\"; + } else if (typeof x.y == \\"boolean\\") { + x.y = \\"bar\\"; } (x.y : boolean); // error, string }, @@ -273,7 +275,7 @@ exports[`test heap.js 1`] = ` function() { var x : {y: ?string} = {y: null}; if (!x.y) { - x.y = \"foo\"; + x.y = \\"foo\\"; } if (x.y) { x.y = null; @@ -283,11 +285,11 @@ exports[`test heap.js 1`] = ` function() { var x : {y: string | number | boolean} = {y: false}; - if (typeof x.y == \"number\") { - x.y = \"foo\"; + if (typeof x.y == \\"number\\") { + x.y = \\"foo\\"; } // now x.y can is string | boolean - if (typeof x.y == \"string\") { + if (typeof x.y == \\"string\\") { x.y = false; } // now x.y is only boolean @@ -296,11 +298,11 @@ exports[`test heap.js 1`] = ` function() { var x : {y: string | number | boolean} = {y: false}; - if (typeof x.y == \"number\") { - x.y = \"foo\"; + if (typeof x.y == \\"number\\") { + x.y = \\"foo\\"; } // now x.y can is string | boolean - if (typeof x.y == \"string\") { + if (typeof x.y == \\"string\\") { x.y = 123; } // now x.y is number | boolean @@ -309,7 +311,7 @@ exports[`test heap.js 1`] = ` function() { var x : {y: ?string} = {y: null}; - var z : string = \"foo\"; + var z : string = \\"foo\\"; if (x.y) { x.y = z; } else { @@ -319,12 +321,12 @@ exports[`test heap.js 1`] = ` }, function(x: string) { - if (x === \'a\') {} - (x: \'b\'); // error (but only once, string !~> \'b\'; \'a\' is irrelevant) + if (x === 'a') {} + (x: 'b'); // error (but only once, string !~> 'b'; 'a' is irrelevant) }, function(x: mixed) { - if (typeof x.bar === \'string\') {} // error, so \`x.bar\` refinement is empty + if (typeof x.bar === 'string') {} // error, so \`x.bar\` refinement is empty (x: string & number); }, @@ -339,7 +341,7 @@ exports[`test heap.js 1`] = ` let x: { foo: ?string } = { foo: null }; if (!x.foo) { if (false) {} - x.foo = \"foo\"; + x.foo = \\"foo\\"; } (x.foo: string); }, @@ -348,7 +350,7 @@ exports[`test heap.js 1`] = ` let x: { foo: ?string } = { foo: null }; if (!x.foo) { while(false) {} - x.foo = \"foo\"; + x.foo = \\"foo\\"; } (x.foo: string); }, @@ -357,13 +359,13 @@ exports[`test heap.js 1`] = ` let x: { foo: ?string } = { foo: null }; if (!x.foo) { for (var i = 0; i < 0; i++) {} - x.foo = \"foo\"; + x.foo = \\"foo\\"; } (x.foo: string); }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p != null) { var {p} = x; // TODO: annot checked against type of x (p : string); // ok @@ -373,19 +375,19 @@ exports[`test heap.js 1`] = ` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var tests = [ function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; var y: string = x.p; // not ok }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p != null) { var y: string = x.p; // ok } }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p == null) { } else { var y: string = x.p; // ok @@ -393,13 +395,13 @@ var tests = [ }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p == null) return; var y: string = x.p; // ok }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (!(x.p != null)) { } else { var y: string = x.p; // ok @@ -407,15 +409,15 @@ var tests = [ }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p != null) { - alert(\"\"); + alert(\\"\\"); var y: string = x.p; // not ok } }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p != null) { x.p = null; var y: string = x.p; // not ok @@ -423,14 +425,14 @@ var tests = [ }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p != null) { } var y: string = x.p; // not ok }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p != null) { } else { var y: string = x.p; // not ok @@ -438,17 +440,17 @@ var tests = [ }, function() { - var x: { p: ?string } = { p: \"xxx\" }; - var y: string = x.p != null ? x.p : \"\"; // ok + var x: { p: ?string } = { p: \\"xxx\\" }; + var y: string = x.p != null ? x.p : \\"\\"; // ok }, function() { - var x: { p: ?string } = { p: \"xxx\" }; - var y: string = x.p || \"\"; // ok + var x: { p: ?string } = { p: \\"xxx\\" }; + var y: string = x.p || \\"\\"; // ok }, function() { - var x: { p: string | string[] } = { p: [\"xxx\"] }; + var x: { p: string | string[] } = { p: [\\"xxx\\"] }; if (Array.isArray(x.p)) { var y: string[] = x.p; // ok } else { @@ -459,7 +461,7 @@ var tests = [ function() { var x: { y: ?string } = { y: null }; if (!x.y) { - x.y = \"foo\"; + x.y = \\"foo\\"; } (x.y: string); }, @@ -468,7 +470,7 @@ var tests = [ var x: { y: ?string } = { y: null }; if (x.y) { } else { - x.y = \"foo\"; + x.y = \\"foo\\"; } (x.y: string); }, @@ -484,27 +486,27 @@ var tests = [ function() { var x: { y: ?string } = { y: null }; if (x.y) { - x.y = \"foo\"; + x.y = \\"foo\\"; } else { - x.y = \"bar\"; + x.y = \\"bar\\"; } (x.y: string); }, function() { var x: { y: string | number | boolean } = { y: false }; - if (typeof x.y == \"number\") { - x.y = \"foo\"; + if (typeof x.y == \\"number\\") { + x.y = \\"foo\\"; } (x.y: string); // error, could also be boolean }, function() { var x: { y: string | number | boolean } = { y: false }; - if (typeof x.y == \"number\") { - x.y = \"foo\"; - } else if (typeof x.y == \"boolean\") { - x.y = \"bar\"; + if (typeof x.y == \\"number\\") { + x.y = \\"foo\\"; + } else if (typeof x.y == \\"boolean\\") { + x.y = \\"bar\\"; } (x.y: boolean); // error, string }, @@ -512,7 +514,7 @@ var tests = [ function() { var x: { y: ?string } = { y: null }; if (!x.y) { - x.y = \"foo\"; + x.y = \\"foo\\"; } if (x.y) { x.y = null; @@ -522,11 +524,11 @@ var tests = [ function() { var x: { y: string | number | boolean } = { y: false }; - if (typeof x.y == \"number\") { - x.y = \"foo\"; + if (typeof x.y == \\"number\\") { + x.y = \\"foo\\"; } // now x.y can is string | boolean - if (typeof x.y == \"string\") { + if (typeof x.y == \\"string\\") { x.y = false; } // now x.y is only boolean @@ -535,11 +537,11 @@ var tests = [ function() { var x: { y: string | number | boolean } = { y: false }; - if (typeof x.y == \"number\") { - x.y = \"foo\"; + if (typeof x.y == \\"number\\") { + x.y = \\"foo\\"; } // now x.y can is string | boolean - if (typeof x.y == \"string\") { + if (typeof x.y == \\"string\\") { x.y = 123; } // now x.y is number | boolean @@ -548,7 +550,7 @@ var tests = [ function() { var x: { y: ?string } = { y: null }; - var z: string = \"foo\"; + var z: string = \\"foo\\"; if (x.y) { x.y = z; } else { @@ -558,13 +560,13 @@ var tests = [ }, function(x: string) { - if (x === \"a\") { + if (x === \\"a\\") { } - (x: \"b\"); // error (but only once, string !~> \'b\'; \'a\' is irrelevant) + (x: \\"b\\"); // error (but only once, string !~> 'b'; 'a' is irrelevant) }, function(x: mixed) { - if (typeof x.bar === \"string\") { + if (typeof x.bar === \\"string\\") { } // error, so \`x.bar\` refinement is empty (x: string & number); }, @@ -581,7 +583,7 @@ var tests = [ if (!x.foo) { if (false) { } - x.foo = \"foo\"; + x.foo = \\"foo\\"; } (x.foo: string); }, @@ -591,7 +593,7 @@ var tests = [ if (!x.foo) { while (false) { } - x.foo = \"foo\"; + x.foo = \\"foo\\"; } (x.foo: string); }, @@ -601,13 +603,13 @@ var tests = [ if (!x.foo) { for (var i = 0; i < 0; i++) { } - x.foo = \"foo\"; + x.foo = \\"foo\\"; } (x.foo: string); }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p != null) { var { p } = x; // TODO: annot checked against type of x (p: string); // ok @@ -617,11 +619,11 @@ var tests = [ " `; -exports[`test lex.js 1`] = ` +exports[`lex.js 1`] = ` "function block_scope(x: string | number) { { let x; - x = \"\"; // doesn\'t refine outer x + x = \\"\\"; // doesn't refine outer x } (x : string); // error: number ~> string } @@ -630,7 +632,7 @@ function switch_scope(x: string | number) { switch (x) { default: let x; - x = \"\"; // doesn\'t refine outer x + x = \\"\\"; // doesn't refine outer x } (x : string); // error: number ~> string } @@ -638,19 +640,19 @@ function switch_scope(x: string | number) { function try_scope(x: string | number) { try { let x; - x = \"\"; // doesn\'t refine outer x + x = \\"\\"; // doesn't refine outer x } catch (e) { - x = \"\"; // refinement would only escape if both sides refined + x = \\"\\"; // refinement would only escape if both sides refined } (x : string); // error: number ~> string } function try_scope_catch(x: string | number) { try { - x = \"\"; // refinement would only escape if both sides refined + x = \\"\\"; // refinement would only escape if both sides refined } catch (e) { let x; - x = \"\"; // doesn\'t refine outer x + x = \\"\\"; // doesn't refine outer x } (x : string); // error: number ~> string } @@ -658,7 +660,7 @@ function try_scope_catch(x: string | number) { function block_scope(x: string | number) { { let x; - x = \"\"; // doesn\'t refine outer x + x = \\"\\"; // doesn't refine outer x } (x: string); // error: number ~> string } @@ -667,7 +669,7 @@ function switch_scope(x: string | number) { switch (x) { default: let x; - x = \"\"; // doesn\'t refine outer x + x = \\"\\"; // doesn't refine outer x } (x: string); // error: number ~> string } @@ -675,77 +677,77 @@ function switch_scope(x: string | number) { function try_scope(x: string | number) { try { let x; - x = \"\"; // doesn\'t refine outer x + x = \\"\\"; // doesn't refine outer x } catch (e) { - x = \"\"; // refinement would only escape if both sides refined + x = \\"\\"; // refinement would only escape if both sides refined } (x: string); // error: number ~> string } function try_scope_catch(x: string | number) { try { - x = \"\"; // refinement would only escape if both sides refined + x = \\"\\"; // refinement would only escape if both sides refined } catch (e) { let x; - x = \"\"; // doesn\'t refine outer x + x = \\"\\"; // doesn't refine outer x } (x: string); // error: number ~> string } " `; -exports[`test local.js 1`] = ` +exports[`local.js 1`] = ` "var paths = [ function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; var y : string = x; // not ok }, function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x != null) { var y : string = x; // ok } }, function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x == null) {} else { var y : string = x; // ok } }, function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x == null) return; var y : string = x; // ok }, function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (!(x != null)) {} else { var y : string = x; // ok } }, function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x != null) { - alert(\"\"); + alert(\\"\\"); var y : string = x; // ok } }, function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x != null) {} var y : string = x; // not ok }, function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x != null) { } else { var y : string = x; // not ok @@ -753,17 +755,17 @@ exports[`test local.js 1`] = ` }, function() { - var x : ?string = \"xxx\"; - var y : string = x != null ? x : \"\"; // ok + var x : ?string = \\"xxx\\"; + var y : string = x != null ? x : \\"\\"; // ok }, function() { - var x : ?string = \"xxx\"; - var y : string = x || \"\"; // ok + var x : ?string = \\"xxx\\"; + var y : string = x || \\"\\"; // ok }, function() { - var x : string | string[] = [\"xxx\"]; + var x : string | string[] = [\\"xxx\\"]; if (Array.isArray(x)) { var y : string[] = x; // ok } else { @@ -774,7 +776,7 @@ exports[`test local.js 1`] = ` function() { var x : ?string = null; if (!x) { - x = \"xxx\"; + x = \\"xxx\\"; } var y : string = x; }, @@ -782,19 +784,19 @@ exports[`test local.js 1`] = ` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var paths = [ function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; var y: string = x; // not ok }, function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x != null) { var y: string = x; // ok } }, function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x == null) { } else { var y: string = x; // ok @@ -802,13 +804,13 @@ var paths = [ }, function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x == null) return; var y: string = x; // ok }, function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (!(x != null)) { } else { var y: string = x; // ok @@ -816,22 +818,22 @@ var paths = [ }, function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x != null) { - alert(\"\"); + alert(\\"\\"); var y: string = x; // ok } }, function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x != null) { } var y: string = x; // not ok }, function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x != null) { } else { var y: string = x; // not ok @@ -839,17 +841,17 @@ var paths = [ }, function() { - var x: ?string = \"xxx\"; - var y: string = x != null ? x : \"\"; // ok + var x: ?string = \\"xxx\\"; + var y: string = x != null ? x : \\"\\"; // ok }, function() { - var x: ?string = \"xxx\"; - var y: string = x || \"\"; // ok + var x: ?string = \\"xxx\\"; + var y: string = x || \\"\\"; // ok }, function() { - var x: string | string[] = [\"xxx\"]; + var x: string | string[] = [\\"xxx\\"]; if (Array.isArray(x)) { var y: string[] = x; // ok } else { @@ -860,7 +862,7 @@ var paths = [ function() { var x: ?string = null; if (!x) { - x = \"xxx\"; + x = \\"xxx\\"; } var y: string = x; } @@ -868,33 +870,33 @@ var paths = [ " `; -exports[`test null_tests.js 1`] = ` +exports[`null_tests.js 1`] = ` "var null_tests = [ // expr != null function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x != null) { var y : string = x; // ok } }, function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (null != x) { var y : string = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p != null) { var y : string = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; if (x.p.q != null) { var y : string = x.p.q; // ok } @@ -902,21 +904,21 @@ exports[`test null_tests.js 1`] = ` // expr == null function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x == null) {} else { var y : string = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p == null) {} else { var y : string = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; if (x.p.q == null) {} else { var y : string = x.p.q; // ok } @@ -924,21 +926,21 @@ exports[`test null_tests.js 1`] = ` // expr !== null function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x !== null) { var y : string | void = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p !== null) { var y : string | void = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; if (x.p.q !== null) { var y : string | void = x.p.q; // ok } @@ -946,21 +948,21 @@ exports[`test null_tests.js 1`] = ` // expr === null function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x === null) {} else { var y : string | void = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p === null) {} else { var y : string | void = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; if (x.p.q === null) {} else { var y : string | void = x.p.q; // ok } @@ -975,12 +977,12 @@ class C { if (this.p != null) return this.p; else - return \"\"; + return \\"\\"; } ensure1(): string { if (this.p == null) - return \"\"; + return \\"\\"; return this.p; } @@ -988,12 +990,12 @@ class C { if (this.p !== null) return this.p; else - return \"\"; + return \\"\\"; } ensure3(): string | void { if (this.p === null) - return \"\"; + return \\"\\"; return this.p; } } @@ -1005,50 +1007,50 @@ class D extends C { if (super.p != null) return super.p; else - return \"\"; + return \\"\\"; } ensure101(): string { if (super.p == null) - return \"\"; + return \\"\\"; else return super.p; } ensure103(): string { if (super.p != null) { - alert(\"\"); + alert(\\"\\"); return super.p; // not ok } - return \"\"; + return \\"\\"; } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var null_tests = [ // expr != null function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x != null) { var y: string = x; // ok } }, function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (null != x) { var y: string = x; // ok } }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p != null) { var y: string = x.p; // ok } }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; if (x.p.q != null) { var y: string = x.p.q; // ok } @@ -1056,7 +1058,7 @@ var null_tests = [ // expr == null function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x == null) { } else { var y: string = x; // ok @@ -1064,7 +1066,7 @@ var null_tests = [ }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p == null) { } else { var y: string = x.p; // ok @@ -1072,7 +1074,7 @@ var null_tests = [ }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; if (x.p.q == null) { } else { var y: string = x.p.q; // ok @@ -1081,21 +1083,21 @@ var null_tests = [ // expr !== null function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x !== null) { var y: string | void = x; // ok } }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p !== null) { var y: string | void = x.p; // ok } }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; if (x.p.q !== null) { var y: string | void = x.p.q; // ok } @@ -1103,7 +1105,7 @@ var null_tests = [ // expr === null function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x === null) { } else { var y: string | void = x; // ok @@ -1111,7 +1113,7 @@ var null_tests = [ }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p === null) { } else { var y: string | void = x.p; // ok @@ -1119,7 +1121,7 @@ var null_tests = [ }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; if (x.p.q === null) { } else { var y: string | void = x.p.q; // ok @@ -1133,21 +1135,21 @@ class C { ensure0(): string { if (this.p != null) return this.p; - else return \"\"; + else return \\"\\"; } ensure1(): string { - if (this.p == null) return \"\"; + if (this.p == null) return \\"\\"; return this.p; } ensure2(): string | void { if (this.p !== null) return this.p; - else return \"\"; + else return \\"\\"; } ensure3(): string | void { - if (this.p === null) return \"\"; + if (this.p === null) return \\"\\"; return this.p; } } @@ -1156,26 +1158,26 @@ class C { class D extends C { ensure100(): string { if (super.p != null) return super.p; - else return \"\"; + else return \\"\\"; } ensure101(): string { - if (super.p == null) return \"\"; + if (super.p == null) return \\"\\"; else return super.p; } ensure103(): string { if (super.p != null) { - alert(\"\"); + alert(\\"\\"); return super.p; // not ok } - return \"\"; + return \\"\\"; } } " `; -exports[`test switch.js 1`] = ` +exports[`switch.js 1`] = ` "// @flow function foo(a,b,c) { switch (c) { @@ -1197,7 +1199,7 @@ function exhaustion1(x): number { foo = 3; break; default: - throw new Error(\'Invalid state\'); + throw new Error('Invalid state'); } return foo; // no error } @@ -1210,19 +1212,19 @@ function exhaustion2(x, y): number { break; // leaks uninitialized foo out of switch } /** - * TODO this shouldn\'t cause an error, because the path that + * TODO this shouldn't cause an error, because the path that * runs it will always go on to assign a number to foo. But - * we\'ll need true isolation in env snapshots to model this. - * Currently tvars are always shared between clones - we\'d + * we'll need true isolation in env snapshots to model this. + * Currently tvars are always shared between clones - we'd * have to rework envs pretty extensively to avoid it. * - foo = \"\"; + foo = \\"\\"; */ case 1: foo = 3; break; default: - throw new Error(\'Invalid state\'); + throw new Error('Invalid state'); } return foo; // error, possibly uninitialized } @@ -1235,7 +1237,7 @@ function exhaustion3(x): number { foo = 3; break; default: - throw new Error(\'Invalid state\'); + throw new Error('Invalid state'); } return foo; // no error } @@ -1261,7 +1263,7 @@ function exhaustion1(x): number { foo = 3; break; default: - throw new Error(\"Invalid state\"); + throw new Error(\\"Invalid state\\"); } return foo; // no error } @@ -1274,19 +1276,19 @@ function exhaustion2(x, y): number { break; // leaks uninitialized foo out of switch } /** - * TODO this shouldn\'t cause an error, because the path that + * TODO this shouldn't cause an error, because the path that * runs it will always go on to assign a number to foo. But - * we\'ll need true isolation in env snapshots to model this. - * Currently tvars are always shared between clones - we\'d + * we'll need true isolation in env snapshots to model this. + * Currently tvars are always shared between clones - we'd * have to rework envs pretty extensively to avoid it. * - foo = \"\"; + foo = \\"\\"; */ case 1: foo = 3; break; default: - throw new Error(\"Invalid state\"); + throw new Error(\\"Invalid state\\"); } return foo; // error, possibly uninitialized } @@ -1299,107 +1301,107 @@ function exhaustion3(x): number { foo = 3; break; default: - throw new Error(\"Invalid state\"); + throw new Error(\\"Invalid state\\"); } return foo; // no error } " `; -exports[`test typeof_tests.js 1`] = ` +exports[`typeof_tests.js 1`] = ` "var null_tests = [ // typeof expr == typename function() { - var x : ?string = \"xxx\"; - if (typeof x == \"string\") { + var x : ?string = \\"xxx\\"; + if (typeof x == \\"string\\") { var y : string = x; // ok } }, function() { - var x : ?string = \"xxx\"; - if (\"string\" == typeof x) { + var x : ?string = \\"xxx\\"; + if (\\"string\\" == typeof x) { var y : string = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; - if (typeof x.p == \"string\") { + var x : {p:?string} = {p:\\"xxx\\"}; + if (typeof x.p == \\"string\\") { var y : string = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; - if (typeof x.p.q == \"string\") { + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; + if (typeof x.p.q == \\"string\\") { var y : string = x.p.q; // ok } }, // typeof expr != typename function() { - var x : ?string = \"xxx\"; - if (typeof x != \"string\") {} else { + var x : ?string = \\"xxx\\"; + if (typeof x != \\"string\\") {} else { var y : string = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; - if (typeof x.p != \"string\") {} else { + var x : {p:?string} = {p:\\"xxx\\"}; + if (typeof x.p != \\"string\\") {} else { var y : string = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; - if (typeof x.p.q != \"string\") {} else { + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; + if (typeof x.p.q != \\"string\\") {} else { var y : string = x.p.q; // ok } }, // typeof expr === typename function() { - var x : ?string = \"xxx\"; - if (typeof x === \"string\") { + var x : ?string = \\"xxx\\"; + if (typeof x === \\"string\\") { var y : string = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; - if (typeof x.p === \"string\") { + var x : {p:?string} = {p:\\"xxx\\"}; + if (typeof x.p === \\"string\\") { var y : string = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; - if (typeof x.p.q === \"string\") { + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; + if (typeof x.p.q === \\"string\\") { var y : string = x.p.q; // ok } }, // typeof expr !== typename function() { - var x : ?string = \"xxx\"; - if (typeof x !== \"string\") {} else { + var x : ?string = \\"xxx\\"; + if (typeof x !== \\"string\\") {} else { var y : string = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; - if (typeof x.p !== \"string\") {} else { + var x : {p:?string} = {p:\\"xxx\\"}; + if (typeof x.p !== \\"string\\") {} else { var y : string = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; - if (typeof x.p.q !== \"string\") {} else { + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; + if (typeof x.p.q !== \\"string\\") {} else { var y : string = x.p.q; // ok } }, @@ -1410,29 +1412,29 @@ class A { p: ?string; ensure0(): string { - if (typeof this.p == \"string\") + if (typeof this.p == \\"string\\") return this.p; else - return \"\"; + return \\"\\"; } ensure1(): string { - if (typeof this.p != \"string\") - return \"\"; + if (typeof this.p != \\"string\\") + return \\"\\"; else return this.p; } ensure2(): string | void { - if (typeof this.p === \"string\") + if (typeof this.p === \\"string\\") return this.p; else - return \"\"; + return \\"\\"; } ensure3(): string | void { - if (typeof this.p !== \"string\") - return \"\"; + if (typeof this.p !== \\"string\\") + return \\"\\"; else return this.p; } @@ -1441,53 +1443,53 @@ class A { var null_tests = [ // typeof expr == typename function() { - var x: ?string = \"xxx\"; - if (typeof x == \"string\") { + var x: ?string = \\"xxx\\"; + if (typeof x == \\"string\\") { var y: string = x; // ok } }, function() { - var x: ?string = \"xxx\"; - if (\"string\" == typeof x) { + var x: ?string = \\"xxx\\"; + if (\\"string\\" == typeof x) { var y: string = x; // ok } }, function() { - var x: { p: ?string } = { p: \"xxx\" }; - if (typeof x.p == \"string\") { + var x: { p: ?string } = { p: \\"xxx\\" }; + if (typeof x.p == \\"string\\") { var y: string = x.p; // ok } }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; - if (typeof x.p.q == \"string\") { + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; + if (typeof x.p.q == \\"string\\") { var y: string = x.p.q; // ok } }, // typeof expr != typename function() { - var x: ?string = \"xxx\"; - if (typeof x != \"string\") { + var x: ?string = \\"xxx\\"; + if (typeof x != \\"string\\") { } else { var y: string = x; // ok } }, function() { - var x: { p: ?string } = { p: \"xxx\" }; - if (typeof x.p != \"string\") { + var x: { p: ?string } = { p: \\"xxx\\" }; + if (typeof x.p != \\"string\\") { } else { var y: string = x.p; // ok } }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; - if (typeof x.p.q != \"string\") { + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; + if (typeof x.p.q != \\"string\\") { } else { var y: string = x.p.q; // ok } @@ -1495,46 +1497,46 @@ var null_tests = [ // typeof expr === typename function() { - var x: ?string = \"xxx\"; - if (typeof x === \"string\") { + var x: ?string = \\"xxx\\"; + if (typeof x === \\"string\\") { var y: string = x; // ok } }, function() { - var x: { p: ?string } = { p: \"xxx\" }; - if (typeof x.p === \"string\") { + var x: { p: ?string } = { p: \\"xxx\\" }; + if (typeof x.p === \\"string\\") { var y: string = x.p; // ok } }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; - if (typeof x.p.q === \"string\") { + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; + if (typeof x.p.q === \\"string\\") { var y: string = x.p.q; // ok } }, // typeof expr !== typename function() { - var x: ?string = \"xxx\"; - if (typeof x !== \"string\") { + var x: ?string = \\"xxx\\"; + if (typeof x !== \\"string\\") { } else { var y: string = x; // ok } }, function() { - var x: { p: ?string } = { p: \"xxx\" }; - if (typeof x.p !== \"string\") { + var x: { p: ?string } = { p: \\"xxx\\" }; + if (typeof x.p !== \\"string\\") { } else { var y: string = x.p; // ok } }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; - if (typeof x.p.q !== \"string\") { + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; + if (typeof x.p.q !== \\"string\\") { } else { var y: string = x.p.q; // ok } @@ -1546,57 +1548,57 @@ class A { p: ?string; ensure0(): string { - if (typeof this.p == \"string\") return this.p; - else return \"\"; + if (typeof this.p == \\"string\\") return this.p; + else return \\"\\"; } ensure1(): string { - if (typeof this.p != \"string\") return \"\"; + if (typeof this.p != \\"string\\") return \\"\\"; else return this.p; } ensure2(): string | void { - if (typeof this.p === \"string\") return this.p; - else return \"\"; + if (typeof this.p === \\"string\\") return this.p; + else return \\"\\"; } ensure3(): string | void { - if (typeof this.p !== \"string\") return \"\"; + if (typeof this.p !== \\"string\\") return \\"\\"; else return this.p; } } " `; -exports[`test undef_tests.js 1`] = ` +exports[`undef_tests.js 1`] = ` "var undef_tests = [ // NOTE: not (yet?) supporting non-strict eq test for undefined // expr !== undefined function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x !== undefined && x !== null) { var y : string = x; // ok } }, function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (undefined !== x && x !== null) { var y : string = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p !== undefined && x.p !== null) { var y : string = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; if (x.p.q !== undefined && x.p.q !== null) { var y : string = x.p.q; // ok } @@ -1604,21 +1606,21 @@ exports[`test undef_tests.js 1`] = ` // expr === undefined function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x === undefined || x === null) {} else { var y : string = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p === undefined || x.p === null) {} else { var y : string = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; if (x.p.q === undefined || x.p.q === null) {} else { var y : string = x.p.q; // ok } @@ -1633,12 +1635,12 @@ class A { if (this.p !== undefined && this.p !== null) return this.p; else - return \"\"; + return \\"\\"; } ensure1(): string { if (this.p === undefined || this.p === null) - return \"\"; + return \\"\\"; else return this.p; } @@ -1649,28 +1651,28 @@ var undef_tests = [ // expr !== undefined function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x !== undefined && x !== null) { var y: string = x; // ok } }, function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (undefined !== x && x !== null) { var y: string = x; // ok } }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p !== undefined && x.p !== null) { var y: string = x.p; // ok } }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; if (x.p.q !== undefined && x.p.q !== null) { var y: string = x.p.q; // ok } @@ -1678,7 +1680,7 @@ var undef_tests = [ // expr === undefined function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x === undefined || x === null) { } else { var y: string = x; // ok @@ -1686,7 +1688,7 @@ var undef_tests = [ }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p === undefined || x.p === null) { } else { var y: string = x.p; // ok @@ -1694,7 +1696,7 @@ var undef_tests = [ }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; if (x.p.q === undefined || x.p.q === null) { } else { var y: string = x.p.q; // ok @@ -1708,46 +1710,46 @@ class A { ensure0(): string { if (this.p !== undefined && this.p !== null) return this.p; - else return \"\"; + else return \\"\\"; } ensure1(): string { - if (this.p === undefined || this.p === null) return \"\"; + if (this.p === undefined || this.p === null) return \\"\\"; else return this.p; } } " `; -exports[`test void_tests.js 1`] = ` +exports[`void_tests.js 1`] = ` "var void_tests = [ // NOTE: not (yet?) supporting non-strict eq test for undefined // expr !== void(...) function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x !== void(0) && x !== null) { var y : string = x; // ok } }, function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (void(0) !== x && x !== null) { var y : string = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p !== void(0) && x.p !== null) { var y : string | void = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; if (x.p.q !== void(0) && x.p.q !== null) { var y : string = x.p.q; // ok } @@ -1755,21 +1757,21 @@ exports[`test void_tests.js 1`] = ` // expr === void(...) function() { - var x : ?string = \"xxx\"; + var x : ?string = \\"xxx\\"; if (x === void(0) || x === null) {} else { var y : string = x; // ok } }, function() { - var x : {p:?string} = {p:\"xxx\"}; + var x : {p:?string} = {p:\\"xxx\\"}; if (x.p === void(0) || x.p === null) {} else { var y : string = x.p; // ok } }, function() { - var x : {p:{q:?string}} = {p:{q:\"xxx\"}}; + var x : {p:{q:?string}} = {p:{q:\\"xxx\\"}}; if (x.p.q === void(0) || x.p.q === null) {} else { var y : string = x.p.q; // ok } @@ -1784,12 +1786,12 @@ class A { if (this.p !== void(0) && this.p !== null) return this.p; else - return \"\"; + return \\"\\"; } ensure1(): string { if (this.p === void(0) || this.p === null) - return \"\"; + return \\"\\"; else return this.p; } @@ -1800,28 +1802,28 @@ var void_tests = [ // expr !== void(...) function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x !== void 0 && x !== null) { var y: string = x; // ok } }, function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (void 0 !== x && x !== null) { var y: string = x; // ok } }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p !== void 0 && x.p !== null) { var y: string | void = x.p; // ok } }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; if (x.p.q !== void 0 && x.p.q !== null) { var y: string = x.p.q; // ok } @@ -1829,7 +1831,7 @@ var void_tests = [ // expr === void(...) function() { - var x: ?string = \"xxx\"; + var x: ?string = \\"xxx\\"; if (x === void 0 || x === null) { } else { var y: string = x; // ok @@ -1837,7 +1839,7 @@ var void_tests = [ }, function() { - var x: { p: ?string } = { p: \"xxx\" }; + var x: { p: ?string } = { p: \\"xxx\\" }; if (x.p === void 0 || x.p === null) { } else { var y: string = x.p; // ok @@ -1845,7 +1847,7 @@ var void_tests = [ }, function() { - var x: { p: { q: ?string } } = { p: { q: \"xxx\" } }; + var x: { p: { q: ?string } } = { p: { q: \\"xxx\\" } }; if (x.p.q === void 0 || x.p.q === null) { } else { var y: string = x.p.q; // ok @@ -1859,11 +1861,11 @@ class A { ensure0(): string { if (this.p !== void 0 && this.p !== null) return this.p; - else return \"\"; + else return \\"\\"; } ensure1(): string { - if (this.p === void 0 || this.p === null) return \"\"; + if (this.p === void 0 || this.p === null) return \\"\\"; else return this.p; } } diff --git a/tests/flow/refinements/__snapshots__/jsfmt.spec.js.snap b/tests/flow/refinements/__snapshots__/jsfmt.spec.js.snap index c1a2cef2a..2d9d1496e 100644 --- a/tests/flow/refinements/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/refinements/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test assignment.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`assignment.js 1`] = ` "/* @flow */ function foo(x : ?number) { @@ -14,7 +16,7 @@ type Bar = { } function bar0(x : Bar) { - while (x = x.parent) { // can\'t assign x to ?Bar + while (x = x.parent) { // can't assign x to ?Bar x.doStuff(); } } @@ -48,7 +50,7 @@ type Bar = { function bar0(x: Bar) { while (x = x.parent) { - // can\'t assign x to ?Bar + // can't assign x to ?Bar x.doStuff(); } } @@ -69,26 +71,26 @@ function bar2(x: Bar) { " `; -exports[`test ast_node.js 1`] = ` +exports[`ast_node.js 1`] = ` "type Node1 = { - kind: \'Node1\', + kind: 'Node1', prop1?: string }; type Node2 = { - kind: \'Node2\', + kind: 'Node2', prop2?: string } export type ASTNode = Node1 | Node2; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ type Node1 = { - kind: \"Node1\", + kind: \\"Node1\\", prop1?: string }; type Node2 = { - kind: \"Node2\", + kind: \\"Node2\\", prop2?: string }; @@ -96,7 +98,7 @@ export type ASTNode = Node1 | Node2; " `; -exports[`test bool.js 1`] = ` +exports[`bool.js 1`] = ` "/* @flow */ function foo(x: ?bool) { @@ -193,11 +195,11 @@ let tests = [ " `; -exports[`test computed_string_literal.js 1`] = ` +exports[`computed_string_literal.js 1`] = ` "// @flow type A = { - \'b_c\': ?string + 'b_c': ?string }; function stuff(str: string) {} @@ -209,15 +211,15 @@ function testProperty(a: A) { } function testLiteralProperty(a: A) { - if (a[\'b_c\']) { - stuff(a[\'b_c\']) + if (a['b_c']) { + stuff(a['b_c']) } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow type A = { - \"b_c\": ?string + \\"b_c\\": ?string }; function stuff(str: string) {} @@ -229,24 +231,24 @@ function testProperty(a: A) { } function testLiteralProperty(a: A) { - if (a[\"b_c\"]) { - stuff(a[\"b_c\"]); + if (a[\\"b_c\\"]) { + stuff(a[\\"b_c\\"]); } } " `; -exports[`test cond_prop.js 1`] = ` +exports[`cond_prop.js 1`] = ` "/* @flow */ type Type = Name | ListType | NonNullType; -type Name = {kind: \'Name\', value: string, type: void }; -type ListType = {kind: \'ListType\', type: Type}; -type NonNullType = {kind: \'NonNullType\', type: Name | ListType | BadType}; +type Name = {kind: 'Name', value: string, type: void }; +type ListType = {kind: 'ListType', type: Type}; +type NonNullType = {kind: 'NonNullType', type: Name | ListType | BadType}; type BadType = {}; function getTypeASTName(typeAST: Type): string { - if (!typeAST.type) throw new Error(\'Must be wrapping type\'); // OK + if (!typeAST.type) throw new Error('Must be wrapping type'); // OK return getTypeASTName(typeAST.type); // error, BadType not a subtype of Type } @@ -260,7 +262,7 @@ let tests = [ function(x: { done: true, result: string } | { foo: string }) { if (x.done) { - return x.result; // error, consider { foo: \"herp\", done: \"derp\" } + return x.result; // error, consider { foo: \\"herp\\", done: \\"derp\\" } } return x.result; // error }, @@ -272,7 +274,7 @@ let tests = [ function testAlwaysTruthyProp(t: T) { if (t.foo) { - (t.bar: string); // error, consider { baz: \"x\", quux: \"y\", foo: \"boom\" } + (t.bar: string); // error, consider { baz: \\"x\\", quux: \\"y\\", foo: \\"boom\\" } } else { (t.quux: string); // ok. since foo is an object (always truthy), the // else case completely rules out the first branch of @@ -282,9 +284,9 @@ let tests = [ function testSometimesTruthyProp(t: T) { if (t.bar) { - (t.foo: Object); // error, consider { baz: \"x\", quux: \"y\", bar: \"boom\" } + (t.foo: Object); // error, consider { baz: \\"x\\", quux: \\"y\\", bar: \\"boom\\" } } else { - (t.quux: string); // error, consider { foo: {}, bar: \"\" } + (t.quux: string); // error, consider { foo: {}, bar: \\"\\" } } } }, @@ -293,13 +295,13 @@ let tests = [ /* @flow */ type Type = Name | ListType | NonNullType; -type Name = { kind: \"Name\", value: string, type: void }; -type ListType = { kind: \"ListType\", type: Type }; -type NonNullType = { kind: \"NonNullType\", type: Name | ListType | BadType }; +type Name = { kind: \\"Name\\", value: string, type: void }; +type ListType = { kind: \\"ListType\\", type: Type }; +type NonNullType = { kind: \\"NonNullType\\", type: Name | ListType | BadType }; type BadType = {}; function getTypeASTName(typeAST: Type): string { - if (!typeAST.type) throw new Error(\"Must be wrapping type\"); // OK + if (!typeAST.type) throw new Error(\\"Must be wrapping type\\"); // OK return getTypeASTName(typeAST.type); // error, BadType not a subtype of Type } @@ -313,7 +315,7 @@ let tests = [ function(x: { done: true, result: string } | { foo: string }) { if (x.done) { - return x.result; // error, consider { foo: \"herp\", done: \"derp\" } + return x.result; // error, consider { foo: \\"herp\\", done: \\"derp\\" } } return x.result; // error }, @@ -323,7 +325,7 @@ let tests = [ function testAlwaysTruthyProp(t: T) { if (t.foo) { - (t.bar: string); // error, consider { baz: \"x\", quux: \"y\", foo: \"boom\" } + (t.bar: string); // error, consider { baz: \\"x\\", quux: \\"y\\", foo: \\"boom\\" } } else { (t.quux: string); // ok. since foo is an object (always truthy), the // else case completely rules out the first branch of @@ -333,9 +335,9 @@ let tests = [ function testSometimesTruthyProp(t: T) { if (t.bar) { - (t.foo: Object); // error, consider { baz: \"x\", quux: \"y\", bar: \"boom\" } + (t.foo: Object); // error, consider { baz: \\"x\\", quux: \\"y\\", bar: \\"boom\\" } } else { - (t.quux: string); // error, consider { foo: {}, bar: \"\" } + (t.quux: string); // error, consider { foo: {}, bar: \\"\\" } } } } @@ -343,20 +345,20 @@ let tests = [ " `; -exports[`test constants.js 1`] = ` +exports[`constants.js 1`] = ` "/* @flow */ -export const SUCCESS: \'SUCCESS\' = \'SUCCESS\'; -export const ERROR: \'ERROR\' = \'ERROR\'; +export const SUCCESS: 'SUCCESS' = 'SUCCESS'; +export const ERROR: 'ERROR' = 'ERROR'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -export const SUCCESS: \"SUCCESS\" = \"SUCCESS\"; -export const ERROR: \"ERROR\" = \"ERROR\"; +export const SUCCESS: \\"SUCCESS\\" = \\"SUCCESS\\"; +export const ERROR: \\"ERROR\\" = \\"ERROR\\"; " `; -exports[`test eq.js 1`] = ` +exports[`eq.js 1`] = ` "/* @flow */ let tests = [ @@ -374,7 +376,7 @@ let tests = [ if (x == null) {} // ok }, - function(x: { y: \'foo\' } | { y: \'bar\' }) { + function(x: { y: 'foo' } | { y: 'bar' }) { if (x.y == 123) {} // error if (x.y === 123) {} // ok }, @@ -402,7 +404,7 @@ let tests = [ } // ok }, - function(x: { y: \"foo\" } | { y: \"bar\" }) { + function(x: { y: \\"foo\\" } | { y: \\"bar\\" }) { if (x.y == 123) { } // error if (x.y === 123) { @@ -412,21 +414,21 @@ let tests = [ " `; -exports[`test exists.js 1`] = ` +exports[`exists.js 1`] = ` "declare class Foo { foo: string; } function foo0(x: ?string): string { - return x && x || \"\"; + return x && x || \\"\\"; } function foo1(x: ?Foo): string { - return x && x.foo || \"\"; + return x && x.foo || \\"\\"; } function foo2(x: ?Class): string { - return x && new x().foo || \"\"; + return x && new x().foo || \\"\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare class Foo { @@ -434,20 +436,20 @@ declare class Foo { } function foo0(x: ?string): string { - return x && x || \"\"; + return x && x || \\"\\"; } function foo1(x: ?Foo): string { - return x && x.foo || \"\"; + return x && x.foo || \\"\\"; } function foo2(x: ?Class): string { - return x && new x().foo || \"\"; + return x && new x().foo || \\"\\"; } " `; -exports[`test func_call.js 1`] = ` +exports[`func_call.js 1`] = ` "// @flow let tests = [ @@ -476,25 +478,25 @@ let tests = [ " `; -exports[`test hasOwnProperty.js 1`] = ` +exports[`hasOwnProperty.js 1`] = ` "/* @flow */ function foo(x:{y?:() => void}) { x.y(); // error: could be undefined - if (x.hasOwnProperty(\'y\')) { + if (x.hasOwnProperty('y')) { x.y(); // error: still could be undefined } - if (x.hasOwnProperty(\'z\')) { - x.z(); // error: unreachable, but we don\'t help you here + if (x.hasOwnProperty('z')) { + x.z(); // error: unreachable, but we don't help you here } } function bar(x:Object) { x.y(); // treated as \`any\`, so allowed - if (x.hasOwnProperty(\'y\')) { + if (x.hasOwnProperty('y')) { x.y(); // still treated as \`any\`, so allowed } - if (x.hasOwnProperty(\'z\')) { + if (x.hasOwnProperty('z')) { x.z(); // also treated as \`any\`, so allowed } } @@ -503,27 +505,27 @@ function bar(x:Object) { function foo(x: { y?: () => void }) { x.y(); // error: could be undefined - if (x.hasOwnProperty(\"y\")) { + if (x.hasOwnProperty(\\"y\\")) { x.y(); // error: still could be undefined } - if (x.hasOwnProperty(\"z\")) { - x.z(); // error: unreachable, but we don\'t help you here + if (x.hasOwnProperty(\\"z\\")) { + x.z(); // error: unreachable, but we don't help you here } } function bar(x: Object) { x.y(); // treated as \`any\`, so allowed - if (x.hasOwnProperty(\"y\")) { + if (x.hasOwnProperty(\\"y\\")) { x.y(); // still treated as \`any\`, so allowed } - if (x.hasOwnProperty(\"z\")) { + if (x.hasOwnProperty(\\"z\\")) { x.z(); // also treated as \`any\`, so allowed } } " `; -exports[`test heap_defassign.js 1`] = ` +exports[`heap_defassign.js 1`] = ` "// @flow type Obj = { p: number | string } @@ -538,13 +540,13 @@ function def_assign_function_havoc(obj: Obj) { function def_assign_setprop_havoc(obj: Obj, obj2: Obj) { obj.p = 10; // (obj.p : number) - obj2.p = \'hey\'; // clears refi + obj2.p = 'hey'; // clears refi var x: number = obj.p; // error, obj.p : number | string } function def_assign_index_havoc(obj: Obj, obj2: Obj) { obj.p = 10; // (obj.p : number) - obj2[\'p\'] = \'hey\'; // clears refi + obj2['p'] = 'hey'; // clears refi var x: number = obj.p; // error, obj.p : number | string } @@ -576,10 +578,10 @@ function def_assign_within_try(b: boolean, obj: Obj) { obj.p = 10; // (obj.p : number) try { f(); // clears refi and might throw - obj.p = \'hey\'; + obj.p = 'hey'; } catch (e) { f(); // clears refi and might throw - obj.p = \'hey\'; + obj.p = 'hey'; } finally { // NOTE: the values understood to flow to obj.p at this point // include the number 42 written downstream; @@ -605,7 +607,7 @@ type Obj2 = { q: number | string } function def_assign_setprop_nohavoc(obj: Obj, obj2: Obj2) { obj.p = 10; // (obj.p : number) - obj2.q = \'hey\'; // doesn\'t clear refi of .p + obj2.q = 'hey'; // doesn't clear refi of .p var x: number = obj.p; // still ok } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -623,13 +625,13 @@ function def_assign_function_havoc(obj: Obj) { function def_assign_setprop_havoc(obj: Obj, obj2: Obj) { obj.p = 10; // (obj.p : number) - obj2.p = \"hey\"; // clears refi + obj2.p = \\"hey\\"; // clears refi var x: number = obj.p; // error, obj.p : number | string } function def_assign_index_havoc(obj: Obj, obj2: Obj) { obj.p = 10; // (obj.p : number) - obj2[\"p\"] = \"hey\"; // clears refi + obj2[\\"p\\"] = \\"hey\\"; // clears refi var x: number = obj.p; // error, obj.p : number | string } @@ -661,10 +663,10 @@ function def_assign_within_try(b: boolean, obj: Obj) { obj.p = 10; // (obj.p : number) try { f(); // clears refi and might throw - obj.p = \"hey\"; + obj.p = \\"hey\\"; } catch (e) { f(); // clears refi and might throw - obj.p = \"hey\"; + obj.p = \\"hey\\"; } finally { // NOTE: the values understood to flow to obj.p at this point // include the number 42 written downstream; @@ -690,13 +692,13 @@ type Obj2 = { q: number | string }; function def_assign_setprop_nohavoc(obj: Obj, obj2: Obj2) { obj.p = 10; // (obj.p : number) - obj2.q = \"hey\"; // doesn\'t clear refi of .p + obj2.q = \\"hey\\"; // doesn't clear refi of .p var x: number = obj.p; // still ok } " `; -exports[`test lib.js 1`] = ` +exports[`lib.js 1`] = ` "/* @flow */ declare var BAZ: {stuff?: (x: number) => void} | void; @@ -707,7 +709,7 @@ declare var BAZ: { stuff?: (x: number) => void } | void; " `; -exports[`test missing-property-cond.js 1`] = ` +exports[`missing-property-cond.js 1`] = ` "// @flow function foo1(o: { x: number }) { @@ -718,7 +720,7 @@ function foo1(o: { x: number }) { function foo2(o: { x: number }) { if (o.p2) { // OK - o.p2.x; // error, since o.p2\'s type is unknown (e.g., could be \`number\`) + o.p2.x; // error, since o.p2's type is unknown (e.g., could be \`number\`) } } @@ -748,10 +750,10 @@ function foo6(o: mixed) { } function foo7(o: mixed) { - if (typeof o.bar === \'string\') {} // error - if (o && typeof o.bar === \'string\') {} // ok - if (o != null && typeof o.bar === \'string\') {} // ok - if (o !== null && o !== undefined && typeof o.bar === \'string\') {} // ok + if (typeof o.bar === 'string') {} // error + if (o && typeof o.bar === 'string') {} // ok + if (o != null && typeof o.bar === 'string') {} // ok + if (o !== null && o !== undefined && typeof o.bar === 'string') {} // ok } function foo8(o: { p: mixed }) { @@ -771,7 +773,7 @@ function foo1(o: { x: number }) { function foo2(o: { x: number }) { if (o.p2) { // OK - o.p2.x; // error, since o.p2\'s type is unknown (e.g., could be \`number\`) + o.p2.x; // error, since o.p2's type is unknown (e.g., could be \`number\`) } } @@ -805,13 +807,13 @@ function foo6(o: mixed) { } function foo7(o: mixed) { - if (typeof o.bar === \"string\") { + if (typeof o.bar === \\"string\\") { } // error - if (o && typeof o.bar === \"string\") { + if (o && typeof o.bar === \\"string\\") { } // ok - if (o != null && typeof o.bar === \"string\") { + if (o != null && typeof o.bar === \\"string\\") { } // ok - if (o !== null && o !== undefined && typeof o.bar === \"string\") { + if (o !== null && o !== undefined && typeof o.bar === \\"string\\") { } // ok } @@ -824,59 +826,59 @@ function foo8(o: { p: mixed }) { " `; -exports[`test mixed.js 1`] = ` +exports[`mixed.js 1`] = ` "/* @flow */ function takesNumber(x: number) {} function takesString(x: string) {} function num(x: mixed) { - if (typeof x === \"number\") { + if (typeof x === \\"number\\") { takesString(x); // error - (!x: false); // error: we don\'t know the truthiness of x + (!x: false); // error: we don't know the truthiness of x } - if (typeof x === \"number\" && x) { + if (typeof x === \\"number\\" && x) { (!x: false); // ok } - if (x && typeof x === \"number\") { + if (x && typeof x === \\"number\\") { (!x: false); // ok } } function str(x: mixed) { - if (typeof x === \"string\") { + if (typeof x === \\"string\\") { takesNumber(x); // error - (!x: false); // error: we don\'t know the truthiness of x + (!x: false); // error: we don't know the truthiness of x } - if (typeof x === \"string\" && x) { + if (typeof x === \\"string\\" && x) { (!x: false); // ok } - if (x && typeof x === \"string\") { + if (x && typeof x === \\"string\\") { (!x: false); // ok } } function bool(x: mixed) { - if (typeof x === \"boolean\") { + if (typeof x === \\"boolean\\") { takesString(x); // error - (x: true); // error: we don\'t know the truthiness of x + (x: true); // error: we don't know the truthiness of x } - if (typeof x === \"boolean\" && x) { + if (typeof x === \\"boolean\\" && x) { (x: true); // ok } - if (x && typeof x === \"boolean\") { + if (x && typeof x === \\"boolean\\") { (x: true); // ok } } function fun(x: mixed) { - if (typeof x === \"function\") { + if (typeof x === \\"function\\") { takesString(x); // error } } function obj0(x: mixed) { - if (typeof x === \"object\") { + if (typeof x === \\"object\\") { takesString(x); // error } } @@ -888,7 +890,7 @@ function obj1(x: mixed) { } function undef(x: mixed) { - if (typeof x === \"undefined\") { + if (typeof x === \\"undefined\\") { takesString(x); // error } } @@ -918,25 +920,25 @@ function false_(x: mixed) { } function obj2(x: mixed) { - if (typeof x === \"object\") { + if (typeof x === \\"object\\") { (x: { [key: string]: mixed } | null); if (x !== null) { - (x[\'foo\']: string); // error, mixed + (x['foo']: string); // error, mixed } } } function obj2(x: mixed) { - if (typeof x === \"object\" && x) { + if (typeof x === \\"object\\" && x) { (x: Object); } - if (x && typeof x === \"object\") { + if (x && typeof x === \\"object\\") { (x: Object); } - if (x != null && typeof x === \"object\") { + if (x != null && typeof x === \\"object\\") { (x: Object); } - if (x !== null && typeof x === \"object\") { + if (x !== null && typeof x === \\"object\\") { (x: Object); } } @@ -953,52 +955,52 @@ function takesNumber(x: number) {} function takesString(x: string) {} function num(x: mixed) { - if (typeof x === \"number\") { + if (typeof x === \\"number\\") { takesString(x); // error - (!x: false); // error: we don\'t know the truthiness of x + (!x: false); // error: we don't know the truthiness of x } - if (typeof x === \"number\" && x) { + if (typeof x === \\"number\\" && x) { (!x: false); // ok } - if (x && typeof x === \"number\") { + if (x && typeof x === \\"number\\") { (!x: false); // ok } } function str(x: mixed) { - if (typeof x === \"string\") { + if (typeof x === \\"string\\") { takesNumber(x); // error - (!x: false); // error: we don\'t know the truthiness of x + (!x: false); // error: we don't know the truthiness of x } - if (typeof x === \"string\" && x) { + if (typeof x === \\"string\\" && x) { (!x: false); // ok } - if (x && typeof x === \"string\") { + if (x && typeof x === \\"string\\") { (!x: false); // ok } } function bool(x: mixed) { - if (typeof x === \"boolean\") { + if (typeof x === \\"boolean\\") { takesString(x); // error - (x: true); // error: we don\'t know the truthiness of x + (x: true); // error: we don't know the truthiness of x } - if (typeof x === \"boolean\" && x) { + if (typeof x === \\"boolean\\" && x) { (x: true); // ok } - if (x && typeof x === \"boolean\") { + if (x && typeof x === \\"boolean\\") { (x: true); // ok } } function fun(x: mixed) { - if (typeof x === \"function\") { + if (typeof x === \\"function\\") { takesString(x); // error } } function obj0(x: mixed) { - if (typeof x === \"object\") { + if (typeof x === \\"object\\") { takesString(x); // error } } @@ -1010,7 +1012,7 @@ function obj1(x: mixed) { } function undef(x: mixed) { - if (typeof x === \"undefined\") { + if (typeof x === \\"undefined\\") { takesString(x); // error } } @@ -1040,25 +1042,25 @@ function false_(x: mixed) { } function obj2(x: mixed) { - if (typeof x === \"object\") { + if (typeof x === \\"object\\") { (x: { [key: string]: mixed } | null); if (x !== null) { - (x[\"foo\"]: string); // error, mixed + (x[\\"foo\\"]: string); // error, mixed } } } function obj2(x: mixed) { - if (typeof x === \"object\" && x) { + if (typeof x === \\"object\\" && x) { (x: Object); } - if (x && typeof x === \"object\") { + if (x && typeof x === \\"object\\") { (x: Object); } - if (x != null && typeof x === \"object\") { + if (x != null && typeof x === \\"object\\") { (x: Object); } - if (x !== null && typeof x === \"object\") { + if (x !== null && typeof x === \\"object\\") { (x: Object); } } @@ -1071,14 +1073,14 @@ function arr0(x: mixed) { " `; -exports[`test node1.js 1`] = ` -"module.exports = \'Node1\'; +exports[`node1.js 1`] = ` +"module.exports = 'Node1'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = \"Node1\"; +module.exports = \\"Node1\\"; " `; -exports[`test not.js 1`] = ` +exports[`not.js 1`] = ` "/* @flow */ function foo(x: ?bool) { @@ -1187,7 +1189,7 @@ let tests = [ " `; -exports[`test null.js 1`] = ` +exports[`null.js 1`] = ` "/* @flow */ function null_bogus_comparison() { @@ -1212,7 +1214,7 @@ function null_bogus_comparison() { " `; -exports[`test number.js 1`] = ` +exports[`number.js 1`] = ` "// @flow type Mode = 0 | 1 | 2; @@ -1300,7 +1302,7 @@ let tests = [ function(n: number): Mode { if (n !== 0 && n !== 1 && n !== 2) { - throw new Error(\"Wrong number passed\"); + throw new Error(\\"Wrong number passed\\"); } return n; }, @@ -1422,7 +1424,7 @@ let tests = [ function(n: number): Mode { if (n !== 0 && n !== 1 && n !== 2) { - throw new Error(\"Wrong number passed\"); + throw new Error(\\"Wrong number passed\\"); } return n; }, @@ -1459,88 +1461,88 @@ let tests = [ " `; -exports[`test property.js 1`] = ` +exports[`property.js 1`] = ` "/* @flow */ function a(x: {[key: string]: ?string}, y: string): string { if (x[y]) { return x[y]; } - return \"\"; + return \\"\\"; } function b(x: {y: {[key: string]: ?string}}, z: string): string { if (x.y[z]) { return x.y[z]; } - return \"\"; + return \\"\\"; } function c(x: {[key: string]: ?string}, y: {z: string}): string { if (x[y.z]) { return x[y.z]; } - return \"\"; + return \\"\\"; } function d(x: {y: {[key: string]: ?string}}, a: {b: string}): string { if (x.y[a.b]) { return x.y[a.b]; } - return \"\"; + return \\"\\"; } function a_array(x: Array, y: number): string { if (x[y]) { return x[y]; } - return \"\"; + return \\"\\"; } function b_array(x: {y: Array}, z: number): string { if (x.y[z]) { return x.y[z]; } - return \"\"; + return \\"\\"; } function c_array(x: Array, y: {z: number}): string { if (x[y.z]) { return x[y.z]; } - return \"\"; + return \\"\\"; } function d_array(x: {y: Array}, a: {b: number}): string { if (x.y[a.b]) { return x.y[a.b]; } - return \"\"; + return \\"\\"; } function e_array(x: Array): string { if (x[0]) { return x[0]; } - return \"\"; + return \\"\\"; } // --- name-sensitive havoc --- function c2(x: {[key: string]: ?string}, y: {z: string}): string { if (x[y.z]) { - y.z = \"HEY\"; + y.z = \\"HEY\\"; return x[y.z]; // error } - return \"\"; + return \\"\\"; } function c3(x: {[key: string]: ?string}, y: {z: string, a: string}): string { if (x[y.z]) { - y.a = \"HEY\"; + y.a = \\"HEY\\"; return x[y.z]; // ok } - return \"\"; + return \\"\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -1549,73 +1551,73 @@ function a(x: { [key: string]: ?string }, y: string): string { if (x[y]) { return x[y]; } - return \"\"; + return \\"\\"; } function b(x: { y: { [key: string]: ?string } }, z: string): string { if (x.y[z]) { return x.y[z]; } - return \"\"; + return \\"\\"; } function c(x: { [key: string]: ?string }, y: { z: string }): string { if (x[y.z]) { return x[y.z]; } - return \"\"; + return \\"\\"; } function d(x: { y: { [key: string]: ?string } }, a: { b: string }): string { if (x.y[a.b]) { return x.y[a.b]; } - return \"\"; + return \\"\\"; } function a_array(x: Array, y: number): string { if (x[y]) { return x[y]; } - return \"\"; + return \\"\\"; } function b_array(x: { y: Array }, z: number): string { if (x.y[z]) { return x.y[z]; } - return \"\"; + return \\"\\"; } function c_array(x: Array, y: { z: number }): string { if (x[y.z]) { return x[y.z]; } - return \"\"; + return \\"\\"; } function d_array(x: { y: Array }, a: { b: number }): string { if (x.y[a.b]) { return x.y[a.b]; } - return \"\"; + return \\"\\"; } function e_array(x: Array): string { if (x[0]) { return x[0]; } - return \"\"; + return \\"\\"; } // --- name-sensitive havoc --- function c2(x: { [key: string]: ?string }, y: { z: string }): string { if (x[y.z]) { - y.z = \"HEY\"; + y.z = \\"HEY\\"; return x[y.z]; // error } - return \"\"; + return \\"\\"; } function c3( @@ -1623,18 +1625,18 @@ function c3( y: { z: string, a: string } ): string { if (x[y.z]) { - y.a = \"HEY\"; + y.a = \\"HEY\\"; return x[y.z]; // ok } - return \"\"; + return \\"\\"; } " `; -exports[`test refinements.js 1`] = ` +exports[`refinements.js 1`] = ` "function foo(b) { var x = b? 0 : null; - while (typeof x == \"string\" || typeof x == \"number\") { + while (typeof x == \\"string\\" || typeof x == \\"number\\") { var y:string = x; x = false; } @@ -1655,10 +1657,10 @@ function qux() { var x = 0; try { maybe_throw(); - x = \"hello\"; + x = \\"hello\\"; } catch (e) { maybe_throw(); - x = \"hello\"; + x = \\"hello\\"; } finally { // NOTE: the values understood to flow to x at this point // include the number 42 written downstream; @@ -1672,7 +1674,7 @@ function qux() { function corge(b) { for (var x = b? 0 : null; - typeof x == \"string\" || typeof x == \"number\"; + typeof x == \\"string\\" || typeof x == \\"number\\"; x = false) { var y:string = x; } @@ -1691,8 +1693,8 @@ function waldo() { // regression test: bring a global into scope by testing it. // this has no refinement consequences and is error-free. // the way we currently cache global lookups causes uneven -// distribution of the global\'s entries at path merge time, -// so we need to recognize that it\'s legit rather than an +// distribution of the global's entries at path merge time, +// so we need to recognize that it's legit rather than an // internal error. // function global_in_conditional0(x: number) { @@ -1713,7 +1715,7 @@ function global_in_conditional2(x: number) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function foo(b) { var x = b ? 0 : null; - while (typeof x == \"string\" || typeof x == \"number\") { + while (typeof x == \\"string\\" || typeof x == \\"number\\") { var y: string = x; x = false; } @@ -1734,10 +1736,10 @@ function qux() { var x = 0; try { maybe_throw(); - x = \"hello\"; + x = \\"hello\\"; } catch (e) { maybe_throw(); - x = \"hello\"; + x = \\"hello\\"; } finally { // NOTE: the values understood to flow to x at this point // include the number 42 written downstream; @@ -1752,7 +1754,7 @@ function qux() { function corge(b) { for ( var x = b ? 0 : null; - typeof x == \"string\" || typeof x == \"number\"; + typeof x == \\"string\\" || typeof x == \\"number\\"; x = false ) { var y: string = x; @@ -1772,8 +1774,8 @@ function waldo() { // regression test: bring a global into scope by testing it. // this has no refinement consequences and is error-free. // the way we currently cache global lookups causes uneven -// distribution of the global\'s entries at path merge time, -// so we need to recognize that it\'s legit rather than an +// distribution of the global's entries at path merge time, +// so we need to recognize that it's legit rather than an // internal error. // function global_in_conditional0(x: number) { @@ -1794,76 +1796,76 @@ function global_in_conditional2(x: number) { " `; -exports[`test string.js 1`] = ` +exports[`string.js 1`] = ` "// @flow -type Mode = \"a\" | \"b\" | \"c\"; +type Mode = \\"a\\" | \\"b\\" | \\"c\\"; let tests = [ function(x: string) { - if (x === \'foo\') { + if (x === 'foo') { (x: void); // error } - (x: \'foo\'); // error + (x: 'foo'); // error }, function(x: string) { - if (x !== \'foo\') { - (x: \'foo\'); // error + if (x !== 'foo') { + (x: 'foo'); // error } (x: void); // error }, - function(x: \'bar\'): \'foo\' { - if (x === \'foo\') { + function(x: 'bar'): 'foo' { + if (x === 'foo') { return x; // unreachable, no error } - return \'foo\'; + return 'foo'; }, - function(x: \'foo\'): string { - if (x === \'bar\') { + function(x: 'foo'): string { + if (x === 'bar') { return x; } return x; }, - function(x: \'foo\') { - if (x !== \'bar\') { - (x: \'foo\'); + function(x: 'foo') { + if (x !== 'bar') { + (x: 'foo'); } - (x: \'foo\'); + (x: 'foo'); }, - function(x: \'foo\'): string { - if (x === \'foo\') { + function(x: 'foo'): string { + if (x === 'foo') { return x; } return x; }, - function(x: \'foo\' | \'bar\') { - if (x === \'foo\') { - (x: \'foo\'); + function(x: 'foo' | 'bar') { + if (x === 'foo') { + (x: 'foo'); (x: void); // error } - if (x === \'bar\') { - (x: \'bar\'); + if (x === 'bar') { + (x: 'bar'); (x: void); // error } }, - function(x: { foo: string }): \'foo\' { - if (x.foo === \'foo\') { + function(x: { foo: string }): 'foo' { + if (x.foo === 'foo') { return x.foo; } return x.foo; // error }, function( - x: { kind: \'foo\', foo: string } | { kind: \'bar\', bar: string } + x: { kind: 'foo', foo: string } | { kind: 'bar', bar: string } ): string { - if (x.kind === \'foo\') { + if (x.kind === 'foo') { return x.foo; } else { return x.bar; @@ -1882,122 +1884,122 @@ let tests = [ function(str: string): Mode { var ch = str[0]; - if (ch !== \"a\" && ch !== \"b\" && ch !== \"c\") { - throw new Error(\"Wrong string passed\"); + if (ch !== \\"a\\" && ch !== \\"b\\" && ch !== \\"c\\") { + throw new Error(\\"Wrong string passed\\"); } return ch; }, function(s: string): ?Mode { - if (s === \"a\") { + if (s === \\"a\\") { return s; - } else if (s === \"d\") { + } else if (s === \\"d\\") { return s; // error } }, function(mode: Mode) { switch (mode) { - case \"a\": - (mode: \"a\"); + case \\"a\\": + (mode: \\"a\\"); break; - case \"b\": - case \"c\": - (mode: \"b\" | \"c\"); + case \\"b\\": + case \\"c\\": + (mode: \\"b\\" | \\"c\\"); break; } }, - function(x: string): \"\" { + function(x: string): \\"\\" { if (x) { return x; // error } else { - return x; // no error, inferred to be \"\" + return x; // no error, inferred to be \\"\\" } }, // Simple template literals are ok - function(x: string): \'foo\' { + function(x: string): 'foo' { if (x === \`foo\`) { return x; } if (\`foo\` === x) { return x; } - return \'foo\'; + return 'foo'; }, ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -type Mode = \"a\" | \"b\" | \"c\"; +type Mode = \\"a\\" | \\"b\\" | \\"c\\"; let tests = [ function(x: string) { - if (x === \"foo\") { + if (x === \\"foo\\") { (x: void); // error } - (x: \"foo\"); // error + (x: \\"foo\\"); // error }, function(x: string) { - if (x !== \"foo\") { - (x: \"foo\"); // error + if (x !== \\"foo\\") { + (x: \\"foo\\"); // error } (x: void); // error }, - function(x: \"bar\"): \"foo\" { - if (x === \"foo\") { + function(x: \\"bar\\"): \\"foo\\" { + if (x === \\"foo\\") { return x; // unreachable, no error } - return \"foo\"; + return \\"foo\\"; }, - function(x: \"foo\"): string { - if (x === \"bar\") { + function(x: \\"foo\\"): string { + if (x === \\"bar\\") { return x; } return x; }, - function(x: \"foo\") { - if (x !== \"bar\") { - (x: \"foo\"); + function(x: \\"foo\\") { + if (x !== \\"bar\\") { + (x: \\"foo\\"); } - (x: \"foo\"); + (x: \\"foo\\"); }, - function(x: \"foo\"): string { - if (x === \"foo\") { + function(x: \\"foo\\"): string { + if (x === \\"foo\\") { return x; } return x; }, - function(x: \"foo\" | \"bar\") { - if (x === \"foo\") { - (x: \"foo\"); + function(x: \\"foo\\" | \\"bar\\") { + if (x === \\"foo\\") { + (x: \\"foo\\"); (x: void); // error } - if (x === \"bar\") { - (x: \"bar\"); + if (x === \\"bar\\") { + (x: \\"bar\\"); (x: void); // error } }, - function(x: { foo: string }): \"foo\" { - if (x.foo === \"foo\") { + function(x: { foo: string }): \\"foo\\" { + if (x.foo === \\"foo\\") { return x.foo; } return x.foo; // error }, function( - x: { kind: \"foo\", foo: string } | { kind: \"bar\", bar: string } + x: { kind: \\"foo\\", foo: string } | { kind: \\"bar\\", bar: string } ): string { - if (x.kind === \"foo\") { + if (x.kind === \\"foo\\") { return x.foo; } else { return x.bar; @@ -2018,71 +2020,71 @@ let tests = [ function(str: string): Mode { var ch = str[0]; - if (ch !== \"a\" && ch !== \"b\" && ch !== \"c\") { - throw new Error(\"Wrong string passed\"); + if (ch !== \\"a\\" && ch !== \\"b\\" && ch !== \\"c\\") { + throw new Error(\\"Wrong string passed\\"); } return ch; }, function(s: string): ?Mode { - if (s === \"a\") { + if (s === \\"a\\") { return s; - } else if (s === \"d\") { + } else if (s === \\"d\\") { return s; // error } }, function(mode: Mode) { switch (mode) { - case \"a\": - (mode: \"a\"); + case \\"a\\": + (mode: \\"a\\"); break; - case \"b\": - case \"c\": - (mode: \"b\" | \"c\"); + case \\"b\\": + case \\"c\\": + (mode: \\"b\\" | \\"c\\"); break; } }, - function(x: string): \"\" { + function(x: string): \\"\\" { if (x) { return x; // error } else { - return x; // no error, inferred to be \"\" + return x; // no error, inferred to be \\"\\" } }, // Simple template literals are ok - function(x: string): \"foo\" { + function(x: string): \\"foo\\" { if (x === \`foo\`) { return x; } if (\`foo\` === x) { return x; } - return \"foo\"; + return \\"foo\\"; } ]; " `; -exports[`test super_member.js 1`] = ` +exports[`super_member.js 1`] = ` "/* @flow */ class A { prop: string; method(): string { - return \"A\"; + return \\"A\\"; } } class B { test(): string { - if (super.prop) { // super.prop doesn\'t exist + if (super.prop) { // super.prop doesn't exist return super.prop; // error, unknown type passed to string expected } - return \"B\"; + return \\"B\\"; } } @@ -2091,7 +2093,7 @@ class C extends A { if (super.prop) { return super.prop; // OK } - return \"C\"; + return \\"C\\"; } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2100,17 +2102,17 @@ class C extends A { class A { prop: string; method(): string { - return \"A\"; + return \\"A\\"; } } class B { test(): string { if (super.prop) { - // super.prop doesn\'t exist + // super.prop doesn't exist return super.prop; // error, unknown type passed to string expected } - return \"B\"; + return \\"B\\"; } } @@ -2119,66 +2121,66 @@ class C extends A { if (super.prop) { return super.prop; // OK } - return \"C\"; + return \\"C\\"; } } " `; -exports[`test switch.js 1`] = ` +exports[`switch.js 1`] = ` "/* @flow */ function foo(text: string | number): string { switch (typeof text) { -  case \'string\': +  case 'string':    return text; - case \'number\': + case 'number': return text; // error, should return string   default: -   return \'wat\'; +   return 'wat';  } } function bar(text: string | number): string { switch (typeof text) { - case \'string\': + case 'string': return text[0];  default: - return (text++) + \'\'; + return (text++) + '';  } } function baz1(text: string | number): string { switch (typeof text) { - case \'number\': - case \'string\': + case 'number': + case 'string': return text[0]; // error, [0] on number  default: - return \'wat\'; + return 'wat';  } } function baz2(text: string | number): string { switch (typeof text) { - case \'string\': - case \'number\': + case 'string': + case 'number': return text[0]; // error, [0] on number  default: - return \'wat\'; + return 'wat';  } } function corge(text: string | number | Array): string { switch (typeof text) { - case \'object\': + case 'object': return text[0]; - case \'string\': - case \'number\': - // using ++ since it isn\'t valid on arrays or strings. + case 'string': + case 'number': + // using ++ since it isn't valid on arrays or strings. // should only error for string since Array was filtered out. - return (text++) + \'\'; + return (text++) + '';  default: - return \'wat\'; + return 'wat';  } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2186,64 +2188,64 @@ function corge(text: string | number | Array): string { function foo(text: string | number): string { switch (typeof text) { - case \"string\": + case \\"string\\": return text; - case \"number\": + case \\"number\\": return text; // error, should return string default: - return \"wat\"; + return \\"wat\\"; } } function bar(text: string | number): string { switch (typeof text) { - case \"string\": + case \\"string\\": return text[0]; default: - return text++ + \"\"; + return text++ + \\"\\"; } } function baz1(text: string | number): string { switch (typeof text) { - case \"number\": - case \"string\": + case \\"number\\": + case \\"string\\": return text[0]; // error, [0] on number default: - return \"wat\"; + return \\"wat\\"; } } function baz2(text: string | number): string { switch (typeof text) { - case \"string\": - case \"number\": + case \\"string\\": + case \\"number\\": return text[0]; // error, [0] on number default: - return \"wat\"; + return \\"wat\\"; } } function corge(text: string | number | Array): string { switch (typeof text) { - case \"object\": + case \\"object\\": return text[0]; - case \"string\": - case \"number\": // using ++ since it isn\'t valid on arrays or strings. // should only error for string since Array was filtered out. - return text++ + \"\"; + case \\"string\\": + case \\"number\\": // using ++ since it isn't valid on arrays or strings. // should only error for string since Array was filtered out. + return text++ + \\"\\"; default: - return \"wat\"; + return \\"wat\\"; } } " `; -exports[`test tagged_union.js 1`] = ` +exports[`tagged_union.js 1`] = ` "// example 1 type Type = Name | ListType; -type Name = {kind: \'Name\', value: string}; -type ListType = {kind: \'ListType\', name: string}; +type Name = {kind: 'Name', value: string}; +type ListType = {kind: 'ListType', name: string}; function getTypeASTName(typeAST: Type): string { - if (typeAST.kind === \'Name\') { + if (typeAST.kind === 'Name') { return typeAST.value; // OK, since typeAST: Name } else { return typeAST.name; // OK, since typeAST: ListType @@ -2251,8 +2253,8 @@ function getTypeASTName(typeAST: Type): string { } // example 2 -import type {ASTNode} from \'./ast_node\'; -var Node = require(\'./node1\'); // Node = \"Node1\" +import type {ASTNode} from './ast_node'; +var Node = require('./node1'); // Node = \\"Node1\\" function foo(x: ASTNode) { if (x.kind === Node) { return x.prop1.charAt(0); // typeAST: Node1, but x.prop1 may be undefined @@ -2261,34 +2263,34 @@ function foo(x: ASTNode) { } // example 3 -type Apple = { kind: \'Fruit\', taste: \'Bad\' } -type Orange = { kind: \'Fruit\', taste: \'Good\' } -type Broccoli = { kind: \'Veg\', taste: \'Bad\', raw: \'No\' } -type Carrot = { kind: \'Veg\', taste: \'Good\', raw: \'Maybe\' } +type Apple = { kind: 'Fruit', taste: 'Bad' } +type Orange = { kind: 'Fruit', taste: 'Good' } +type Broccoli = { kind: 'Veg', taste: 'Bad', raw: 'No' } +type Carrot = { kind: 'Veg', taste: 'Good', raw: 'Maybe' } type Breakfast = Apple | Orange | Broccoli | Carrot function bar(x: Breakfast) { - if (x.kind === \'Fruit\') { (x.taste: \'Good\'); } // error, Apple.taste = Bad - else (x.raw: \'No\'); // error, Carrot.raw = Maybe + if (x.kind === 'Fruit') { (x.taste: 'Good'); } // error, Apple.taste = Bad + else (x.raw: 'No'); // error, Carrot.raw = Maybe } function qux(x: Breakfast) { - if (x.taste === \'Good\') { - (x.raw: \'Yes\' | \'No\'); // 2 errors: - // Orange.raw doesn\'t exist + if (x.taste === 'Good') { + (x.raw: 'Yes' | 'No'); // 2 errors: + // Orange.raw doesn't exist // Carrot.raw is neither Yes nor No } } // example 4 function list(n) { - if (n > 0) return { kind: \"cons\", next: list(n-1) }; - return { kind: \"nil\" }; + if (n > 0) return { kind: \\"cons\\", next: list(n-1) }; + return { kind: \\"nil\\" }; } function length(l) { switch (l.kind) { - case \"cons\": return 1 + length(l.next); + case \\"cons\\": return 1 + length(l.next); default: return 0; } } @@ -2316,7 +2318,7 @@ kind({ kind: EnumKind.A, A: 1 }); type Citizen = { citizen: true }; type NonCitizen = { citizen: false, nationality: string } function nationality(x: Citizen | NonCitizen) { - if (x.citizen) return \"Shire\" + if (x.citizen) return \\"Shire\\" else return x.nationality; } @@ -2324,14 +2326,14 @@ let tests = [ // non-existent props function test7(x: A) { if (x.kindTypo === 1) { // typos are allowed to be tested - (x.kindTypo: string); // typos can\'t be used, though + (x.kindTypo: string); // typos can't be used, though } }, // nested objects function test8(x: {foo: {bar: 1}}) { if (x.foo.bar === 1) {} - if (x.fooTypo.bar === 1) {} // error, fooTypo doesn\'t exist + if (x.fooTypo.bar === 1) {} // error, fooTypo doesn't exist }, // invalid RHS @@ -2347,22 +2349,22 @@ let tests = [ ) { if (x.length === 0) {} if (x.legnth === 0) { // typos are allowed to be tested - (x.legnth: number); // inside the block, it\'s a number + (x.legnth: number); // inside the block, it's a number (x.legnth: string); // error: number literal 0 !~> string } if (y.length === 0) {} if (y.legnth === 0) { // typos are allowed to be tested - (y.legnth: number); // inside the block, it\'s a number + (y.legnth: number); // inside the block, it's a number (y.legnth: string); // error: number literal 0 !~> string } if (z.toString === 0) {} if (z.toStirng === 0) { // typos are allowed to be tested - (z.toStirng: number); // inside the block, it\'s a number + (z.toStirng: number); // inside the block, it's a number (z.toStirng: string); // error: number literal 0 !~> string } if (q.valueOf === 0) {} if (q.valeuOf === 0) { // typos are allowed to be tested - (q.valeuOf: number); // inside the block, it\'s a number + (q.valeuOf: number); // inside the block, it's a number (q.valeuOf: string); // error: number literal 0 !~> string } if (r.toStirng === 0) { // typos are allowed to be tested @@ -2380,8 +2382,8 @@ let tests = [ // sentinel props become the RHS function(x: { str: string, num: number, bool: boolean }) { - if (x.str === \'str\') { - (x.str: \'not str\'); // error: \'str\' !~> \'not str\' + if (x.str === 'str') { + (x.str: 'not str'); // error: 'str' !~> 'not str' } if (x.num === 123) { (x.num: 456); // error: 123 !~> 456 @@ -2389,9 +2391,9 @@ let tests = [ if (x.bool === true) { (x.bool: false); // error: true !~> false } - // even if it doesn\'t exist... - if (x.badStr === \'bad\') { - (x.badStr: empty); // error: \'bad\' !~> empty + // even if it doesn't exist... + if (x.badStr === 'bad') { + (x.badStr: empty); // error: 'bad' !~> empty } if (x.badNum === 123) { (x.badNum: empty); // error: 123 !~> empty @@ -2402,7 +2404,7 @@ let tests = [ }, // type mismatch - function(x: { foo: 123, y: string } | { foo: \'foo\', z: string }) { + function(x: { foo: 123, y: string } | { foo: 'foo', z: string }) { if (x.foo === 123) { (x.y: string); x.z; // error @@ -2410,7 +2412,7 @@ let tests = [ (x.z: string); x.y; // error } - if (x.foo === \'foo\') { + if (x.foo === 'foo') { (x.z: string); x.y; // error } else { @@ -2420,16 +2422,16 @@ let tests = [ }, // type mismatch, but one is not a literal - function(x: { foo: number, y: string } | { foo: \'foo\', z: string }) { + function(x: { foo: number, y: string } | { foo: 'foo', z: string }) { if (x.foo === 123) { - (x.y: string); // ok, because 123 !== \'foo\' + (x.y: string); // ok, because 123 !== 'foo' x.z; // error } else { x.y; // error: x.foo could be a string x.z; // error: could still be either case (if foo was a different number) } - if (x.foo === \'foo\') { + if (x.foo === 'foo') { (x.z: string); x.y; // error } else { @@ -2448,7 +2450,7 @@ let tests = [ x.z; // error: could still be either case (if foo was a different number) } - if (x.foo === \'foo\') { + if (x.foo === 'foo') { (x.z: string); x.y; // error } else { @@ -2463,7 +2465,7 @@ let tests = [ num: number ) { if (x.foo === num) { - x.y; // error: flow isn\'t smart enough to figure this out yet + x.y; // error: flow isn't smart enough to figure this out yet x.z; // error } } @@ -2472,11 +2474,11 @@ let tests = [ // example 1 type Type = Name | ListType; -type Name = { kind: \"Name\", value: string }; -type ListType = { kind: \"ListType\", name: string }; +type Name = { kind: \\"Name\\", value: string }; +type ListType = { kind: \\"ListType\\", name: string }; function getTypeASTName(typeAST: Type): string { - if (typeAST.kind === \"Name\") { + if (typeAST.kind === \\"Name\\") { return typeAST.value; // OK, since typeAST: Name } else { return typeAST.name; // OK, since typeAST: ListType @@ -2484,8 +2486,8 @@ function getTypeASTName(typeAST: Type): string { } // example 2 -import type { ASTNode } from \"./ast_node\"; -var Node = require(\"./node1\"); // Node = \"Node1\" +import type { ASTNode } from \\"./ast_node\\"; +var Node = require(\\"./node1\\"); // Node = \\"Node1\\" function foo(x: ASTNode) { if (x.kind === Node) { return x.prop1.charAt(0); // typeAST: Node1, but x.prop1 may be undefined @@ -2494,36 +2496,36 @@ function foo(x: ASTNode) { } // example 3 -type Apple = { kind: \"Fruit\", taste: \"Bad\" }; -type Orange = { kind: \"Fruit\", taste: \"Good\" }; -type Broccoli = { kind: \"Veg\", taste: \"Bad\", raw: \"No\" }; -type Carrot = { kind: \"Veg\", taste: \"Good\", raw: \"Maybe\" }; +type Apple = { kind: \\"Fruit\\", taste: \\"Bad\\" }; +type Orange = { kind: \\"Fruit\\", taste: \\"Good\\" }; +type Broccoli = { kind: \\"Veg\\", taste: \\"Bad\\", raw: \\"No\\" }; +type Carrot = { kind: \\"Veg\\", taste: \\"Good\\", raw: \\"Maybe\\" }; type Breakfast = Apple | Orange | Broccoli | Carrot; function bar(x: Breakfast) { - if (x.kind === \"Fruit\") { - (x.taste: \"Good\"); + if (x.kind === \\"Fruit\\") { + (x.taste: \\"Good\\"); } else // error, Apple.taste = Bad - (x.raw: \"No\"); // error, Carrot.raw = Maybe + (x.raw: \\"No\\"); // error, Carrot.raw = Maybe } function qux(x: Breakfast) { - if (x.taste === \"Good\") { - (x.raw: \"Yes\" | \"No\"); // 2 errors: - // Orange.raw doesn\'t exist + if (x.taste === \\"Good\\") { + (x.raw: \\"Yes\\" | \\"No\\"); // 2 errors: + // Orange.raw doesn't exist // Carrot.raw is neither Yes nor No } } // example 4 function list(n) { - if (n > 0) return { kind: \"cons\", next: list(n - 1) }; - return { kind: \"nil\" }; + if (n > 0) return { kind: \\"cons\\", next: list(n - 1) }; + return { kind: \\"nil\\" }; } function length(l) { switch (l.kind) { - case \"cons\": + case \\"cons\\": return 1 + length(l.next); default: return 0; @@ -2555,7 +2557,7 @@ kind({ kind: EnumKind.A, A: 1 }); type Citizen = { citizen: true }; type NonCitizen = { citizen: false, nationality: string }; function nationality(x: Citizen | NonCitizen) { - if (x.citizen) return \"Shire\"; + if (x.citizen) return \\"Shire\\"; else return x.nationality; } @@ -2564,7 +2566,7 @@ let tests = [ function test7(x: A) { if (x.kindTypo === 1) { // typos are allowed to be tested - (x.kindTypo: string); // typos can\'t be used, though + (x.kindTypo: string); // typos can't be used, though } }, @@ -2573,7 +2575,7 @@ let tests = [ if (x.foo.bar === 1) { } if (x.fooTypo.bar === 1) { - } // error, fooTypo doesn\'t exist + } // error, fooTypo doesn't exist }, // invalid RHS @@ -2598,28 +2600,28 @@ let tests = [ } if (x.legnth === 0) { // typos are allowed to be tested - (x.legnth: number); // inside the block, it\'s a number + (x.legnth: number); // inside the block, it's a number (x.legnth: string); // error: number literal 0 !~> string } if (y.length === 0) { } if (y.legnth === 0) { // typos are allowed to be tested - (y.legnth: number); // inside the block, it\'s a number + (y.legnth: number); // inside the block, it's a number (y.legnth: string); // error: number literal 0 !~> string } if (z.toString === 0) { } if (z.toStirng === 0) { // typos are allowed to be tested - (z.toStirng: number); // inside the block, it\'s a number + (z.toStirng: number); // inside the block, it's a number (z.toStirng: string); // error: number literal 0 !~> string } if (q.valueOf === 0) { } if (q.valeuOf === 0) { // typos are allowed to be tested - (q.valeuOf: number); // inside the block, it\'s a number + (q.valeuOf: number); // inside the block, it's a number (q.valeuOf: string); // error: number literal 0 !~> string } if (r.toStirng === 0) { @@ -2642,8 +2644,8 @@ let tests = [ // sentinel props become the RHS function(x: { str: string, num: number, bool: boolean }) { - if (x.str === \"str\") { - (x.str: \"not str\"); // error: \'str\' !~> \'not str\' + if (x.str === \\"str\\") { + (x.str: \\"not str\\"); // error: 'str' !~> 'not str' } if (x.num === 123) { (x.num: 456); // error: 123 !~> 456 @@ -2651,9 +2653,9 @@ let tests = [ if (x.bool === true) { (x.bool: false); // error: true !~> false } - // even if it doesn\'t exist... - if (x.badStr === \"bad\") { - (x.badStr: empty); // error: \'bad\' !~> empty + // even if it doesn't exist... + if (x.badStr === \\"bad\\") { + (x.badStr: empty); // error: 'bad' !~> empty } if (x.badNum === 123) { (x.badNum: empty); // error: 123 !~> empty @@ -2664,7 +2666,7 @@ let tests = [ }, // type mismatch - function(x: { foo: 123, y: string } | { foo: \"foo\", z: string }) { + function(x: { foo: 123, y: string } | { foo: \\"foo\\", z: string }) { if (x.foo === 123) { (x.y: string); x.z; // error @@ -2672,7 +2674,7 @@ let tests = [ (x.z: string); x.y; // error } - if (x.foo === \"foo\") { + if (x.foo === \\"foo\\") { (x.z: string); x.y; // error } else { @@ -2682,16 +2684,16 @@ let tests = [ }, // type mismatch, but one is not a literal - function(x: { foo: number, y: string } | { foo: \"foo\", z: string }) { + function(x: { foo: number, y: string } | { foo: \\"foo\\", z: string }) { if (x.foo === 123) { - (x.y: string); // ok, because 123 !== \'foo\' + (x.y: string); // ok, because 123 !== 'foo' x.z; // error } else { x.y; // error: x.foo could be a string x.z; // error: could still be either case (if foo was a different number) } - if (x.foo === \"foo\") { + if (x.foo === \\"foo\\") { (x.z: string); x.y; // error } else { @@ -2710,7 +2712,7 @@ let tests = [ x.z; // error: could still be either case (if foo was a different number) } - if (x.foo === \"foo\") { + if (x.foo === \\"foo\\") { (x.z: string); x.y; // error } else { @@ -2725,7 +2727,7 @@ let tests = [ num: number ) { if (x.foo === num) { - x.y; // error: flow isn\'t smart enough to figure this out yet + x.y; // error: flow isn't smart enough to figure this out yet x.z; // error } } @@ -2733,10 +2735,10 @@ let tests = [ " `; -exports[`test tagged_union_import.js 1`] = ` +exports[`tagged_union_import.js 1`] = ` "/* @flow */ -import { SUCCESS, ERROR } from \'./constants\' +import { SUCCESS, ERROR } from './constants' type Success = { type: typeof SUCCESS, @@ -2760,7 +2762,7 @@ function handleStatus(status: Success | Error) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -import { SUCCESS, ERROR } from \"./constants\"; +import { SUCCESS, ERROR } from \\"./constants\\"; type Success = { type: typeof SUCCESS, @@ -2784,18 +2786,18 @@ function handleStatus(status: Success | Error) { " `; -exports[`test typeof.js 1`] = ` +exports[`typeof.js 1`] = ` "/* @flow */ function foo(x: bool | number) { - if (typeof x === \"boolean\") { + if (typeof x === \\"boolean\\") { x[0]; // error for boolean, not number } } function bar(): number { var x = null; - if (typeof x === \"object\") { + if (typeof x === \\"object\\") { return x; // error, null } return 0; @@ -2803,37 +2805,37 @@ function bar(): number { /* refining globals */ function fn0() { - if (typeof BAZ !== \'undefined\' && - typeof BAZ.stuff === \'function\') { + if (typeof BAZ !== 'undefined' && + typeof BAZ.stuff === 'function') { BAZ.stuff(123); } BAZ.stuff(123); // error, refinement is gone } function fn1() { BAZ.stuff; // error, could be undefined - if (typeof BAZ !== \'undefined\' && - typeof BAZ.stuff === \'function\') { + if (typeof BAZ !== 'undefined' && + typeof BAZ.stuff === 'function') { BAZ.stuff(123); // ok BAZ.stuff(123); // error, refinement is gone } } function anyfun(x: number | Function): number { - if (typeof x === \"function\") { + if (typeof x === \\"function\\") { return 0; } return x; // OK, x refined to \`number\` } function anyobj(x: number | Object): number { - if (typeof x === \"object\") { + if (typeof x === \\"object\\") { return 0; } return x; // OK, x refined to \`number\` } function testInvalidValue(x: mixed) { - if (typeof x === \"foo\") { // error + if (typeof x === \\"foo\\") { // error return 0; } } @@ -2853,14 +2855,14 @@ function testInvalidTemplateLiteral(x: string | number) { /* @flow */ function foo(x: boolean | number) { - if (typeof x === \"boolean\") { + if (typeof x === \\"boolean\\") { x[0]; // error for boolean, not number } } function bar(): number { var x = null; - if (typeof x === \"object\") { + if (typeof x === \\"object\\") { return x; // error, null } return 0; @@ -2868,35 +2870,35 @@ function bar(): number { /* refining globals */ function fn0() { - if (typeof BAZ !== \"undefined\" && typeof BAZ.stuff === \"function\") { + if (typeof BAZ !== \\"undefined\\" && typeof BAZ.stuff === \\"function\\") { BAZ.stuff(123); } BAZ.stuff(123); // error, refinement is gone } function fn1() { BAZ.stuff; // error, could be undefined - if (typeof BAZ !== \"undefined\" && typeof BAZ.stuff === \"function\") { + if (typeof BAZ !== \\"undefined\\" && typeof BAZ.stuff === \\"function\\") { BAZ.stuff(123); // ok BAZ.stuff(123); // error, refinement is gone } } function anyfun(x: number | Function): number { - if (typeof x === \"function\") { + if (typeof x === \\"function\\") { return 0; } return x; // OK, x refined to \`number\` } function anyobj(x: number | Object): number { - if (typeof x === \"object\") { + if (typeof x === \\"object\\") { return 0; } return x; // OK, x refined to \`number\` } function testInvalidValue(x: mixed) { - if (typeof x === \"foo\") { + if (typeof x === \\"foo\\") { // error return 0; } @@ -2917,7 +2919,7 @@ function testInvalidTemplateLiteral(x: string | number) { " `; -exports[`test undef.js 1`] = ` +exports[`undef.js 1`] = ` "/* @flow */ function undef_var(x: ?number) { @@ -3082,7 +3084,7 @@ function undef_bogus_comparison() { " `; -exports[`test union.js 1`] = ` +exports[`union.js 1`] = ` "/* @flow */ type thing = number | bool @@ -3129,7 +3131,7 @@ function baz(x: ?thing) { " `; -exports[`test void.js 1`] = ` +exports[`void.js 1`] = ` "/* @flow */ function void_var(x: ?number) { @@ -3220,7 +3222,7 @@ function void_bogus_comparison() { } function void_redefined_undefined(x: ?number) { - var undefined = \"foo\"; + var undefined = \\"foo\\"; if (x !== null && x !== void(0)) { var y = x * 1000; } @@ -3316,7 +3318,7 @@ function void_bogus_comparison() { } function void_redefined_undefined(x: ?number) { - var undefined = \"foo\"; + var undefined = \\"foo\\"; if (x !== null && x !== void 0) { var y = x * 1000; } diff --git a/tests/flow/reflection/__snapshots__/jsfmt.spec.js.snap b/tests/flow/reflection/__snapshots__/jsfmt.spec.js.snap index 003aebc88..d12812a68 100644 --- a/tests/flow/reflection/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/reflection/__snapshots__/jsfmt.spec.js.snap @@ -1,19 +1,21 @@ -exports[`test type.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type.js 1`] = ` "declare var a: number; -var b: typeof a = \"...\"; -var c: typeof a = \"...\"; +var b: typeof a = \\"...\\"; +var c: typeof a = \\"...\\"; type T = number; -var x:T = \"...\"; +var x:T = \\"...\\"; // what about recursive unions? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare var a: number; -var b: typeof a = \"...\"; -var c: typeof a = \"...\"; +var b: typeof a = \\"...\\"; +var c: typeof a = \\"...\\"; type T = number; -var x: T = \"...\"; +var x: T = \\"...\\"; // what about recursive unions? " diff --git a/tests/flow/regexp/__snapshots__/jsfmt.spec.js.snap b/tests/flow/regexp/__snapshots__/jsfmt.spec.js.snap index 8c701b1bf..e4cca008c 100644 --- a/tests/flow/regexp/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/regexp/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test regexp.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`regexp.js 1`] = ` "var patt=/Hello/g -var match:number = patt.test(\"Hello world!\"); +var match:number = patt.test(\\"Hello world!\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var patt = /Hello/g; -var match: number = patt.test(\"Hello world!\"); +var match: number = patt.test(\\"Hello world!\\"); " `; diff --git a/tests/flow/replace/__snapshots__/jsfmt.spec.js.snap b/tests/flow/replace/__snapshots__/jsfmt.spec.js.snap index 9a21d5fb8..097f768c4 100644 --- a/tests/flow/replace/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/replace/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "var a = 0; function foo(x) { } -foo(\"\"); +foo(\\"\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var a = 0; function foo(x) {} -foo(\"\"); +foo(\\"\\"); " `; diff --git a/tests/flow/require/__snapshots__/jsfmt.spec.js.snap b/tests/flow/require/__snapshots__/jsfmt.spec.js.snap index 26293ad86..55c09fecf 100644 --- a/tests/flow/require/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/require/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test B.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`B.js 1`] = ` "/* @flow */ exports.numberValue = 42; @@ -9,14 +11,14 @@ exports.numberValue = 42; " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` "/* @flow */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ " `; -exports[`test E.js 1`] = ` +exports[`E.js 1`] = ` "/* @flow */ // Local \`exports\` var is just a ref to module.exports, so mutating the original @@ -26,7 +28,7 @@ module.exports = { numberValue: 42 }; -exports = {stringValue: \'\'}; +exports = {stringValue: ''}; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -37,11 +39,11 @@ module.exports = { numberValue: 42 }; -exports = { stringValue: \"\" }; +exports = { stringValue: \\"\\" }; " `; -exports[`test ProvidesModuleA.js 1`] = ` +exports[`ProvidesModuleA.js 1`] = ` "/** * @providesModule A * @flow @@ -58,7 +60,7 @@ exports.numberValue = 42; " `; -exports[`test ProvidesModuleD.js 1`] = ` +exports[`ProvidesModuleD.js 1`] = ` "/** * @providesModule D * @flow @@ -71,20 +73,20 @@ exports[`test ProvidesModuleD.js 1`] = ` " `; -exports[`test not_builtin_require.js 1`] = ` +exports[`not_builtin_require.js 1`] = ` "// @flow function require() {} -require(\"not a module name\"); +require(\\"not a module name\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow function require() {} -require(\"not a module name\"); +require(\\"not a module name\\"); " `; -exports[`test not_builtin_require2.js 1`] = ` +exports[`not_builtin_require2.js 1`] = ` "// @flow type require = number; @@ -97,42 +99,42 @@ var a: require = 42; " `; -exports[`test require.js 1`] = ` +exports[`require.js 1`] = ` "/* @flow */ function takesANumber(num: number): void {} function takesAString(str: string): void {} // @providesModule -var A = require(\"A\"); +var A = require(\\"A\\"); takesANumber(A.numberValue); takesAString(A.numberValue); // File path -var B = require(\"./B\"); +var B = require(\\"./B\\"); takesANumber(B.numberValue); takesAString(B.numberValue); // C.js exists, but not as a providesModule -require(\"C\"); +require(\\"C\\"); // @providesModule D exists, but not as a filename -require(\"./D\"); +require(\\"./D\\"); // E exports an object with a numVal property -var E = require(\'./E\'); +var E = require('./E'); var e_1: number = E.numberValue; -E.stringValue; // Error: The E exports obj has no \'stringValue\' property +E.stringValue; // Error: The E exports obj has no 'stringValue' property // We require that the param passed to require() be a string literal to support // guaranteed static extraction -var a = \'./E\'; +var a = './E'; require(a); // Error: Param must be string literal require(\`./E\`); // template literals are ok... -require(\`\${\'./E\'}\`); // error: but only if they have no expressions +require(\`\${'./E'}\`); // error: but only if they have no expressions -// require.call is allowed but circumverts Flow\'s static analysis -require.call(null, \"DoesNotExist\"); +// require.call is allowed but circumverts Flow's static analysis +require.call(null, \\"DoesNotExist\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -140,34 +142,34 @@ function takesANumber(num: number): void {} function takesAString(str: string): void {} // @providesModule -var A = require(\"A\"); +var A = require(\\"A\\"); takesANumber(A.numberValue); takesAString(A.numberValue); // File path -var B = require(\"./B\"); +var B = require(\\"./B\\"); takesANumber(B.numberValue); takesAString(B.numberValue); // C.js exists, but not as a providesModule -require(\"C\"); +require(\\"C\\"); // @providesModule D exists, but not as a filename -require(\"./D\"); +require(\\"./D\\"); // E exports an object with a numVal property -var E = require(\"./E\"); +var E = require(\\"./E\\"); var e_1: number = E.numberValue; -E.stringValue; // Error: The E exports obj has no \'stringValue\' property +E.stringValue; // Error: The E exports obj has no 'stringValue' property // We require that the param passed to require() be a string literal to support // guaranteed static extraction -var a = \"./E\"; +var a = \\"./E\\"; require(a); // Error: Param must be string literal require(\`./E\`); // template literals are ok... -require(\`\${\"./E\"}\`); // error: but only if they have no expressions +require(\`\${\\"./E\\"}\`); // error: but only if they have no expressions -// require.call is allowed but circumverts Flow\'s static analysis -require.call(null, \"DoesNotExist\"); +// require.call is allowed but circumverts Flow's static analysis +require.call(null, \\"DoesNotExist\\"); " `; diff --git a/tests/flow/requireLazy/__snapshots__/jsfmt.spec.js.snap b/tests/flow/requireLazy/__snapshots__/jsfmt.spec.js.snap index 965c3d536..153913e9b 100644 --- a/tests/flow/requireLazy/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/requireLazy/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/** * @providesModule A * @flow @@ -6,7 +8,7 @@ exports[`test A.js 1`] = ` module.exports = { numberValueA: 1, - stringValueA: \"someString\" + stringValueA: \\"someString\\" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** @@ -16,12 +18,12 @@ module.exports = { module.exports = { numberValueA: 1, - stringValueA: \"someString\" + stringValueA: \\"someString\\" }; " `; -exports[`test B.js 1`] = ` +exports[`B.js 1`] = ` "/** * @providesModule B * @flow @@ -29,7 +31,7 @@ exports[`test B.js 1`] = ` module.exports = { numberValueB: 1, - stringValueB: \"someString\" + stringValueB: \\"someString\\" }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** @@ -39,17 +41,17 @@ module.exports = { module.exports = { numberValueB: 1, - stringValueB: \"someString\" + stringValueB: \\"someString\\" }; " `; -exports[`test requireLazy.js 1`] = ` +exports[`requireLazy.js 1`] = ` "/** * @flow */ -requireLazy([\'A\', \'B\'], function(A, B) { +requireLazy(['A', 'B'], function(A, B) { var num1: number = A.numberValueA; var str1: string = A.stringValueA; var num2: number = A.stringValueA; // Error: string ~> number @@ -66,13 +68,13 @@ var notB: Object = B; requireLazy(); // Error: No args requireLazy([nope], function() {}); // Error: Non-stringliteral args -requireLazy([\'A\']); // Error: No calback expression +requireLazy(['A']); // Error: No calback expression ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow */ -requireLazy([\"A\", \"B\"], function(A, B) { +requireLazy([\\"A\\", \\"B\\"], function(A, B) { var num1: number = A.numberValueA; var str1: string = A.stringValueA; var num2: number = A.stringValueA; // Error: string ~> number @@ -89,6 +91,6 @@ var notB: Object = B; requireLazy(); // Error: No args requireLazy([nope], function() {}); // Error: Non-stringliteral args -requireLazy([\"A\"]); // Error: No calback expression +requireLazy([\\"A\\"]); // Error: No calback expression " `; diff --git a/tests/flow/return/__snapshots__/jsfmt.spec.js.snap b/tests/flow/return/__snapshots__/jsfmt.spec.js.snap index f27b1a2b8..e9aba62c7 100644 --- a/tests/flow/return/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/return/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test function_return.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`function_return.js 1`] = ` "class C { foo() { } bar() { return; } @@ -79,7 +81,7 @@ module.exports = C; " `; -exports[`test void.js 1`] = ` +exports[`void.js 1`] = ` "/* This is a regression test. At one point we incorrectly inferred the return type of functions that have an explicit \`undefined\` to be only \`undefined\` -- ignoring other possible exits. */ @@ -87,7 +89,7 @@ function f(b) { if (b) { return undefined; } else { - return \"nope\"; + return \\"nope\\"; } } @@ -100,7 +102,7 @@ function f(b) { if (b) { return undefined; } else { - return \"nope\"; + return \\"nope\\"; } } diff --git a/tests/flow/return_new/__snapshots__/jsfmt.spec.js.snap b/tests/flow/return_new/__snapshots__/jsfmt.spec.js.snap index 346984c9c..de09bf616 100644 --- a/tests/flow/return_new/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/return_new/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "function Foo() { return {}; } var foo: number = new Foo(); // error (returns object literal above) @@ -33,14 +35,14 @@ var a: A = new B(); // OK (returns new A) " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "declare class D { constructor(): { x: number }; // OK y: any; } var d = new D(); -d.x = \"\"; // error, string ~/~ number (but property x is found) +d.x = \\"\\"; // error, string ~/~ number (but property x is found) (new D: D); // error, new D is an object, D not in proto chain @@ -52,7 +54,7 @@ declare class D { } var d = new D(); -d.x = \"\"; // error, string ~/~ number (but property x is found) +d.x = \\"\\"; // error, string ~/~ number (but property x is found) (new D(): D); // error, new D is an object, D not in proto chain diff --git a/tests/flow/seal/__snapshots__/jsfmt.spec.js.snap b/tests/flow/seal/__snapshots__/jsfmt.spec.js.snap index 1d622455e..67d693186 100644 --- a/tests/flow/seal/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/seal/__snapshots__/jsfmt.spec.js.snap @@ -1,24 +1,26 @@ -exports[`test imp.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`imp.js 1`] = ` "/* @flow */ -var imp = require(\'./obj_annot\'); -imp({ name: \"imp\" }); +var imp = require('./obj_annot'); +imp({ name: \\"imp\\" }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var imp = require(\"./obj_annot\"); -imp({ name: \"imp\" }); +var imp = require(\\"./obj_annot\\"); +imp({ name: \\"imp\\" }); " `; -exports[`test obj_annot.js 1`] = ` +exports[`obj_annot.js 1`] = ` "/* @flow */ function foo(param: { name: string; }): number { return param.id; } -foo({ name: \"test\" }); +foo({ name: \\"test\\" }); module.exports = foo; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -28,7 +30,7 @@ function foo(param: { name: string }): number { return param.id; } -foo({ name: \"test\" }); +foo({ name: \\"test\\" }); module.exports = foo; " diff --git a/tests/flow/sealed/__snapshots__/jsfmt.spec.js.snap b/tests/flow/sealed/__snapshots__/jsfmt.spec.js.snap index 71b0ba74c..35e160759 100644 --- a/tests/flow/sealed/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/sealed/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test function.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`function.js 1`] = ` "/* @flow */ function Bar(x: number) { @@ -25,7 +27,7 @@ module.exports = Bar; " `; -exports[`test proto.js 1`] = ` +exports[`proto.js 1`] = ` "function Foo() { } var o = new Foo(); var x:number = o.x; @@ -33,7 +35,7 @@ var x:number = o.x; Foo.prototype.m = function() { return this.x; } var y:number = o.m(); -o.x = \"...\"; +o.x = \\"...\\"; Foo.prototype = { m: function() { return false; } } @@ -50,7 +52,7 @@ Foo.prototype.m = function() { }; var y: number = o.m(); -o.x = \"...\"; +o.x = \\"...\\"; Foo.prototype = { m: function() { @@ -64,28 +66,28 @@ module.exports = export_o; " `; -exports[`test sealed.js 1`] = ` -"var o = require(\'./proto\'); +exports[`sealed.js 1`] = ` +"var o = require('./proto'); o.z = 0; var x:string = o.x; -var Bar = require(\'./function\'); +var Bar = require('./function'); var a = new Bar(234); a.x = 123; -a.y = \'abc\'; // error, needs to be declared in Bar\'s constructor +a.y = 'abc'; // error, needs to be declared in Bar's constructor (a.getX(): number); (a.getY(): string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var o = require(\"./proto\"); +var o = require(\\"./proto\\"); o.z = 0; var x: string = o.x; -var Bar = require(\"./function\"); +var Bar = require(\\"./function\\"); var a = new Bar(234); a.x = 123; -a.y = \"abc\"; // error, needs to be declared in Bar\'s constructor +a.y = \\"abc\\"; // error, needs to be declared in Bar's constructor (a.getX(): number); (a.getY(): string); " diff --git a/tests/flow/sealed_objects/__snapshots__/jsfmt.spec.js.snap b/tests/flow/sealed_objects/__snapshots__/jsfmt.spec.js.snap index 581673c51..167bc1be8 100644 --- a/tests/flow/sealed_objects/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/sealed_objects/__snapshots__/jsfmt.spec.js.snap @@ -1,15 +1,17 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "var o1 = { x: 0 }; var s1: string = o1.y; // error var o2: { x: number; y?: string; } = { x: 0 }; -var s2: string = o2.y || \"\"; // ok +var s2: string = o2.y || \\"\\"; // ok var o3: { x: number; y?: string; } = ({ x: 0, y: 0 }: { x: number; }); -var s3: string = o3.y || \"\"; // error +var s3: string = o3.y || \\"\\"; // error var o4: { x: number; y?: string; } = ({ x: 0 }: { x: number; [_:any]:any}); -var s4: string = o4.y || \"\"; // ok +var s4: string = o4.y || \\"\\"; // ok var o5 = { x: 0, ...{} }; var s5: string = o5.y; // ok (spreads make object types extensible) @@ -23,13 +25,13 @@ var o1 = { x: 0 }; var s1: string = o1.y; // error var o2: { x: number, y?: string } = { x: 0 }; -var s2: string = o2.y || \"\"; // ok +var s2: string = o2.y || \\"\\"; // ok var o3: { x: number, y?: string } = ({ x: 0, y: 0 }: { x: number }); -var s3: string = o3.y || \"\"; // error +var s3: string = o3.y || \\"\\"; // error var o4: { x: number, y?: string } = ({ x: 0 }: { [_: any]: any, x: number }); -var s4: string = o4.y || \"\"; // ok +var s4: string = o4.y || \\"\\"; // ok var o5 = { x: 0, ...{} }; var s5: string = o5.y; // ok (spreads make object types extensible) diff --git a/tests/flow/shape/__snapshots__/jsfmt.spec.js.snap b/tests/flow/shape/__snapshots__/jsfmt.spec.js.snap index 7877cdffc..3931e96c1 100644 --- a/tests/flow/shape/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/shape/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "type Foo = { field: number, } diff --git a/tests/flow/simple_arrays/__snapshots__/jsfmt.spec.js.snap b/tests/flow/simple_arrays/__snapshots__/jsfmt.spec.js.snap index 7ba4207f0..8a7650872 100644 --- a/tests/flow/simple_arrays/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/simple_arrays/__snapshots__/jsfmt.spec.js.snap @@ -1,9 +1,11 @@ -exports[`test array.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`array.js 1`] = ` "/* @flow */ var a = []; for (var i = 0; i < 10; ++i) { if (i % 2 == 0) { a[i] = 0; } - else { a[i] = \'\'; }; + else { a[i] = ''; }; } // \`i\` never gets a lower bound, so the array access is stalled until the @@ -26,7 +28,7 @@ for (var i = 0; i < 10; ++i) { if (i % 2 == 0) { a[i] = 0; } else { - a[i] = \"\"; + a[i] = \\"\\"; } } @@ -52,12 +54,12 @@ function baz(i: number): string { " `; -exports[`test array2.js 1`] = ` +exports[`array2.js 1`] = ` "/* @flow */ var a = []; for (var i = 0; i < 10; ++i) { if (i % 2 == 0) { a[i] = 0; } - else { a[i] = \'\'; }; + else { a[i] = ''; }; } function foo(i: number): string { return a[i]; } @@ -68,7 +70,7 @@ for (var i = 0; i < 10; ++i) { if (i % 2 == 0) { a[i] = 0; } else { - a[i] = \"\"; + a[i] = \\"\\"; } } diff --git a/tests/flow/singleton/__snapshots__/jsfmt.spec.js.snap b/tests/flow/singleton/__snapshots__/jsfmt.spec.js.snap index 361859b9a..5e59ed37f 100644 --- a/tests/flow/singleton/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/singleton/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test boolean.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`boolean.js 1`] = ` "/* @flow */ function veryOptimistic(isThisAwesome: true): boolean { @@ -77,7 +79,7 @@ function alwaysFalsy(x: boolean): false { " `; -exports[`test number.js 1`] = ` +exports[`number.js 1`] = ` "/* @flow */ function highlander(howMany: 1): number { @@ -127,21 +129,21 @@ sort((x, y) => -1); " `; -exports[`test string.js 1`] = ` +exports[`string.js 1`] = ` "/* @flow */ -type NoSpaces = \"foobar\" -(\"foobar\": NoSpaces); +type NoSpaces = \\"foobar\\" +(\\"foobar\\": NoSpaces); -type HasSpaces = \"foo bar\" -(\"foo bar\": HasSpaces); +type HasSpaces = \\"foo bar\\" +(\\"foo bar\\": HasSpaces); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -type NoSpaces = \"foobar\"; -(\"foobar\": NoSpaces); +type NoSpaces = \\"foobar\\"; +(\\"foobar\\": NoSpaces); -type HasSpaces = \"foo bar\"; -(\"foo bar\": HasSpaces); +type HasSpaces = \\"foo bar\\"; +(\\"foo bar\\": HasSpaces); " `; diff --git a/tests/flow/spread/__snapshots__/jsfmt.spec.js.snap b/tests/flow/spread/__snapshots__/jsfmt.spec.js.snap index c3ad5a3e3..d71f81b74 100644 --- a/tests/flow/spread/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/spread/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "function parseTimestamp(timestamp: string): number { return 0; } @@ -23,7 +25,7 @@ function parseGroup(lines: Array): { } function parseTimeframe(line: string): { begin: number; end: number } { - var timestamps = line.split(\'-->\'); + var timestamps = line.split('-->'); return { begin: parseTimestamp(timestamps[0].trim()), end: parseTimestamp(timestamps[1].trim()) @@ -56,7 +58,7 @@ function parseGroup( } function parseTimeframe(line: string): { begin: number, end: number } { - var timestamps = line.split(\"-->\"); + var timestamps = line.split(\\"-->\\"); return { begin: parseTimestamp(timestamps[0].trim()), end: parseTimestamp(timestamps[1].trim()) @@ -65,7 +67,7 @@ function parseTimeframe(line: string): { begin: number, end: number } { " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "/** * @flow */ @@ -88,9 +90,9 @@ foo({ foo: 42 }); " `; -exports[`test test3.js 1`] = ` -"var p = { y: \"\" }; -var q = { z: \"\" }; +exports[`test3.js 1`] = ` +"var p = { y: \\"\\" }; +var q = { z: \\"\\" }; var o = { x: 5, ...p, @@ -107,8 +109,8 @@ var s = { }; var t: boolean = s.y; // error, string or number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var p = { y: \"\" }; -var q = { z: \"\" }; +var p = { y: \\"\\" }; +var q = { z: \\"\\" }; var o = { x: 5, ...p, @@ -127,7 +129,7 @@ var t: boolean = s.y; // error, string or number " `; -exports[`test test4.js 1`] = ` +exports[`test4.js 1`] = ` "/* @flow */ function test(...nums: Array) {} @@ -140,7 +142,7 @@ test(0, ...[1, 2, 3]); " `; -exports[`test test5.js 1`] = ` +exports[`test5.js 1`] = ` "/* @flow */ declare function map( @@ -195,22 +197,22 @@ function test( " `; -exports[`test test6.js 1`] = ` +exports[`test6.js 1`] = ` "var o = { - foo: \'bar\' + foo: 'bar' }; o = {...o}; (o: {foo: string}); var p = { - foo: \'bar\' + foo: 'bar' }; -(p: {foo: string; abc: string}); // error, p doesn\'t have \`abc\` yet -p = {...p, abc: \'def\'}; +(p: {foo: string; abc: string}); // error, p doesn't have \`abc\` yet +p = {...p, abc: 'def'}; (p: {foo: string; abc: string}); var q = { - foo: \'bar\' + foo: 'bar' }; for (var i = 0; i < 10; i++) { q = {...q}; @@ -218,20 +220,20 @@ for (var i = 0; i < 10; i++) { (q: {foo: string}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var o = { - foo: \"bar\" + foo: \\"bar\\" }; o = { ...o }; (o: { foo: string }); var p = { - foo: \"bar\" + foo: \\"bar\\" }; -(p: { foo: string, abc: string }); // error, p doesn\'t have \`abc\` yet -p = { ...p, abc: \"def\" }; +(p: { foo: string, abc: string }); // error, p doesn't have \`abc\` yet +p = { ...p, abc: \\"def\\" }; (p: { foo: string, abc: string }); var q = { - foo: \"bar\" + foo: \\"bar\\" }; for (var i = 0; i < 10; i++) { q = { ...q }; @@ -240,7 +242,7 @@ for (var i = 0; i < 10; i++) { " `; -exports[`test test7.js 1`] = ` +exports[`test7.js 1`] = ` "// @flow let tests = [ diff --git a/tests/flow/static_overload/__snapshots__/jsfmt.spec.js.snap b/tests/flow/static_overload/__snapshots__/jsfmt.spec.js.snap index c48e3d0bc..4c45c87f0 100644 --- a/tests/flow/static_overload/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/static_overload/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "var x: number = StaticOverload.foo(0); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var x: number = StaticOverload.foo(0); diff --git a/tests/flow/static_overload/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/static_overload/lib/__snapshots__/jsfmt.spec.js.snap index 1197e85c3..e35773db9 100644 --- a/tests/flow/static_overload/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/static_overload/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test lib.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`lib.js 1`] = ` "declare class StaticOverload { static foo(x: number): number; static foo(x: string): string; diff --git a/tests/flow/statics/__snapshots__/jsfmt.spec.js.snap b/tests/flow/statics/__snapshots__/jsfmt.spec.js.snap index b2e1eff3d..32ee59fab 100644 --- a/tests/flow/statics/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/statics/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test class_statics.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class_statics.js 1`] = ` "class C { static f(x:number) { } static x:string; @@ -24,7 +26,7 @@ C.x = 0; " `; -exports[`test funstatics.js 1`] = ` +exports[`funstatics.js 1`] = ` "function C() { } C.prototype.f = function() { return C.g(0); } C.g = function(x) { return x; }; diff --git a/tests/flow/strict/__snapshots__/jsfmt.spec.js.snap b/tests/flow/strict/__snapshots__/jsfmt.spec.js.snap index 4f3e6ecc0..5467e378c 100644 --- a/tests/flow/strict/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/strict/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,7 @@ -exports[`test annot.js 1`] = ` -"var A = require(\'./unknown_class\'); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`annot.js 1`] = ` +"var A = require('./unknown_class'); class B extends A { foo(x:A):A { return x; } @@ -9,7 +11,7 @@ class B extends A { module.exports = B; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var A = require(\"./unknown_class\"); +var A = require(\\"./unknown_class\\"); class B extends A { foo(x: A): A { @@ -25,7 +27,7 @@ module.exports = B; " `; -exports[`test fun.js 1`] = ` +exports[`fun.js 1`] = ` "/** * @flow */ @@ -58,7 +60,7 @@ module.exports = f; " `; -exports[`test obj.js 1`] = ` +exports[`obj.js 1`] = ` "/** * @flow */ diff --git a/tests/flow/strict_requires/__snapshots__/jsfmt.spec.js.snap b/tests/flow/strict_requires/__snapshots__/jsfmt.spec.js.snap index 46809f4b0..26b6e55c8 100644 --- a/tests/flow/strict_requires/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/strict_requires/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/* @flow */ module.exports = 0; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -7,41 +9,41 @@ module.exports = 0; " `; -exports[`test B.js 1`] = ` +exports[`B.js 1`] = ` "/* @flow */ -module.exports = { foo: \"\" } +module.exports = { foo: \\"\\" } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -module.exports = { foo: \"\" }; +module.exports = { foo: \\"\\" }; " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` "/* @flow */ var o = { - A: require(\'./A\'), - ...require(\'./B\'), + A: require('./A'), + ...require('./B'), }; module.exports = o; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ var o = { - A: require(\"./A\"), - ...require(\"./B\") + A: require(\\"./A\\"), + ...require(\\"./B\\") }; module.exports = o; " `; -exports[`test D.js 1`] = ` +exports[`D.js 1`] = ` "/* @flow */ -var C = require(\'./C\'); +var C = require('./C'); var x: number = C.foo; var y: string = C.A; C.A = false; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var C = require(\"./C\"); +var C = require(\\"./C\\"); var x: number = C.foo; var y: string = C.A; C.A = false; diff --git a/tests/flow/structural_subtyping/__snapshots__/jsfmt.spec.js.snap b/tests/flow/structural_subtyping/__snapshots__/jsfmt.spec.js.snap index db93deb32..5a351643d 100644 --- a/tests/flow/structural_subtyping/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/structural_subtyping/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test builtin.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`builtin.js 1`] = ` "/** * @flow */ @@ -8,9 +10,9 @@ interface IHasLength { } var lengthTest1: IHasLength = []; -var lengthTest2: IHasLength = \'hello\'; -var lengthTest3: IHasLength = 123; // number doesn\'t have length -var lengthTest4: IHasLength = true; // bool doesn\'t have length +var lengthTest2: IHasLength = 'hello'; +var lengthTest3: IHasLength = 123; // number doesn't have length +var lengthTest4: IHasLength = true; // bool doesn't have length ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow @@ -21,13 +23,13 @@ interface IHasLength { } var lengthTest1: IHasLength = []; -var lengthTest2: IHasLength = \"hello\"; -var lengthTest3: IHasLength = 123; // number doesn\'t have length -var lengthTest4: IHasLength = true; // bool doesn\'t have length +var lengthTest2: IHasLength = \\"hello\\"; +var lengthTest3: IHasLength = 123; // number doesn't have length +var lengthTest4: IHasLength = true; // bool doesn't have length " `; -exports[`test class.js 1`] = ` +exports[`class.js 1`] = ` "/** * @flow */ @@ -78,7 +80,7 @@ var testInstance3: IHasYString = new ClassWithXString(); // Error missing prop " `; -exports[`test obj.js 1`] = ` +exports[`obj.js 1`] = ` "/** * @flow */ @@ -87,7 +89,7 @@ interface IHasXString { x: string; } -var propTest1: IHasXString = { x: \'hello\' }; +var propTest1: IHasXString = { x: 'hello' }; var propTest2: IHasXString = { x: 123 }; // Error string != number var propTest3: IHasXString = {}; // Property not found var propTest4: IHasXString = ({}: Object); @@ -108,7 +110,7 @@ interface IHasXString { x: string } -var propTest1: IHasXString = { x: \"hello\" }; +var propTest1: IHasXString = { x: \\"hello\\" }; var propTest2: IHasXString = { x: 123 }; // Error string != number var propTest3: IHasXString = {}; // Property not found var propTest4: IHasXString = ({}: Object); @@ -123,7 +125,7 @@ function propTest6(y: { [key: string]: number }) { " `; -exports[`test optional.js 1`] = ` +exports[`optional.js 1`] = ` "/* @flow */ interface HasOptional { @@ -131,11 +133,11 @@ interface HasOptional { b?: number, }; -var test1: HasOptional = { a: \"hello\" } +var test1: HasOptional = { a: \\"hello\\" } var test2: HasOptional = {}; // Error: missing property a -var test3: HasOptional = { a: \"hello\", b: true }; // Error: boolean ~> number +var test3: HasOptional = { a: \\"hello\\", b: true }; // Error: boolean ~> number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -144,10 +146,10 @@ interface HasOptional { b?: number } -var test1: HasOptional = { a: \"hello\" }; +var test1: HasOptional = { a: \\"hello\\" }; var test2: HasOptional = {}; // Error: missing property a -var test3: HasOptional = { a: \"hello\", b: true }; // Error: boolean ~> number +var test3: HasOptional = { a: \\"hello\\", b: true }; // Error: boolean ~> number " `; diff --git a/tests/flow/suggest/__snapshots__/jsfmt.spec.js.snap b/tests/flow/suggest/__snapshots__/jsfmt.spec.js.snap index 25eb1902f..dae74cf93 100644 --- a/tests/flow/suggest/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/suggest/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test lib.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`lib.js 1`] = ` "/* @flow */ function bar(w: number): number { return w; } @@ -15,27 +17,27 @@ module.exports = bar; " `; -exports[`test suggest.js 1`] = ` +exports[`suggest.js 1`] = ` "/* @flow */ -var bar = require(\'./lib\'); +var bar = require('./lib'); function foo(z: number) { return bar(z); } -var array = [\"foo\", \"bar\"]; +var array = [\\"foo\\", \\"bar\\"]; array; module.exports = {foo:foo}; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -var bar = require(\"./lib\"); +var bar = require(\\"./lib\\"); function foo(z: number) { return bar(z); } -var array = [\"foo\", \"bar\"]; +var array = [\\"foo\\", \\"bar\\"]; array; module.exports = { foo: foo }; diff --git a/tests/flow/super/__snapshots__/jsfmt.spec.js.snap b/tests/flow/super/__snapshots__/jsfmt.spec.js.snap index 6fc139652..fb64d97a5 100644 --- a/tests/flow/super/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/super/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test constructor.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`constructor.js 1`] = ` "class A { x: number; } class B { @@ -105,7 +107,7 @@ class K extends K_ { } } -// even though super() calls the parent\'s constructor(), it does not do the same +// even though super() calls the parent's constructor(), it does not do the same // conversion on non-objects. so \`new L_()\` returns an instance of \`L_\` because // the constructor returns false (a non-object), but \`super()\` returns false, // which then similarly causes \`new L()\` to return an instance of \`L\`. @@ -123,11 +125,11 @@ class L extends L_ { (new L_(): L_); (new L(): L); -// similarly, the converse is true: if the parent\'s constructor returns an +// similarly, the converse is true: if the parent's constructor returns an // object, then the child does too. class M_ { constructor() { - return {foo: \'foo\'}; + return {foo: 'foo'}; } } class M extends M_ { @@ -262,7 +264,7 @@ class K extends K_ { } } -// even though super() calls the parent\'s constructor(), it does not do the same +// even though super() calls the parent's constructor(), it does not do the same // conversion on non-objects. so \`new L_()\` returns an instance of \`L_\` because // the constructor returns false (a non-object), but \`super()\` returns false, // which then similarly causes \`new L()\` to return an instance of \`L\`. @@ -280,11 +282,11 @@ class L extends L_ { (new L_(): L_); (new L(): L); -// similarly, the converse is true: if the parent\'s constructor returns an +// similarly, the converse is true: if the parent's constructor returns an // object, then the child does too. class M_ { constructor() { - return { foo: \"foo\" }; + return { foo: \\"foo\\" }; } } class M extends M_ { @@ -313,7 +315,7 @@ class N extends N_ { " `; -exports[`test import.js 1`] = ` +exports[`import.js 1`] = ` "class D { foo(): number { return 0; } } @@ -328,7 +330,7 @@ module.exports = D; " `; -exports[`test super.js 1`] = ` +exports[`super.js 1`] = ` " class A { constructor(x:number) { } @@ -342,8 +344,8 @@ class B extends A { } static anotherStatic() { - (super.staticMethod(\'foo\'): number); // error, string !~> number - (super.doesntExist()); // error, A doesn\'t have a doesntExist method + (super.staticMethod('foo'): number); // error, string !~> number + (super.doesntExist()); // error, A doesn't have a doesntExist method } g() { @@ -366,8 +368,8 @@ class B extends A { } static anotherStatic() { - (super.staticMethod(\"foo\"): number); // error, string !~> number - super.doesntExist(); // error, A doesn\'t have a doesntExist method + (super.staticMethod(\\"foo\\"): number); // error, string !~> number + super.doesntExist(); // error, A doesn't have a doesntExist method } g() { @@ -378,15 +380,15 @@ class B extends A { " `; -exports[`test test.js 1`] = ` -"var D = require(\'./import\'); +exports[`test.js 1`] = ` +"var D = require('./import'); class C extends D { constructor() { return super(); } foo() { return super.foo(); } } module.exports = C; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var D = require(\"./import\"); +var D = require(\\"./import\\"); class C extends D { constructor() { return super(); diff --git a/tests/flow/suppress/__snapshots__/jsfmt.spec.js.snap b/tests/flow/suppress/__snapshots__/jsfmt.spec.js.snap index d2c07dbcd..62a5e1825 100644 --- a/tests/flow/suppress/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/suppress/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "// $FlowFixMe var test1: string = 123; // This error should be suppressed @@ -16,7 +18,7 @@ var test3: string = getNum(); // This error should be suppressed var test4: string = 123; // This error is NOT suppressed - // $FlowFixMe Indentation shouldn\'t matter + // $FlowFixMe Indentation shouldn't matter var test5: string = 123; // This error should be suppressed /* @@ -41,7 +43,7 @@ var test3: string = getNum(); // This error should be suppressed var test4: string = 123; // This error is NOT suppressed -// $FlowFixMe Indentation shouldn\'t matter +// $FlowFixMe Indentation shouldn't matter var test5: string = 123; // This error should be suppressed /* @@ -51,7 +53,7 @@ var test6: string = 123; " `; -exports[`test B.js 1`] = ` +exports[`B.js 1`] = ` "// $FlowFixMe var test1: string = library_num; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -60,7 +62,7 @@ var test1: string = library_num; " `; -exports[`test C.js 1`] = ` +exports[`C.js 1`] = ` "function takesAString(x: string): void {} function runTest(y: number): void { @@ -81,7 +83,7 @@ function runTest(y: number): void { " `; -exports[`test lib.js 1`] = ` +exports[`lib.js 1`] = ` "declare var library_num: number; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare var library_num: number; diff --git a/tests/flow/suppress_incremental/__snapshots__/jsfmt.spec.js.snap b/tests/flow/suppress_incremental/__snapshots__/jsfmt.spec.js.snap index 788d90b2e..a1f78c9b3 100644 --- a/tests/flow/suppress_incremental/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/suppress_incremental/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "// @flow (123: number); // no errors diff --git a/tests/flow/suppress_traces/__snapshots__/jsfmt.spec.js.snap b/tests/flow/suppress_traces/__snapshots__/jsfmt.spec.js.snap index 9420c419c..2c91ea6bc 100644 --- a/tests/flow/suppress_traces/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/suppress_traces/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test traces.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`traces.js 1`] = ` "/* * The location marked with the FlowFixMe does not show up in the original * error but shows up in the flow check --traces 10 result. This test makes - * sure that we don\'t suppress the error due to a location that only shows up + * sure that we don't suppress the error due to a location that only shows up * when --traces is turned on. */ @@ -13,12 +15,12 @@ function foo(x: string) { return bar(); } -var a: string = foo(\'hi\'); // error number ~> string +var a: string = foo('hi'); // error number ~> string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* * The location marked with the FlowFixMe does not show up in the original * error but shows up in the flow check --traces 10 result. This test makes - * sure that we don\'t suppress the error due to a location that only shows up + * sure that we don't suppress the error due to a location that only shows up * when --traces is turned on. */ @@ -31,6 +33,6 @@ function foo(x: string) { return bar(); } -var a: string = foo(\"hi\"); // error number ~> string +var a: string = foo(\\"hi\\"); // error number ~> string " `; diff --git a/tests/flow/switch/__snapshots__/jsfmt.spec.js.snap b/tests/flow/switch/__snapshots__/jsfmt.spec.js.snap index 90498ca49..23d0e5c99 100644 --- a/tests/flow/switch/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/switch/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test more_switch.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`more_switch.js 1`] = ` "/* @flow */ function foo(x): number { switch (x) { case 0: case 1: return 1; - default: throw new Error(\'hi\'); + default: throw new Error('hi'); } } @@ -21,7 +23,7 @@ function baz(x): number { switch (x) { case 0: break; case 1: return 1; - default: throw new Error(\'hi\'); + default: throw new Error('hi'); } return 2; } @@ -34,7 +36,7 @@ function foo(x): number { case 1: return 1; default: - throw new Error(\"hi\"); + throw new Error(\\"hi\\"); } } @@ -55,29 +57,29 @@ function baz(x): number { case 1: return 1; default: - throw new Error(\"hi\"); + throw new Error(\\"hi\\"); } return 2; } " `; -exports[`test switch.js 1`] = ` +exports[`switch.js 1`] = ` "/** * @flow */ function foo( ): number { - switch (\'foo\') { - case \'foo\': + switch ('foo') { + case 'foo': return 1; } return 2; } function bar() { - switch (\'bar\') { - case \'bar\': + switch ('bar') { + case 'bar': break; default: break; @@ -85,11 +87,11 @@ function bar() { } function qux(b) { - var x = b? 0: \"\"; - switch(\'qux\') { - case \'\': + var x = b? 0: \\"\\"; + switch('qux') { + case '': x = 0; - case \'qux\': + case 'qux': x = x*x; } } @@ -98,16 +100,16 @@ function qux(b) { * @flow */ function foo(): number { - switch (\"foo\") { - case \"foo\": + switch (\\"foo\\") { + case \\"foo\\": return 1; } return 2; } function bar() { - switch (\"bar\") { - case \"bar\": + switch (\\"bar\\") { + case \\"bar\\": break; default: break; @@ -115,27 +117,27 @@ function bar() { } function qux(b) { - var x = b ? 0 : \"\"; - switch (\"qux\") { - case \"\": + var x = b ? 0 : \\"\\"; + switch (\\"qux\\") { + case \\"\\": x = 0; - case \"qux\": + case \\"qux\\": x = x * x; } } " `; -exports[`test switch_default_fallthrough.js 1`] = ` +exports[`switch_default_fallthrough.js 1`] = ` "/** * @flow */ function foo(x : mixed): string { - var a = \"\"; - var b = \"\"; + var a = \\"\\"; + var b = \\"\\"; switch (x) { - case \"foo\": + case \\"foo\\": a = 0; default: b = 0; @@ -151,15 +153,15 @@ function foo(x : mixed): string { } function baz(x: mixed): number { - var a = \"\"; - var b = \"\"; + var a = \\"\\"; + var b = \\"\\"; switch (x) { - case \"baz\": + case \\"baz\\": a = 0; break; - case \"bar\": - a = \"\"; + case \\"bar\\": + a = \\"\\"; default: b = 0; } @@ -179,11 +181,11 @@ function baz(x: mixed): number { * @flow */ function foo(x: mixed): string { - var a = \"\"; - var b = \"\"; + var a = \\"\\"; + var b = \\"\\"; switch (x) { - case \"foo\": + case \\"foo\\": a = 0; default: b = 0; @@ -199,15 +201,15 @@ function foo(x: mixed): string { } function baz(x: mixed): number { - var a = \"\"; - var b = \"\"; + var a = \\"\\"; + var b = \\"\\"; switch (x) { - case \"baz\": + case \\"baz\\": a = 0; break; - case \"bar\": - a = \"\"; + case \\"bar\\": + a = \\"\\"; default: b = 0; } @@ -225,7 +227,7 @@ function baz(x: mixed): number { " `; -exports[`test trailing_cases.js 1`] = ` +exports[`trailing_cases.js 1`] = ` "/** * trailing cases are allowed - spot checks that we handle them as usual * @flow @@ -244,7 +246,7 @@ function f1(i) { x = -1; break; case 2: - x = \"2\"; + x = \\"2\\"; break; } @@ -285,7 +287,7 @@ function f3(i) { function foo(x): number { switch (x) { case 0: - default: throw new Error(\'hi\'); + default: throw new Error('hi'); case 1: return 1; } } @@ -301,7 +303,7 @@ function bar(x) { function baz(x): number { switch (x) { case 0: break; - default: throw new Error(\'hi\'); + default: throw new Error('hi'); case 1: return 1; } return 2; @@ -325,7 +327,7 @@ function f1(i) { x = -1; break; case 2: - x = \"2\"; + x = \\"2\\"; break; } @@ -367,7 +369,7 @@ function foo(x): number { switch (x) { case 0: default: - throw new Error(\"hi\"); + throw new Error(\\"hi\\"); case 1: return 1; } @@ -388,7 +390,7 @@ function baz(x): number { case 0: break; default: - throw new Error(\"hi\"); + throw new Error(\\"hi\\"); case 1: return 1; } diff --git a/tests/flow/symbol/__snapshots__/jsfmt.spec.js.snap b/tests/flow/symbol/__snapshots__/jsfmt.spec.js.snap index 04dd7ffe5..f5c0c0683 100644 --- a/tests/flow/symbol/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/symbol/__snapshots__/jsfmt.spec.js.snap @@ -1,14 +1,16 @@ -exports[`test symbol.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`symbol.js 1`] = ` "var FOO = Symbol(); -var BAR = Symbol(\'bar\'); +var BAR = Symbol('bar'); // TODO: Expected error -var WAT = Symbol(\'foo\', \'bar\'); +var WAT = Symbol('foo', 'bar'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var FOO = Symbol(); -var BAR = Symbol(\"bar\"); +var BAR = Symbol(\\"bar\\"); // TODO: Expected error -var WAT = Symbol(\"foo\", \"bar\"); +var WAT = Symbol(\\"foo\\", \\"bar\\"); " `; diff --git a/tests/flow/symlink/__snapshots__/jsfmt.spec.js.snap b/tests/flow/symlink/__snapshots__/jsfmt.spec.js.snap index 36cbc18c3..d1f261a36 100644 --- a/tests/flow/symlink/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/symlink/__snapshots__/jsfmt.spec.js.snap @@ -1,22 +1,24 @@ -exports[`test bar.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bar.js 1`] = ` "export type Foo = { x: number; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export type Foo = { x: number }; " `; -exports[`test foo.js 1`] = ` +exports[`foo.js 1`] = ` "export type Foo = { x: number; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export type Foo = { x: number }; " `; -exports[`test qux.js 1`] = ` -"import type { Foo } from \'./bar.js\'; -({ x: \"\" }: Foo); +exports[`qux.js 1`] = ` +"import type { Foo } from './bar.js'; +({ x: \\"\\" }: Foo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import type { Foo } from \"./bar.js\"; -({ x: \"\" }: Foo); +import type { Foo } from \\"./bar.js\\"; +({ x: \\"\\" }: Foo); " `; diff --git a/tests/flow/tagged-unions/__snapshots__/jsfmt.spec.js.snap b/tests/flow/tagged-unions/__snapshots__/jsfmt.spec.js.snap index c963928af..d83426a02 100644 --- a/tests/flow/tagged-unions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/tagged-unions/__snapshots__/jsfmt.spec.js.snap @@ -1,25 +1,27 @@ -exports[`test classes.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`classes.js 1`] = ` "// @flow class Foo { - type: \'foo\'; + type: 'foo'; foo: string; } class Bar { - type: \'bar\'; + type: 'bar'; bar: string; } type Foobar = Foo | Bar; function foobar(x: Foobar): string { - if (x.type === \'foo\') { + if (x.type === 'foo') { return foo(x); - } else if (x.type === \'bar\') { + } else if (x.type === 'bar') { return bar(x); } else { - return \'unknown\'; + return 'unknown'; } } @@ -34,24 +36,24 @@ function bar(x: Bar): string { // @flow class Foo { - type: \"foo\"; + type: \\"foo\\"; foo: string; } class Bar { - type: \"bar\"; + type: \\"bar\\"; bar: string; } type Foobar = Foo | Bar; function foobar(x: Foobar): string { - if (x.type === \"foo\") { + if (x.type === \\"foo\\") { return foo(x); - } else if (x.type === \"bar\") { + } else if (x.type === \\"bar\\") { return bar(x); } else { - return \"unknown\"; + return \\"unknown\\"; } } @@ -65,7 +67,7 @@ function bar(x: Bar): string { " `; -exports[`test interfaces-neg.js 1`] = ` +exports[`interfaces-neg.js 1`] = ` "/* @flow */ declare interface IDataBase { @@ -74,22 +76,22 @@ declare interface IDataBase { } declare interface IUserData extends IDataBase { - kind: \"user\", + kind: \\"user\\", } declare interface ISystemData extends IDataBase { - kind: \"system\", + kind: \\"system\\", } declare type IData = IUserData | ISystemData; const data: IData = { - id: \"\", - name: \"\", - kind: \"system\", + id: \\"\\", + name: \\"\\", + kind: \\"system\\", } -if (data.kind === \"user\") { +if (data.kind === \\"user\\") { (data: ISystemData); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -101,28 +103,28 @@ declare interface IDataBase { } declare interface IUserData extends IDataBase { - kind: \"user\" + kind: \\"user\\" } declare interface ISystemData extends IDataBase { - kind: \"system\" + kind: \\"system\\" } declare type IData = IUserData | ISystemData; const data: IData = { - id: \"\", - name: \"\", - kind: \"system\" + id: \\"\\", + name: \\"\\", + kind: \\"system\\" }; -if (data.kind === \"user\") { +if (data.kind === \\"user\\") { (data: ISystemData); } " `; -exports[`test interfaces-pos.js 1`] = ` +exports[`interfaces-pos.js 1`] = ` "/* @flow */ declare interface IDataBase { @@ -131,22 +133,22 @@ declare interface IDataBase { } declare interface IUserData extends IDataBase { - kind: \"user\", + kind: \\"user\\", } declare interface ISystemData extends IDataBase { - kind: \"system\", + kind: \\"system\\", } declare type IData = IUserData | ISystemData; const data: IData = { - id: \"\", - name: \"\", - kind: \"system\", + id: \\"\\", + name: \\"\\", + kind: \\"system\\", } -if (data.kind === \"system\") { +if (data.kind === \\"system\\") { (data: ISystemData); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -158,28 +160,28 @@ declare interface IDataBase { } declare interface IUserData extends IDataBase { - kind: \"user\" + kind: \\"user\\" } declare interface ISystemData extends IDataBase { - kind: \"system\" + kind: \\"system\\" } declare type IData = IUserData | ISystemData; const data: IData = { - id: \"\", - name: \"\", - kind: \"system\" + id: \\"\\", + name: \\"\\", + kind: \\"system\\" }; -if (data.kind === \"system\") { +if (data.kind === \\"system\\") { (data: ISystemData); } " `; -exports[`test type-decls-neg.js 1`] = ` +exports[`type-decls-neg.js 1`] = ` "/* @flow */ type DataBase = { @@ -190,24 +192,24 @@ type DataBase = { type UserData = { id: string, name: string, - kind: \"user\", + kind: \\"user\\", } type SystemData = { id: string, name: string, - kind: \"system\", + kind: \\"system\\", } declare type Data = UserData | SystemData; const data: Data = { - id: \"\", - name: \"\", - kind: \"system\", + id: \\"\\", + name: \\"\\", + kind: \\"system\\", } -if (data.kind === \"user\") { +if (data.kind === \\"user\\") { (data: SystemData); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -221,30 +223,30 @@ type DataBase = { type UserData = { id: string, name: string, - kind: \"user\" + kind: \\"user\\" }; type SystemData = { id: string, name: string, - kind: \"system\" + kind: \\"system\\" }; declare type Data = UserData | SystemData; const data: Data = { - id: \"\", - name: \"\", - kind: \"system\" + id: \\"\\", + name: \\"\\", + kind: \\"system\\" }; -if (data.kind === \"user\") { +if (data.kind === \\"user\\") { (data: SystemData); } " `; -exports[`test type-decls-pos.js 1`] = ` +exports[`type-decls-pos.js 1`] = ` "/* @flow */ type DataBase = { @@ -255,24 +257,24 @@ type DataBase = { type UserData = { id: string, name: string, - kind: \"user\", + kind: \\"user\\", } type SystemData = { id: string, name: string, - kind: \"system\", + kind: \\"system\\", } declare type Data = UserData | SystemData; const data: Data = { - id: \"\", - name: \"\", - kind: \"system\", + id: \\"\\", + name: \\"\\", + kind: \\"system\\", } -if (data.kind === \"system\") { +if (data.kind === \\"system\\") { (data: SystemData); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -286,24 +288,24 @@ type DataBase = { type UserData = { id: string, name: string, - kind: \"user\" + kind: \\"user\\" }; type SystemData = { id: string, name: string, - kind: \"system\" + kind: \\"system\\" }; declare type Data = UserData | SystemData; const data: Data = { - id: \"\", - name: \"\", - kind: \"system\" + id: \\"\\", + name: \\"\\", + kind: \\"system\\" }; -if (data.kind === \"system\") { +if (data.kind === \\"system\\") { (data: SystemData); } " diff --git a/tests/flow/taint/__snapshots__/jsfmt.spec.js.snap b/tests/flow/taint/__snapshots__/jsfmt.spec.js.snap index 7d339fc95..8dd7bb748 100644 --- a/tests/flow/taint/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/taint/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test adder.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`adder.js 1`] = ` "// @flow function f(x : $Tainted, y : $Tainted) { @@ -65,7 +67,7 @@ function f7(x: $Tainted, y: $Tainted) { " `; -exports[`test any_object.js 1`] = ` +exports[`any_object.js 1`] = ` "// @flow let tests = [ @@ -78,7 +80,7 @@ let tests = [ // getting a property function() { - let obj: Object = { foo: \'foo\' }; + let obj: Object = { foo: 'foo' }; (obj.foo: $Tainted); // ok }, @@ -104,7 +106,7 @@ let tests = [ // getting a property function() { - let obj: Object = { foo: \"foo\" }; + let obj: Object = { foo: \\"foo\\" }; (obj.foo: $Tainted); // ok }, @@ -120,7 +122,7 @@ let tests = [ " `; -exports[`test call-object-property.js 1`] = ` +exports[`call-object-property.js 1`] = ` "// @flow function foo(x : $Tainted, o : Object) { @@ -175,7 +177,7 @@ function f_foo3(f1: Function, o1: Object, o2: { t: $Tainted }) { " `; -exports[`test comparator.js 1`] = ` +exports[`comparator.js 1`] = ` "// @flow // Should cause an error. function f(x : $Tainted, y : $Tainted) { @@ -216,7 +218,7 @@ function f3(x: $Tainted, y: string) { " `; -exports[`test function.js 1`] = ` +exports[`function.js 1`] = ` "// @flow let tests = [ @@ -249,7 +251,7 @@ let tests = [ " `; -exports[`test globals.js 1`] = ` +exports[`globals.js 1`] = ` "// @flow class A { @@ -278,7 +280,7 @@ class A { " `; -exports[`test lib.js 1`] = ` +exports[`lib.js 1`] = ` "declare class FakeLocation { assign(url: string): void; } @@ -307,14 +309,14 @@ declare var fakeLocation: FakeLocation; " `; -exports[`test taint1.js 1`] = ` +exports[`taint1.js 1`] = ` "/* * * @flow */ class A { f(tainted : $Tainted) { - // This shouldn\'t give a warning (both are tainted) + // This shouldn't give a warning (both are tainted) var also_tainted : $Tainted = tainted; } } @@ -325,14 +327,14 @@ class A { */ class A { f(tainted: $Tainted) { - // This shouldn\'t give a warning (both are tainted) + // This shouldn't give a warning (both are tainted) var also_tainted: $Tainted = tainted; } } " `; -exports[`test taint2.js 1`] = ` +exports[`taint2.js 1`] = ` "/* * * @flow @@ -357,7 +359,7 @@ class A { " `; -exports[`test taint3.js 1`] = ` +exports[`taint3.js 1`] = ` "/* * * @flow @@ -386,13 +388,13 @@ class A { " `; -exports[`test taint4.js 1`] = ` +exports[`taint4.js 1`] = ` "/* * * @flow */ -var safe : string = \"safe\"; +var safe : string = \\"safe\\"; // This should be allowed. var tainted : $Tainted = safe @@ -406,7 +408,7 @@ function f(x : $Tainted) { * @flow */ -var safe: string = \"safe\"; +var safe: string = \\"safe\\"; // This should be allowed. var tainted: $Tainted = safe; @@ -417,7 +419,7 @@ function f(x: $Tainted) { " `; -exports[`test use-types.js 1`] = ` +exports[`use-types.js 1`] = ` "/* * @flow */ diff --git a/tests/flow/template/__snapshots__/jsfmt.spec.js.snap b/tests/flow/template/__snapshots__/jsfmt.spec.js.snap index 31d8699b2..e5055b8c3 100644 --- a/tests/flow/template/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/template/__snapshots__/jsfmt.spec.js.snap @@ -1,65 +1,67 @@ -exports[`test template.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`template.js 1`] = ` "/* @flow */ (\`foo\`: string); // ok -(\`bar\`: \'bar\'); // ok +(\`bar\`: 'bar'); // ok (\`baz\`: number); // error \`foo \${123} bar\`; // ok, number can be appended to string -\`foo \${{bar: 123}} baz\`; // error, object can\'t be appended +\`foo \${{bar: 123}} baz\`; // error, object can't be appended let tests = [ function(x: string) { \`foo \${x}\`; // ok \`\${x} bar\`; // ok - \`foo \${\'bar\'} \${x}\`; // ok + \`foo \${'bar'} \${x}\`; // ok }, function(x: number) { \`foo \${x}\`; // ok \`\${x} bar\`; // ok - \`foo \${\'bar\'} \${x}\`; // ok + \`foo \${'bar'} \${x}\`; // ok }, function(x: boolean) { \`foo \${x}\`; // error \`\${x} bar\`; // error - \`foo \${\'bar\'} \${x}\`; // error + \`foo \${'bar'} \${x}\`; // error }, function(x: mixed) { \`foo \${x}\`; // error \`\${x} bar\`; // error - \`foo \${\'bar\'} \${x}\`; // error + \`foo \${'bar'} \${x}\`; // error }, ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ (\`foo\`: string); // ok -(\`bar\`: \"bar\"); // ok +(\`bar\`: \\"bar\\"); // ok (\`baz\`: number); // error \`foo \${123} bar\`; // ok, number can be appended to string -\`foo \${{ bar: 123 }} baz\`; // error, object can\'t be appended +\`foo \${{ bar: 123 }} baz\`; // error, object can't be appended let tests = [ function(x: string) { \`foo \${x}\`; // ok \`\${x} bar\`; // ok - \`foo \${\"bar\"} \${x}\`; // ok + \`foo \${\\"bar\\"} \${x}\`; // ok }, function(x: number) { \`foo \${x}\`; // ok \`\${x} bar\`; // ok - \`foo \${\"bar\"} \${x}\`; // ok + \`foo \${\\"bar\\"} \${x}\`; // ok }, function(x: boolean) { \`foo \${x}\`; // error \`\${x} bar\`; // error - \`foo \${\"bar\"} \${x}\`; // error + \`foo \${\\"bar\\"} \${x}\`; // error }, function(x: mixed) { \`foo \${x}\`; // error \`\${x} bar\`; // error - \`foo \${\"bar\"} \${x}\`; // error + \`foo \${\\"bar\\"} \${x}\`; // error } ]; " diff --git a/tests/flow/this/__snapshots__/jsfmt.spec.js.snap b/tests/flow/this/__snapshots__/jsfmt.spec.js.snap index 8f3b419cc..f7a61987b 100644 --- a/tests/flow/this/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/this/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test This.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`This.js 1`] = ` "/* @providesModule This */ function F() { this.x = 0; } @@ -7,17 +9,17 @@ F.prototype.m = function() { this.y = 0; } function foo(p:string) { } var o1 = new F(); // sets o1.x to 0 -o1.x = \"\"; +o1.x = \\"\\"; foo(o1.x); // ok by definite assignment var o2 = new F(); o1.y = 0; -o2.y = \"\"; +o2.y = \\"\\"; foo(o2.y); // setting o1.y to 0 has no effect on o2.y var o3 = new F(); o3.m(); // sets o3.y to 0 -o3.y = \"\"; +o3.y = \\"\\"; foo(o3.y); // ok by definite assignment foo(o2.y); // setting o3.y to 0 has no effect on o2.y @@ -32,7 +34,7 @@ function f1() : number { var f1_1 = f1.bind({x: 0})(); // ok var f1_2 : string = f1.bind({x: 0})(); // error, number -> string -var f1_3 = f1.bind({x: \"\"})(); // error, string -> number +var f1_3 = f1.bind({x: \\"\\"})(); // error, string -> number // TODO make this error blame the call site, rather than the function body var f1_4 = f1(); // error, (global object).x @@ -52,7 +54,7 @@ function f2() : number { var f2_1 = f2.bind({x: 0})(); // ok var f2_2 : string = f2.bind({x: 0})(); // error, number -> string -var f2_3 = f2.bind({x: \"\"})(); // error, string -> number +var f2_3 = f2.bind({x: \\"\\"})(); // error, string -> number // TODO make this error blame the call site, rather than the function body var f2_4 = f2(); // error, (global object).x @@ -72,17 +74,17 @@ F.prototype.m = function() { function foo(p: string) {} var o1 = new F(); // sets o1.x to 0 -o1.x = \"\"; +o1.x = \\"\\"; foo(o1.x); // ok by definite assignment var o2 = new F(); o1.y = 0; -o2.y = \"\"; +o2.y = \\"\\"; foo(o2.y); // setting o1.y to 0 has no effect on o2.y var o3 = new F(); o3.m(); // sets o3.y to 0 -o3.y = \"\"; +o3.y = \\"\\"; foo(o3.y); // ok by definite assignment foo(o2.y); // setting o3.y to 0 has no effect on o2.y @@ -97,7 +99,7 @@ function f1(): number { var f1_1 = f1.bind({ x: 0 })(); // ok var f1_2: string = f1.bind({ x: 0 })(); // error, number -> string -var f1_3 = f1.bind({ x: \"\" })(); // error, string -> number +var f1_3 = f1.bind({ x: \\"\\" })(); // error, string -> number // TODO make this error blame the call site, rather than the function body var f1_4 = f1(); // error, (global object).x @@ -119,7 +121,7 @@ function f2(): number { var f2_1 = f2.bind({ x: 0 })(); // ok var f2_2: string = f2.bind({ x: 0 })(); // error, number -> string -var f2_3 = f2.bind({ x: \"\" })(); // error, string -> number +var f2_3 = f2.bind({ x: \\"\\" })(); // error, string -> number // TODO make this error blame the call site, rather than the function body var f2_4 = f2(); // error, (global object).x @@ -129,7 +131,7 @@ module.exports = true; " `; -exports[`test arrows.js 1`] = ` +exports[`arrows.js 1`] = ` "class C { foo() { return () => { return this.bar(); }; // OK, since this: C @@ -153,7 +155,7 @@ class E { class F extends E { foo() { // OK to override with generalization (() => { - super.foo(\"\"); // find super method, error due to incorrect arg + super.foo(\\"\\"); // find super method, error due to incorrect arg })(); } } @@ -186,7 +188,7 @@ class F extends E { foo() { // OK to override with generalization (() => { - super.foo(\"\"); // find super method, error due to incorrect arg + super.foo(\\"\\"); // find super method, error due to incorrect arg })(); } } diff --git a/tests/flow/this_ctor/__snapshots__/jsfmt.spec.js.snap b/tests/flow/this_ctor/__snapshots__/jsfmt.spec.js.snap index 835ed4db7..5b8bde356 100644 --- a/tests/flow/this_ctor/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/this_ctor/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "class A { n: number; constructor(n: number) { diff --git a/tests/flow/this_type/__snapshots__/jsfmt.spec.js.snap b/tests/flow/this_type/__snapshots__/jsfmt.spec.js.snap index 7b07c4faf..aa3f60edf 100644 --- a/tests/flow/this_type/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/this_type/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test class_expr.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class_expr.js 1`] = ` "/* @flow */ // issue #1191 @@ -19,7 +21,7 @@ const Thing = class Thing { " `; -exports[`test contra.js 1`] = ` +exports[`contra.js 1`] = ` "// Counterexample with contravariant this type class C { @@ -34,7 +36,7 @@ var d = new D(); (d.next: D); // sneaky class A { - foo(that: X) { } // error: can\'t hide contravariance using a bound + foo(that: X) { } // error: can't hide contravariance using a bound } class B extends A { @@ -89,7 +91,7 @@ var d = new D(); (d.next: D); // sneaky class A { - foo(that: X) {} // error: can\'t hide contravariance using a bound + foo(that: X) {} // error: can't hide contravariance using a bound } class B extends A { @@ -140,7 +142,7 @@ class Misc { " `; -exports[`test export.js 1`] = ` +exports[`export.js 1`] = ` "export class A1 { foo(): this { return this; } bar(): this { return this; } @@ -179,7 +181,7 @@ export class A3 extends A2 {} " `; -exports[`test generics.js 1`] = ` +exports[`generics.js 1`] = ` "class Generic { clone(): Generic { return this; } } @@ -207,12 +209,12 @@ class ImplicitNumber extends Implicit { " `; -exports[`test import.js 1`] = ` +exports[`import.js 1`] = ` "// Check that imports are handled properly with this types -import { A1 } from \'./export\'; -import type { A2 } from \'./export\'; -import { A3 } from \'./export\'; +import { A1 } from './export'; +import type { A2 } from './export'; +import { A3 } from './export'; class B1 extends A1 { foo(): B1 { return new B1(); } // error @@ -233,9 +235,9 @@ class B3 extends A3 { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Check that imports are handled properly with this types -import { A1 } from \"./export\"; -import type { A2 } from \"./export\"; -import { A3 } from \"./export\"; +import { A1 } from \\"./export\\"; +import type { A2 } from \\"./export\\"; +import { A3 } from \\"./export\\"; class B1 extends A1 { foo(): B1 { @@ -260,7 +262,7 @@ class B3 extends A3 { " `; -exports[`test interface.js 1`] = ` +exports[`interface.js 1`] = ` "interface I { xs: Array; } interface J { f(): J; } class C { @@ -287,37 +289,37 @@ function bar(c: C): J { " `; -exports[`test lib_client.js 1`] = ` +exports[`lib_client.js 1`] = ` "(new DoublyLinkedList().prev(): DoublyLinkedList); (new DoublyLinkedList().next(): DoublyLinkedList) -var MiniImmutable = require(\"mini-immutable\"); +var MiniImmutable = require(\\"mini-immutable\\"); class C { map: MiniImmutable.OrderedMap; update() { - this.map = this.map.set(0,\"\"); + this.map = this.map.set(0,\\"\\"); } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (new DoublyLinkedList().prev(): DoublyLinkedList); (new DoublyLinkedList().next(): DoublyLinkedList); -var MiniImmutable = require(\"mini-immutable\"); +var MiniImmutable = require(\\"mini-immutable\\"); class C { map: MiniImmutable.OrderedMap; update() { - this.map = this.map.set(0, \"\"); + this.map = this.map.set(0, \\"\\"); } } " `; -exports[`test self.js 1`] = ` +exports[`self.js 1`] = ` "class A { foo() { return this; } // return of foo is not annotated to get around // substituting this below bar(): this { return new A().foo(); } // same as returning : A, so error - qux(): this { return this.bar(); } // OK (don\'t cascade errors) + qux(): this { return this.bar(); } // OK (don't cascade errors) } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class A { @@ -330,12 +332,12 @@ class A { } // same as returning : A, so error qux(): this { return this.bar(); - } // OK (don\'t cascade errors) + } // OK (don't cascade errors) } " `; -exports[`test statics.js 1`] = ` +exports[`statics.js 1`] = ` "// supporting \`this\` type in statics class A { @@ -375,7 +377,7 @@ class B extends A {} // inherits statics method too, with \`this\` bound to the " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "// Examples without \`this\` types (compare with examples below) class Base { diff --git a/tests/flow/this_type/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/this_type/lib/__snapshots__/jsfmt.spec.js.snap index 8dc8bb152..a83e60d9d 100644 --- a/tests/flow/this_type/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/this_type/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test decl.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`decl.js 1`] = ` "// The following declare classes use \`this\` types effectively to avoid type // errors in ../lib_client.js. If support for \`this\` types in declare classes // is disabled for perf reasons, these will produce warnings. @@ -10,7 +12,7 @@ declare class DoublyLinkedList extends LinkedList { prev(): this; } -declare module \"mini-immutable\" { +declare module \\"mini-immutable\\" { declare class Map { set(key: K, value: V): this; // more precise than Map (see below) } @@ -30,7 +32,7 @@ declare class DoublyLinkedList extends LinkedList { prev(): this } -declare module \"mini-immutable\" { +declare module \\"mini-immutable\\" { declare class Map { set(key: K, value: V): this /* more precise than Map (see below)*/ } diff --git a/tests/flow/throw/__snapshots__/jsfmt.spec.js.snap b/tests/flow/throw/__snapshots__/jsfmt.spec.js.snap index fdf0c9438..04dc73905 100644 --- a/tests/flow/throw/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/throw/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "/** * @flow */ @@ -16,7 +18,7 @@ function g(a: ?string) { function h(x: number): string { if (x) { - return \'foo\'; + return 'foo'; } else { throw new Error(); } @@ -39,7 +41,7 @@ function g(a: ?string) { function h(x: number): string { if (x) { - return \"foo\"; + return \\"foo\\"; } else { throw new Error(); } diff --git a/tests/flow/traces/__snapshots__/jsfmt.spec.js.snap b/tests/flow/traces/__snapshots__/jsfmt.spec.js.snap index 6729365f8..c0561d937 100644 --- a/tests/flow/traces/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/traces/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test Traces.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Traces.js 1`] = ` "// arg/param type mismatch on arg 0 function g0(y:string) { } function f0(x) { g0(x) } @@ -7,7 +9,7 @@ f0(0); // ...on arg n function g1(a:string, b:string) { } function f1(x, y) { g1(x, y) } -f1(\"hey\", 0); +f1(\\"hey\\", 0); // h/o call with function expr function g2(ylam: (s:string) => number) { } @@ -32,7 +34,7 @@ function g1(a: string, b: string) {} function f1(x, y) { g1(x, y); } -f1(\"hey\", 0); +f1(\\"hey\\", 0); // h/o call with function expr function g2(ylam: (s: string) => number) {} @@ -55,10 +57,10 @@ f3(double); " `; -exports[`test Traces2.js 1`] = ` +exports[`Traces2.js 1`] = ` "// @flow -var React = require(\'react\'); +var React = require('react'); var A = React.createClass({ propTypes: { foo: React.PropTypes.string.isRequired } @@ -70,15 +72,15 @@ var B = React.createClass({ function f(b): React.Element<*> { if (b) { - return ; + return ; } else { - return ; + return ; } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var React = require(\"react\"); +var React = require(\\"react\\"); var A = React.createClass({ propTypes: { foo: React.PropTypes.string.isRequired } @@ -90,9 +92,9 @@ var B = React.createClass({ function f(b): React.Element<*> { if (b) { - return ; + return ; } else { - return ; + return ; } } " diff --git a/tests/flow/traits/__snapshots__/jsfmt.spec.js.snap b/tests/flow/traits/__snapshots__/jsfmt.spec.js.snap index 8d8953318..2dffc4d52 100644 --- a/tests/flow/traits/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/traits/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "declare class Foo extends Qux mixins Bar { // KeyedCollection <: Collection // ...KeyedIterable @@ -44,7 +46,7 @@ declare class Baz { " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "declare interface I { } declare class C mixins I { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/flow/try/__snapshots__/jsfmt.spec.js.snap b/tests/flow/try/__snapshots__/jsfmt.spec.js.snap index 6ab2f3e38..9dcf14caa 100644 --- a/tests/flow/try/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/try/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test abnormals.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`abnormals.js 1`] = ` "/* @flow */ /* This test documents an issue we used to have with merging the environment of @@ -33,7 +35,7 @@ function foo() { " `; -exports[`test init.js 1`] = ` +exports[`init.js 1`] = ` "/*** * test initialization tracking of hoisted stuff * @flow @@ -91,7 +93,7 @@ function f() { } } -// or try/catch/finally if init doesn\'t dominate +// or try/catch/finally if init doesn't dominate function f() { try { var x:number = 0; @@ -246,7 +248,7 @@ function f() { } } -// or try/catch/finally if init doesn\'t dominate +// or try/catch/finally if init doesn't dominate function f() { try { var x: number = 0; @@ -346,7 +348,7 @@ function f(b) { " `; -exports[`test return.js 1`] = ` +exports[`return.js 1`] = ` "/** * @flow */ @@ -354,36 +356,36 @@ exports[`test return.js 1`] = ` function foo(x: ?number): string { try { } catch (e) { - return \'bar\'; + return 'bar'; } console.log(); - return \'foo\'; + return 'foo'; } function bar(): string { try { - return \'foo\'; + return 'foo'; } catch (e) { - return \'bar\'; + return 'bar'; } } function baz(): string { try { - throw new Error(\"foo\"); + throw new Error(\\"foo\\"); } catch (e) { - return \"foo\"; + return \\"foo\\"; } - return \"bar\"; // unreachable + return \\"bar\\"; // unreachable } function qux(): string { try { - throw new Error(\"foo\"); + throw new Error(\\"foo\\"); } catch (e) { } console.log(); - return \'bar\'; + return 'bar'; } function quux(): string { @@ -391,24 +393,24 @@ function quux(): string { return qux(); } catch (e) { } - return \'bar\'; + return 'bar'; } function bliffl(): string { try { - throw new Error(\"foo\"); + throw new Error(\\"foo\\"); } catch (e) { - return \"foo\"; + return \\"foo\\"; } finally { - return \"bar\"; + return \\"bar\\"; } } function corge(): string { try { - return \'foo\'; + return 'foo'; } catch (e) { - throw new Error(\'bar\'); + throw new Error('bar'); } bar(); // unreachable } @@ -420,36 +422,36 @@ function corge(): string { function foo(x: ?number): string { try { } catch (e) { - return \"bar\"; + return \\"bar\\"; } console.log(); - return \"foo\"; + return \\"foo\\"; } function bar(): string { try { - return \"foo\"; + return \\"foo\\"; } catch (e) { - return \"bar\"; + return \\"bar\\"; } } function baz(): string { try { - throw new Error(\"foo\"); + throw new Error(\\"foo\\"); } catch (e) { - return \"foo\"; + return \\"foo\\"; } - return \"bar\"; // unreachable + return \\"bar\\"; // unreachable } function qux(): string { try { - throw new Error(\"foo\"); + throw new Error(\\"foo\\"); } catch (e) { } console.log(); - return \"bar\"; + return \\"bar\\"; } function quux(): string { @@ -457,31 +459,31 @@ function quux(): string { return qux(); } catch (e) { } - return \"bar\"; + return \\"bar\\"; } function bliffl(): string { try { - throw new Error(\"foo\"); + throw new Error(\\"foo\\"); } catch (e) { - return \"foo\"; + return \\"foo\\"; } finally { - return \"bar\"; + return \\"bar\\"; } } function corge(): string { try { - return \"foo\"; + return \\"foo\\"; } catch (e) { - throw new Error(\"bar\"); + throw new Error(\\"bar\\"); } bar(); // unreachable } " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "/*** * test env state tracking thru try/catch/finally * @flow @@ -491,7 +493,7 @@ function foo() { var x = 0; var y; try { - x = \"\"; + x = \\"\\"; } catch(e) { x = false; throw -1; @@ -508,7 +510,7 @@ function bar(response) { try { payload = JSON.parse(response); } catch (e) { - throw new Error(\'...\'); + throw new Error('...'); } // here via [try] only. if (payload.error) { // ok @@ -534,7 +536,7 @@ function foo() { var x = 0; var y; try { - x = \"\"; + x = \\"\\"; } catch (e) { x = false; throw -1; @@ -551,7 +553,7 @@ function bar(response) { try { payload = JSON.parse(response); } catch (e) { - throw new Error(\"...\"); + throw new Error(\\"...\\"); } // here via [try] only. if (payload.error) { diff --git a/tests/flow/tuples/__snapshots__/jsfmt.spec.js.snap b/tests/flow/tuples/__snapshots__/jsfmt.spec.js.snap index 512c37c49..ad8242a2a 100644 --- a/tests/flow/tuples/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/tuples/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test array.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`array.js 1`] = ` "// @flow function foo(x: Array): [number, ?number] { - return x; // Error, can\'t enforce arity when flowing array to tuple + return x; // Error, can't enforce arity when flowing array to tuple } function foo(x: Array): [number, ?number] { @@ -12,7 +14,7 @@ function foo(x: Array): [number, ?number] { // @flow function foo(x: Array): [number, ?number] { - return x; // Error, can\'t enforce arity when flowing array to tuple + return x; // Error, can't enforce arity when flowing array to tuple } function foo(x: Array): [number, ?number] { @@ -21,7 +23,7 @@ function foo(x: Array): [number, ?number] { " `; -exports[`test optional.js 1`] = ` +exports[`optional.js 1`] = ` "// @flow ([0, undefined]: [number, ?string]); // Ok, correct arity @@ -38,7 +40,7 @@ exports[`test optional.js 1`] = ` " `; -exports[`test too-few.js 1`] = ` +exports[`too-few.js 1`] = ` "/* @flow */ function foo(a: [Object, Object]) {} @@ -53,19 +55,19 @@ foo([{}]); // error, too few elements in array passed to a tuple " `; -exports[`test tuples.js 1`] = ` +exports[`tuples.js 1`] = ` "var a: [] = []; var b: [] = [123]; // Error - arity mismatch var c: [number] = []; // nope -var d: [number, string] = [123,\'duck\']; -var e: [number, string,] = [123,\'duck\']; +var d: [number, string] = [123,'duck']; +var e: [number, string,] = [123,'duck']; var f: [number, string] = [123, 456]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var a: [] = []; var b: [] = [123]; // Error - arity mismatch var c: [number] = []; // nope -var d: [number, string] = [123, \"duck\"]; -var e: [number, string] = [123, \"duck\"]; +var d: [number, string] = [123, \\"duck\\"]; +var e: [number, string] = [123, \\"duck\\"]; var f: [number, string] = [123, 456]; " `; diff --git a/tests/flow/type-at-pos/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type-at-pos/__snapshots__/jsfmt.spec.js.snap index 67f64998a..40e5891a1 100644 --- a/tests/flow/type-at-pos/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type-at-pos/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test destructuring.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`destructuring.js 1`] = ` "// @flow let [x, y] = [1, 2]; @@ -41,10 +43,10 @@ export const X = { " `; -exports[`test function_expressions.js 1`] = ` +exports[`function_expressions.js 1`] = ` "// @flow -// TODO: type-at-pos between the ()\'s should be () => void +// TODO: type-at-pos between the ()'s should be () => void // class X { // foo(): void {} // } @@ -55,7 +57,7 @@ const y = { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -// TODO: type-at-pos between the ()\'s should be () => void +// TODO: type-at-pos between the ()'s should be () => void // class X { // foo(): void {} // } @@ -66,7 +68,7 @@ const y = { " `; -exports[`test generics.js 1`] = ` +exports[`generics.js 1`] = ` "// @flow class C { } @@ -125,7 +127,7 @@ mn; " `; -exports[`test import.js 1`] = ` +exports[`import.js 1`] = ` "// @flow var num = 42; function bar() { } @@ -140,13 +142,13 @@ module.exports = num; " `; -exports[`test object_special_cases.js 1`] = ` +exports[`object_special_cases.js 1`] = ` "/* @flow */ let tests = [ function() { let x = {}; - Object.defineProperty(x, \'foo\', { value: \'\' }); + Object.defineProperty(x, 'foo', { value: '' }); }, ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -155,13 +157,13 @@ let tests = [ let tests = [ function() { let x = {}; - Object.defineProperty(x, \"foo\", { value: \"\" }); + Object.defineProperty(x, \\"foo\\", { value: \\"\\" }); } ]; " `; -exports[`test optional.js 1`] = ` +exports[`optional.js 1`] = ` "// @flow function foo(x?: string) { @@ -196,7 +198,7 @@ function qux(x?) { " `; -exports[`test predicates.js 1`] = ` +exports[`predicates.js 1`] = ` "/* @flow */ let x = 0; @@ -216,16 +218,16 @@ if (Array.isArray(x)) { " `; -exports[`test react.js 1`] = ` -"import React from \"react\"; +exports[`react.js 1`] = ` +"import React from \\"react\\"; React.createElement; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import React from \"react\"; +import React from \\"react\\"; React.createElement; " `; -exports[`test templates.js 1`] = ` +exports[`templates.js 1`] = ` "/* @flow */ \`foo bar\`; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -234,32 +236,32 @@ exports[`test templates.js 1`] = ` " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "// @flow -var str = require(\'./import\'); +var str = require('./import'); function foo() { } foo(); str type Point = [number, string]; -const x:Point = [1, \"foo\"]; -type MyStr = \"cool\"; -const y:MyStr = \"cool\"; +const x:Point = [1, \\"foo\\"]; +type MyStr = \\"cool\\"; +const y:MyStr = \\"cool\\"; type MyBool = true; const z:MyBool = true; type MyNum = 42; const w:MyNum = 42; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -var str = require(\"./import\"); +var str = require(\\"./import\\"); function foo() {} foo(); str; type Point = [number, string]; -const x: Point = [1, \"foo\"]; -type MyStr = \"cool\"; -const y: MyStr = \"cool\"; +const x: Point = [1, \\"foo\\"]; +type MyStr = \\"cool\\"; +const y: MyStr = \\"cool\\"; type MyBool = true; const z: MyBool = true; type MyNum = 42; @@ -267,17 +269,17 @@ const w: MyNum = 42; " `; -exports[`test trycatch.js 1`] = ` +exports[`trycatch.js 1`] = ` "// @flow try { - throw \"foo\"; + throw \\"foo\\"; } catch (e) {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow try { - throw \"foo\"; + throw \\"foo\\"; } catch (e) { } " diff --git a/tests/flow/type-destructors/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type-destructors/__snapshots__/jsfmt.spec.js.snap index ddbf4f683..d4b77c71c 100644 --- a/tests/flow/type-destructors/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type-destructors/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test non_maybe_type.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`non_maybe_type.js 1`] = ` "// @flow function foo(x: ?string): $NonMaybeType { @@ -29,15 +31,15 @@ function foo(x: ?string): $NonMaybeType { " `; -exports[`test property_type.js 1`] = ` +exports[`property_type.js 1`] = ` "type Malformed = $PropertyType; type Obj = { x: string }; -type Obj_Prop_x = $PropertyType; +type Obj_Prop_x = $PropertyType; (42: Obj_Prop_x); -function foo(o: Obj): $PropertyType { +function foo(o: Obj): $PropertyType { if (false) return o.x; else return 0; } @@ -45,26 +47,26 @@ function foo(o: Obj): $PropertyType { type Malformed = $PropertyType; type Obj = { x: string }; -type Obj_Prop_x = $PropertyType; +type Obj_Prop_x = $PropertyType; (42: Obj_Prop_x); -function foo(o: Obj): $PropertyType { +function foo(o: Obj): $PropertyType { if (false) return o.x; else return 0; } " `; -exports[`test union.js 1`] = ` +exports[`union.js 1`] = ` "var x0: $NonMaybeType = 0; // ok, number ~> number|string var x1: $NonMaybeType = true; // err, boolean ~> number|string -var x2: $PropertyType<{p:number}|{p:string},\'p\'> = 0; // ok, number ~> number|string -var x3: $PropertyType<{p:number}|{p:string},\'p\'> = true; // err, boolean ~> number|string +var x2: $PropertyType<{p:number}|{p:string},'p'> = 0; // ok, number ~> number|string +var x3: $PropertyType<{p:number}|{p:string},'p'> = true; // err, boolean ~> number|string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var x0: $NonMaybeType = 0; // ok, number ~> number|string var x1: $NonMaybeType = true; // err, boolean ~> number|string -var x2: $PropertyType<{ p: number } | { p: string }, \"p\"> = 0; // ok, number ~> number|string -var x3: $PropertyType<{ p: number } | { p: string }, \"p\"> = true; // err, boolean ~> number|string +var x2: $PropertyType<{ p: number } | { p: string }, \\"p\\"> = 0; // ok, number ~> number|string +var x3: $PropertyType<{ p: number } | { p: string }, \\"p\\"> = true; // err, boolean ~> number|string " `; diff --git a/tests/flow/type-printer/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type-printer/__snapshots__/jsfmt.spec.js.snap index 923c288b7..235c4fd71 100644 --- a/tests/flow/type-printer/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type-printer/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,7 @@ -exports[`test printBinaryExpression.js 1`] = ` -"\'use babel\'; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`printBinaryExpression.js 1`] = ` +"'use babel'; /* @flow */ /* @@ -10,7 +12,7 @@ exports[`test printBinaryExpression.js 1`] = ` * the root directory of this source tree. */ -import type {BinaryExpression} from \'./types\'; +import type {BinaryExpression} from './types'; function printBinaryExpression( node: BinaryExpression, @@ -20,7 +22,7 @@ function printBinaryExpression( module.exports = printBinaryExpression; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -\"use babel\"; +\\"use babel\\"; /* @flow */ /* @@ -31,7 +33,7 @@ module.exports = printBinaryExpression; * the root directory of this source tree. */ -import type { BinaryExpression } from \"./types\"; +import type { BinaryExpression } from \\"./types\\"; function printBinaryExpression(node: BinaryExpression) { console.log(node); @@ -41,12 +43,12 @@ module.exports = printBinaryExpression; " `; -exports[`test types.js 1`] = ` +exports[`types.js 1`] = ` "/** * @flow */ -\'use strict\'; +'use strict'; /* * Flow types for the Babylon AST. @@ -55,7 +57,7 @@ exports[`test types.js 1`] = ` // Abstract types. Something must extend these. export type Comment = { - type: \'CommentLine\'; + type: 'CommentLine'; _CommentLine: void; value: string; end: number; @@ -65,7 +67,7 @@ export type Comment = { }; start: number; } | { - type: \'CommentBlock\'; + type: 'CommentBlock'; _CommentBlock: void; value: string; end: number; @@ -77,7 +79,7 @@ export type Comment = { }; export type Declaration = { - type: \'ClassBody\'; + type: 'ClassBody'; _ClassBody: void; body: Array; end: number; @@ -90,7 +92,7 @@ export type Declaration = { start: number; trailingComments: ?Array; } | { - type: \'ClassDeclaration\'; + type: 'ClassDeclaration'; _ClassDeclaration: void; body: ClassBody; id: ?Identifier; @@ -108,7 +110,7 @@ export type Declaration = { start: number; trailingComments: ?Array; } | { - type: \'FunctionDeclaration\'; + type: 'FunctionDeclaration'; _FunctionDeclaration: void; body: BlockStatement; id: Identifier; @@ -130,11 +132,11 @@ export type Declaration = { returnType: ?TypeAnnotation; typeParameters: ?TypeParameterDeclaration; } | { - type: \'MethodDefinition\'; + type: 'MethodDefinition'; _MethodDefinition: void; computed: boolean; key: Node; - kind: \'constructor\' | \'method\' | \'get\' | \'set\'; + kind: 'constructor' | 'method' | 'get' | 'set'; static: boolean; value: FunctionExpression; decorators: ?Array; @@ -148,10 +150,10 @@ export type Declaration = { start: number; trailingComments: ?Array; } | { - type: \'VariableDeclaration\'; + type: 'VariableDeclaration'; _VariableDeclaration: void; declarations: Array; - kind: \'var\' | \'let\' | \'const\'; + kind: 'var' | 'let' | 'const'; end: number; innerComments: ?Array; leadingComments: ?Array; @@ -162,7 +164,7 @@ export type Declaration = { start: number; trailingComments: ?Array; } | { - type: \'ClassProperty\'; + type: 'ClassProperty'; _ClassProperty: void; computed: boolean; key: Node; @@ -182,7 +184,7 @@ export type Declaration = { }; export type Expression = { - type: \'ArrayExpression\'; + type: 'ArrayExpression'; _ArrayExpression: void; elements: Array; end: number; @@ -195,7 +197,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'AssignmentExpression\'; + type: 'AssignmentExpression'; _AssignmentExpression: void; left: Pattern; operator: AssignmentOperator; @@ -210,7 +212,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'AwaitExpression\'; + type: 'AwaitExpression'; _AwaitExpression: void; all: boolean; argument: ?Expression; @@ -224,7 +226,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'BinaryExpression\'; + type: 'BinaryExpression'; _BinaryExpression: void; left: Expression; operator: BinaryOperator; @@ -239,7 +241,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'BindExpression\'; + type: 'BindExpression'; _BindExpression: void; callee: Node; object: Node; @@ -253,7 +255,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'CallExpression\'; + type: 'CallExpression'; _CallExpression: void; arguments: Array; callee: Expression; @@ -267,7 +269,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'ClassExpression\'; + type: 'ClassExpression'; _ClassExpression: void; body: ClassBody; id: ?Identifier; @@ -285,7 +287,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'ComprehensionExpression\'; + type: 'ComprehensionExpression'; _ComprehensionExpression: void; body: Expression; blocks: Array; @@ -300,7 +302,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'ConditionalExpression\'; + type: 'ConditionalExpression'; _ConditionalExpression: void; alternate: Expression; consequent: Expression; @@ -315,7 +317,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'DoExpression\'; + type: 'DoExpression'; _DoExpression: void; body: Statement; end: number; @@ -328,7 +330,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'FunctionExpression\'; + type: 'FunctionExpression'; _FunctionExpression: void; body: BlockStatement; id: ?Identifier; @@ -350,7 +352,7 @@ export type Expression = { returnType: ?TypeAnnotation; typeParameters: ?TypeParameterDeclaration; } | { - type: \'Identifier\'; + type: 'Identifier'; _Identifier: void; name: string; typeAnnotation: ?TypeAnnotation; @@ -364,7 +366,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'Literal\'; + type: 'Literal'; _Literal: void; raw: string; regex: ?{pattern: string, flags: string}; @@ -379,7 +381,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'LogicalExpression\'; + type: 'LogicalExpression'; _LogicalExpression: void; left: Expression; operator: LogicalOperator; @@ -394,7 +396,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'MemberExpression\'; + type: 'MemberExpression'; _MemberExpression: void; computed: boolean; object: Expression; @@ -409,7 +411,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'NewExpression\'; + type: 'NewExpression'; _NewExpression: void; arguments: Array; callee: Expression; @@ -423,7 +425,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'ObjectExpression\'; + type: 'ObjectExpression'; _ObjectExpression: void; properties: Array; end: number; @@ -436,7 +438,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'SequenceExpression\'; + type: 'SequenceExpression'; _SequenceExpression: void; expression: Array; end: number; @@ -449,7 +451,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'TaggedTemplateExpression\'; + type: 'TaggedTemplateExpression'; _TaggedTemplateExpression: void; quasi: TemplateLiteral; tag: Expression; @@ -463,7 +465,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'TemplateLiteral\'; + type: 'TemplateLiteral'; _TemplateLiteral: void; expressions: Array; quasis: Array; @@ -477,7 +479,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'ThisExpression\'; + type: 'ThisExpression'; _ThisExpression: void; end: number; innerComments: ?Array; @@ -489,7 +491,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'UnaryExpression\'; + type: 'UnaryExpression'; _UnaryExpression: void; argument: Expression; operator: UnaryOperator; @@ -504,7 +506,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'UpdateExpression\'; + type: 'UpdateExpression'; _UpdateExpression: void; argument: Expression; operator: UpdateOperator; @@ -519,7 +521,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'YieldExpression\'; + type: 'YieldExpression'; _YieldExpression: void; argument: ?Expression; delegate: boolean; @@ -533,7 +535,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'TypeCastExpression\'; + type: 'TypeCastExpression'; _TypeCastExpression: void; expression: Expression; typeAnnotation: TypeAnnotation; @@ -547,7 +549,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'JSXElement\'; + type: 'JSXElement'; _JSXElement: void; children: Array; closingElement: ?JSXClosingElement; @@ -562,7 +564,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'JSXEmptyExpression\'; + type: 'JSXEmptyExpression'; _JSXEmptyExpression: void; end: number; innerComments: ?Array; @@ -574,7 +576,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'JSXExpressionContainer\'; + type: 'JSXExpressionContainer'; _JSXExpressionContainer: void; expression: Expression; end: number; @@ -587,7 +589,7 @@ export type Expression = { start: number; trailingComments: ?Array; } | { - type: \'JSXMemberExpression\'; + type: 'JSXMemberExpression'; _JSXMemberExpression: void; computed: boolean; object: Node; @@ -604,7 +606,7 @@ export type Expression = { }; export type Function = { - type: \'ArrowFunctionExpression\'; + type: 'ArrowFunctionExpression'; _ArrowFunctionExpression: void; body: Node; id: ?Identifier; @@ -626,7 +628,7 @@ export type Function = { returnType: ?TypeAnnotation; typeParameters: ?TypeParameterDeclaration; } | { - type: \'FunctionDeclaration\'; + type: 'FunctionDeclaration'; _FunctionDeclaration: void; body: BlockStatement; id: Identifier; @@ -648,7 +650,7 @@ export type Function = { returnType: ?TypeAnnotation; typeParameters: ?TypeParameterDeclaration; } | { - type: \'FunctionExpression\'; + type: 'FunctionExpression'; _FunctionExpression: void; body: BlockStatement; id: ?Identifier; @@ -672,7 +674,7 @@ export type Function = { }; export type Node = { - type: \'ArrayExpression\'; + type: 'ArrayExpression'; _ArrayExpression: void; elements: Array; end: number; @@ -685,7 +687,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ArrayPattern\'; + type: 'ArrayPattern'; _ArrayPattern: void; elements: Array; typeAnnotation: ?TypeAnnotation; @@ -699,7 +701,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ArrowFunctionExpression\'; + type: 'ArrowFunctionExpression'; _ArrowFunctionExpression: void; body: Node; id: ?Identifier; @@ -721,7 +723,7 @@ export type Node = { returnType: ?TypeAnnotation; typeParameters: ?TypeParameterDeclaration; } | { - type: \'AssignmentExpression\'; + type: 'AssignmentExpression'; _AssignmentExpression: void; left: Pattern; operator: AssignmentOperator; @@ -736,7 +738,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'AssignmentPattern\'; + type: 'AssignmentPattern'; _AssignmentPattern: void; left: Pattern; right: Expression; @@ -750,7 +752,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'AwaitExpression\'; + type: 'AwaitExpression'; _AwaitExpression: void; all: boolean; argument: ?Expression; @@ -764,7 +766,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'BinaryExpression\'; + type: 'BinaryExpression'; _BinaryExpression: void; left: Expression; operator: BinaryOperator; @@ -779,7 +781,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'BindExpression\'; + type: 'BindExpression'; _BindExpression: void; callee: Node; object: Node; @@ -793,7 +795,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'BlockStatement\'; + type: 'BlockStatement'; _BlockStatement: void; body: Array; end: number; @@ -806,7 +808,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'BreakStatement\'; + type: 'BreakStatement'; _BreakStatement: void; label: ?Identifier; end: number; @@ -819,7 +821,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'CallExpression\'; + type: 'CallExpression'; _CallExpression: void; arguments: Array; callee: Expression; @@ -833,7 +835,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'CatchClause\'; + type: 'CatchClause'; _CatchClause: void; body: BlockStatement; param: Pattern; @@ -847,7 +849,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ClassBody\'; + type: 'ClassBody'; _ClassBody: void; body: Array; end: number; @@ -860,7 +862,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ClassDeclaration\'; + type: 'ClassDeclaration'; _ClassDeclaration: void; body: ClassBody; id: ?Identifier; @@ -878,7 +880,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ClassExpression\'; + type: 'ClassExpression'; _ClassExpression: void; body: ClassBody; id: ?Identifier; @@ -896,7 +898,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ComprehensionBlock\'; + type: 'ComprehensionBlock'; _ComprehensionBlock: void; each: boolean; left: Pattern; @@ -911,7 +913,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ComprehensionExpression\'; + type: 'ComprehensionExpression'; _ComprehensionExpression: void; body: Expression; blocks: Array; @@ -926,7 +928,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ConditionalExpression\'; + type: 'ConditionalExpression'; _ConditionalExpression: void; alternate: Expression; consequent: Expression; @@ -941,7 +943,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ContinueStatement\'; + type: 'ContinueStatement'; _ContinueStatement: void; label: ?Identifier; end: number; @@ -954,7 +956,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'Decorator\'; + type: 'Decorator'; _Decorator: void; expression: Expression; end: number; @@ -967,7 +969,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'DebuggerStatement\'; + type: 'DebuggerStatement'; _DebuggerStatement: void; end: number; innerComments: ?Array; @@ -979,7 +981,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'DoWhileStatement\'; + type: 'DoWhileStatement'; _DoWhileStatement: void; body: Statement; test: Expression; @@ -993,7 +995,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'DoExpression\'; + type: 'DoExpression'; _DoExpression: void; body: Statement; end: number; @@ -1006,7 +1008,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'EmptyStatement\'; + type: 'EmptyStatement'; _EmptyStatement: void; end: number; innerComments: ?Array; @@ -1018,7 +1020,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ExpressionStatement\'; + type: 'ExpressionStatement'; _ExpressionStatement: void; expression: Expression; end: number; @@ -1031,7 +1033,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'File\'; + type: 'File'; _File: void; program: Program; end: number; @@ -1044,7 +1046,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ForInStatement\'; + type: 'ForInStatement'; _ForInStatement: void; body: Statement; left: Node; @@ -1059,7 +1061,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ForOfStatement\'; + type: 'ForOfStatement'; _ForOfStatement: void; body: Statement; left: Node; @@ -1074,7 +1076,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ForStatement\'; + type: 'ForStatement'; _ForStatement: void; init: ?Node; test: ?Expression; @@ -1090,7 +1092,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'FunctionDeclaration\'; + type: 'FunctionDeclaration'; _FunctionDeclaration: void; body: BlockStatement; id: Identifier; @@ -1112,7 +1114,7 @@ export type Node = { returnType: ?TypeAnnotation; typeParameters: ?TypeParameterDeclaration; } | { - type: \'FunctionExpression\'; + type: 'FunctionExpression'; _FunctionExpression: void; body: BlockStatement; id: ?Identifier; @@ -1134,7 +1136,7 @@ export type Node = { returnType: ?TypeAnnotation; typeParameters: ?TypeParameterDeclaration; } | { - type: \'Identifier\'; + type: 'Identifier'; _Identifier: void; name: string; typeAnnotation: ?TypeAnnotation; @@ -1148,7 +1150,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'IfStatement\'; + type: 'IfStatement'; _IfStatement: void; alternate: ?Statement; consequent: Statement; @@ -1163,7 +1165,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ImportDefaultSpecifier\'; + type: 'ImportDefaultSpecifier'; _ImportDefaultSpecifier: void; local: Node; end: number; @@ -1176,7 +1178,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ImportNamespaceSpecifier\'; + type: 'ImportNamespaceSpecifier'; _ImportNamespaceSpecifier: void; local: Node; end: number; @@ -1189,7 +1191,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ImportDeclaration\'; + type: 'ImportDeclaration'; _ImportDeclaration: void; specifiers: Array; source: Literal; @@ -1203,7 +1205,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ImportSpecifier\'; + type: 'ImportSpecifier'; _ImportSpecifier: void; imported: Node; local: Node; @@ -1217,7 +1219,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'LabeledStatement\'; + type: 'LabeledStatement'; _LabeledStatement: void; body: Statement; label: Identifier; @@ -1231,7 +1233,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'Literal\'; + type: 'Literal'; _Literal: void; raw: string; regex: ?{pattern: string, flags: string}; @@ -1246,7 +1248,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'LogicalExpression\'; + type: 'LogicalExpression'; _LogicalExpression: void; left: Expression; operator: LogicalOperator; @@ -1261,7 +1263,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'MemberExpression\'; + type: 'MemberExpression'; _MemberExpression: void; computed: boolean; object: Expression; @@ -1276,7 +1278,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'MetaProperty\'; + type: 'MetaProperty'; _MetaProperty: void; meta: Node; property: Node; @@ -1290,11 +1292,11 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'MethodDefinition\'; + type: 'MethodDefinition'; _MethodDefinition: void; computed: boolean; key: Node; - kind: \'constructor\' | \'method\' | \'get\' | \'set\'; + kind: 'constructor' | 'method' | 'get' | 'set'; static: boolean; value: FunctionExpression; decorators: ?Array; @@ -1308,7 +1310,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'NewExpression\'; + type: 'NewExpression'; _NewExpression: void; arguments: Array; callee: Expression; @@ -1322,7 +1324,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'Noop\'; + type: 'Noop'; _Noop: void; end: number; innerComments: ?Array; @@ -1334,7 +1336,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ObjectExpression\'; + type: 'ObjectExpression'; _ObjectExpression: void; properties: Array; end: number; @@ -1347,7 +1349,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ObjectPattern\'; + type: 'ObjectPattern'; _ObjectPattern: void; properties: Array; typeAnnotation: ?TypeAnnotation; @@ -1361,7 +1363,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'Program\'; + type: 'Program'; _Program: void; body: Array; end: number; @@ -1374,11 +1376,11 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'Property\'; + type: 'Property'; _Property: void; computed: boolean; key: Node; - kind: \'init\' | \'get\' | \'set\'; + kind: 'init' | 'get' | 'set'; method: boolean; shorthand: boolean; value: Node; @@ -1393,7 +1395,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'RestElement\'; + type: 'RestElement'; _RestElement: void; argument: Pattern; typeAnnotation: ?TypeAnnotation; @@ -1407,7 +1409,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ReturnStatement\'; + type: 'ReturnStatement'; _ReturnStatement: void; argument: ?Expression; end: number; @@ -1420,7 +1422,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'SequenceExpression\'; + type: 'SequenceExpression'; _SequenceExpression: void; expression: Array; end: number; @@ -1433,7 +1435,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'SpreadElement\'; + type: 'SpreadElement'; _SpreadElement: void; argument: Expression; end: number; @@ -1446,7 +1448,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'SpreadProperty\'; + type: 'SpreadProperty'; _SpreadProperty: void; argument: Expression; end: number; @@ -1459,7 +1461,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'Super\'; + type: 'Super'; _Super: void; end: number; innerComments: ?Array; @@ -1471,7 +1473,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'SwitchCase\'; + type: 'SwitchCase'; _SwitchCase: void; consequent: Array; test: ?Expression; @@ -1485,7 +1487,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'SwitchStatement\'; + type: 'SwitchStatement'; _SwitchStatement: void; cases: Array; discriminant: Expression; @@ -1500,7 +1502,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TaggedTemplateExpression\'; + type: 'TaggedTemplateExpression'; _TaggedTemplateExpression: void; quasi: TemplateLiteral; tag: Expression; @@ -1514,7 +1516,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TemplateElement\'; + type: 'TemplateElement'; _TemplateElement: void; tail: boolean; value: {cooked: string, raw: string}; @@ -1528,7 +1530,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TemplateLiteral\'; + type: 'TemplateLiteral'; _TemplateLiteral: void; expressions: Array; quasis: Array; @@ -1542,7 +1544,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ThisExpression\'; + type: 'ThisExpression'; _ThisExpression: void; end: number; innerComments: ?Array; @@ -1554,7 +1556,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ThrowStatement\'; + type: 'ThrowStatement'; _ThrowStatement: void; argument: Expression; end: number; @@ -1567,7 +1569,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TryStatement\'; + type: 'TryStatement'; _TryStatement: void; block: BlockStatement; finalizer: ?BlockStatement; @@ -1584,7 +1586,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'UnaryExpression\'; + type: 'UnaryExpression'; _UnaryExpression: void; argument: Expression; operator: UnaryOperator; @@ -1599,7 +1601,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'UpdateExpression\'; + type: 'UpdateExpression'; _UpdateExpression: void; argument: Expression; operator: UpdateOperator; @@ -1614,10 +1616,10 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'VariableDeclaration\'; + type: 'VariableDeclaration'; _VariableDeclaration: void; declarations: Array; - kind: \'var\' | \'let\' | \'const\'; + kind: 'var' | 'let' | 'const'; end: number; innerComments: ?Array; leadingComments: ?Array; @@ -1628,7 +1630,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'VariableDeclarator\'; + type: 'VariableDeclarator'; _VariableDeclarator: void; id: Pattern; init: ?Expression; @@ -1642,7 +1644,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'WhileStatement\'; + type: 'WhileStatement'; _WhileStatement: void; body: Statement; test: Expression; @@ -1656,7 +1658,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'WithStatement\'; + type: 'WithStatement'; _WithStatement: void; body: Statement; object: Expression; @@ -1670,7 +1672,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'YieldExpression\'; + type: 'YieldExpression'; _YieldExpression: void; argument: ?Expression; delegate: boolean; @@ -1684,7 +1686,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ExportAllDeclaration\'; + type: 'ExportAllDeclaration'; _ExportAllDeclaration: void; exported: Node; source: Node; @@ -1698,7 +1700,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ExportDefaultDeclaration\'; + type: 'ExportDefaultDeclaration'; _ExportDefaultDeclaration: void; declaration: Node; end: number; @@ -1711,7 +1713,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ExportNamedDeclaration\'; + type: 'ExportNamedDeclaration'; _ExportNamedDeclaration: void; declaration: Node; source: Literal; @@ -1726,7 +1728,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ExportDefaultSpecifier\'; + type: 'ExportDefaultSpecifier'; _ExportDefaultSpecifier: void; exported: Node; end: number; @@ -1739,7 +1741,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ExportNamespaceSpecifier\'; + type: 'ExportNamespaceSpecifier'; _ExportNamespaceSpecifier: void; exported: Node; end: number; @@ -1752,7 +1754,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ExportSpecifier\'; + type: 'ExportSpecifier'; _ExportSpecifier: void; local: Node; exported: Node; @@ -1766,7 +1768,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'AnyTypeAnnotation\'; + type: 'AnyTypeAnnotation'; _AnyTypeAnnotation: void; end: number; innerComments: ?Array; @@ -1778,7 +1780,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ArrayTypeAnnotation\'; + type: 'ArrayTypeAnnotation'; _ArrayTypeAnnotation: void; elementType: Type; end: number; @@ -1791,7 +1793,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'BooleanLiteralTypeAnnotation\'; + type: 'BooleanLiteralTypeAnnotation'; _BooleanLiteralTypeAnnotation: void; raw: string; value: boolean; @@ -1805,7 +1807,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'BooleanTypeAnnotation\'; + type: 'BooleanTypeAnnotation'; _BooleanTypeAnnotation: void; end: number; innerComments: ?Array; @@ -1817,7 +1819,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ClassImplements\'; + type: 'ClassImplements'; _ClassImplements: void; id: Identifier; typeParameters: ?TypeParameterInstantiation; @@ -1832,7 +1834,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ClassProperty\'; + type: 'ClassProperty'; _ClassProperty: void; computed: boolean; key: Node; @@ -1850,7 +1852,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'DeclareClass\'; + type: 'DeclareClass'; _DeclareClass: void; body: ObjectTypeAnnotation; extends: Array; @@ -1866,7 +1868,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'DeclareFunction\'; + type: 'DeclareFunction'; _DeclareFunction: void; id: Identifier; end: number; @@ -1879,7 +1881,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'DeclareModule\'; + type: 'DeclareModule'; _DeclareModule: void; body: BlockStatement; id: Node; @@ -1893,7 +1895,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'DeclareVariable\'; + type: 'DeclareVariable'; _DeclareVariable: void; id: Identifier; end: number; @@ -1906,7 +1908,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'FunctionTypeAnnotation\'; + type: 'FunctionTypeAnnotation'; _FunctionTypeAnnotation: void; params: Array; rest: ?FunctionTypeParam; @@ -1922,7 +1924,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'FunctionTypeParam\'; + type: 'FunctionTypeParam'; _FunctionTypeParam: void; name: Identifier; optional: boolean; @@ -1937,7 +1939,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'GenericTypeAnnotation\'; + type: 'GenericTypeAnnotation'; _GenericTypeAnnotation: void; id: Node; typeParameters: ?TypeParameterInstantiation; @@ -1951,7 +1953,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'InterfaceExtends\'; + type: 'InterfaceExtends'; _InterfaceExtends: void; id: Identifier; typeParameters: ?TypeParameterInstantiation; @@ -1965,7 +1967,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'InterfaceDeclaration\'; + type: 'InterfaceDeclaration'; _InterfaceDeclaration: void; body: ObjectTypeAnnotation; extends: Array; @@ -1981,7 +1983,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'IntersectionTypeAnnotation\'; + type: 'IntersectionTypeAnnotation'; _IntersectionTypeAnnotation: void; types: Array; end: number; @@ -1994,7 +1996,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'MixedTypeAnnotation\'; + type: 'MixedTypeAnnotation'; _MixedTypeAnnotation: void; end: number; innerComments: ?Array; @@ -2006,7 +2008,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'NullableTypeAnnotation\'; + type: 'NullableTypeAnnotation'; _NullableTypeAnnotation: void; typeAnnotation: Type; end: number; @@ -2019,7 +2021,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'NumberLiteralTypeAnnotation\'; + type: 'NumberLiteralTypeAnnotation'; _NumberLiteralTypeAnnotation: void; raw: string; value: number; @@ -2033,7 +2035,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'NumberTypeAnnotation\'; + type: 'NumberTypeAnnotation'; _NumberTypeAnnotation: void; end: number; innerComments: ?Array; @@ -2045,7 +2047,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'StringLiteralTypeAnnotation\'; + type: 'StringLiteralTypeAnnotation'; _StringLiteralTypeAnnotation: void; raw: string; value: string; @@ -2059,7 +2061,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'StringTypeAnnotation\'; + type: 'StringTypeAnnotation'; _StringTypeAnnotation: void; end: number; innerComments: ?Array; @@ -2071,7 +2073,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TupleTypeAnnotation\'; + type: 'TupleTypeAnnotation'; _TupleTypeAnnotation: void; types: Array; end: number; @@ -2084,7 +2086,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TypeofTypeAnnotation\'; + type: 'TypeofTypeAnnotation'; _TypeofTypeAnnotation: void; argument: Type; end: number; @@ -2097,7 +2099,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TypeAlias\'; + type: 'TypeAlias'; _TypeAlias: void; id: Identifier; right: Type; @@ -2112,7 +2114,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TypeAnnotation\'; + type: 'TypeAnnotation'; _TypeAnnotation: void; typeAnnotation: Type; end: number; @@ -2125,7 +2127,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TypeCastExpression\'; + type: 'TypeCastExpression'; _TypeCastExpression: void; expression: Expression; typeAnnotation: TypeAnnotation; @@ -2139,7 +2141,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TypeParameterDeclaration\'; + type: 'TypeParameterDeclaration'; _TypeParameterDeclaration: void; params: Array; end: number; @@ -2152,7 +2154,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'TypeParameterInstantiation\'; + type: 'TypeParameterInstantiation'; _TypeParameterInstantiation: void; params: Array; end: number; @@ -2165,7 +2167,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ObjectTypeAnnotation\'; + type: 'ObjectTypeAnnotation'; _ObjectTypeAnnotation: void; callProperties: Array; indexers: Array; @@ -2180,7 +2182,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ObjectTypeCallProperty\'; + type: 'ObjectTypeCallProperty'; _ObjectTypeCallProperty: void; static: boolean; value: FunctionTypeAnnotation; @@ -2194,7 +2196,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ObjectTypeIndexer\'; + type: 'ObjectTypeIndexer'; _ObjectTypeIndexer: void; id: Identifier; key: Type; @@ -2209,7 +2211,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'ObjectTypeProperty\'; + type: 'ObjectTypeProperty'; _ObjectTypeProperty: void; key: Node; optional: boolean; @@ -2224,7 +2226,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'QualifiedTypeIdentifier\'; + type: 'QualifiedTypeIdentifier'; _QualifiedTypeIdentifier: void; id: Identifier; qualification: Node; @@ -2238,7 +2240,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'UnionTypeAnnotation\'; + type: 'UnionTypeAnnotation'; _UnionTypeAnnotation: void; types: Array; end: number; @@ -2251,7 +2253,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'VoidTypeAnnotation\'; + type: 'VoidTypeAnnotation'; _VoidTypeAnnotation: void; end: number; innerComments: ?Array; @@ -2263,7 +2265,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'JSXAttribute\'; + type: 'JSXAttribute'; _JSXAttribute: void; name: Node; value: ?Node; @@ -2277,7 +2279,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'JSXClosingElement\'; + type: 'JSXClosingElement'; _JSXClosingElement: void; name: Node; end: number; @@ -2290,7 +2292,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'JSXElement\'; + type: 'JSXElement'; _JSXElement: void; children: Array; closingElement: ?JSXClosingElement; @@ -2305,7 +2307,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'JSXEmptyExpression\'; + type: 'JSXEmptyExpression'; _JSXEmptyExpression: void; end: number; innerComments: ?Array; @@ -2317,7 +2319,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'JSXExpressionContainer\'; + type: 'JSXExpressionContainer'; _JSXExpressionContainer: void; expression: Expression; end: number; @@ -2330,7 +2332,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'JSXIdentifier\'; + type: 'JSXIdentifier'; _JSXIdentifier: void; name: string; end: number; @@ -2343,7 +2345,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'JSXMemberExpression\'; + type: 'JSXMemberExpression'; _JSXMemberExpression: void; computed: boolean; object: Node; @@ -2358,7 +2360,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'JSXNamespacedName\'; + type: 'JSXNamespacedName'; _JSXNamespacedName: void; name: JSXIdentifier; namespace: JSXIdentifier; @@ -2372,7 +2374,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'JSXOpeningElement\'; + type: 'JSXOpeningElement'; _JSXOpeningElement: void; attributes: Array; name: Array; @@ -2387,7 +2389,7 @@ export type Node = { start: number; trailingComments: ?Array; } | { - type: \'JSXSpreadAttribute\'; + type: 'JSXSpreadAttribute'; _JSXSpreadAttribute: void; argument: Expression; end: number; @@ -2402,7 +2404,7 @@ export type Node = { }; export type Pattern = { - type: \'ArrayPattern\'; + type: 'ArrayPattern'; _ArrayPattern: void; elements: Array; typeAnnotation: ?TypeAnnotation; @@ -2416,7 +2418,7 @@ export type Pattern = { start: number; trailingComments: ?Array; } | { - type: \'AssignmentPattern\'; + type: 'AssignmentPattern'; _AssignmentPattern: void; left: Pattern; right: Expression; @@ -2430,7 +2432,7 @@ export type Pattern = { start: number; trailingComments: ?Array; } | { - type: \'Identifier\'; + type: 'Identifier'; _Identifier: void; name: string; typeAnnotation: ?TypeAnnotation; @@ -2444,7 +2446,7 @@ export type Pattern = { start: number; trailingComments: ?Array; } | { - type: \'ObjectPattern\'; + type: 'ObjectPattern'; _ObjectPattern: void; properties: Array; typeAnnotation: ?TypeAnnotation; @@ -2458,7 +2460,7 @@ export type Pattern = { start: number; trailingComments: ?Array; } | { - type: \'RestElement\'; + type: 'RestElement'; _RestElement: void; argument: Pattern; typeAnnotation: ?TypeAnnotation; @@ -2474,7 +2476,7 @@ export type Pattern = { }; export type Statement = { - type: \'BlockStatement\'; + type: 'BlockStatement'; _BlockStatement: void; body: Array; end: number; @@ -2487,7 +2489,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'BreakStatement\'; + type: 'BreakStatement'; _BreakStatement: void; label: ?Identifier; end: number; @@ -2500,7 +2502,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'ContinueStatement\'; + type: 'ContinueStatement'; _ContinueStatement: void; label: ?Identifier; end: number; @@ -2513,7 +2515,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'DoWhileStatement\'; + type: 'DoWhileStatement'; _DoWhileStatement: void; body: Statement; test: Expression; @@ -2527,7 +2529,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'EmptyStatement\'; + type: 'EmptyStatement'; _EmptyStatement: void; end: number; innerComments: ?Array; @@ -2539,7 +2541,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'ExpressionStatement\'; + type: 'ExpressionStatement'; _ExpressionStatement: void; expression: Expression; end: number; @@ -2552,7 +2554,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'ForInStatement\'; + type: 'ForInStatement'; _ForInStatement: void; body: Statement; left: Node; @@ -2567,7 +2569,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'ForOfStatement\'; + type: 'ForOfStatement'; _ForOfStatement: void; body: Statement; left: Node; @@ -2582,7 +2584,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'ForStatement\'; + type: 'ForStatement'; _ForStatement: void; init: ?Node; test: ?Expression; @@ -2598,7 +2600,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'IfStatement\'; + type: 'IfStatement'; _IfStatement: void; alternate: ?Statement; consequent: Statement; @@ -2613,7 +2615,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'LabeledStatement\'; + type: 'LabeledStatement'; _LabeledStatement: void; body: Statement; label: Identifier; @@ -2627,7 +2629,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'ReturnStatement\'; + type: 'ReturnStatement'; _ReturnStatement: void; argument: ?Expression; end: number; @@ -2640,7 +2642,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'SwitchStatement\'; + type: 'SwitchStatement'; _SwitchStatement: void; cases: Array; discriminant: Expression; @@ -2655,7 +2657,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'ThrowStatement\'; + type: 'ThrowStatement'; _ThrowStatement: void; argument: Expression; end: number; @@ -2668,7 +2670,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'TryStatement\'; + type: 'TryStatement'; _TryStatement: void; block: BlockStatement; finalizer: ?BlockStatement; @@ -2685,7 +2687,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'WhileStatement\'; + type: 'WhileStatement'; _WhileStatement: void; body: Statement; test: Expression; @@ -2699,7 +2701,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'WithStatement\'; + type: 'WithStatement'; _WithStatement: void; body: Statement; object: Expression; @@ -2713,7 +2715,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'DeclareClass\'; + type: 'DeclareClass'; _DeclareClass: void; body: ObjectTypeAnnotation; extends: Array; @@ -2729,7 +2731,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'DeclareFunction\'; + type: 'DeclareFunction'; _DeclareFunction: void; id: Identifier; end: number; @@ -2742,7 +2744,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'DeclareModule\'; + type: 'DeclareModule'; _DeclareModule: void; body: BlockStatement; id: Node; @@ -2756,7 +2758,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'DeclareVariable\'; + type: 'DeclareVariable'; _DeclareVariable: void; id: Identifier; end: number; @@ -2769,7 +2771,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'InterfaceDeclaration\'; + type: 'InterfaceDeclaration'; _InterfaceDeclaration: void; body: ObjectTypeAnnotation; extends: Array; @@ -2785,7 +2787,7 @@ export type Statement = { start: number; trailingComments: ?Array; } | { - type: \'TypeAlias\'; + type: 'TypeAlias'; _TypeAlias: void; id: Identifier; right: Type; @@ -2802,7 +2804,7 @@ export type Statement = { }; export type Type = { - type: \'AnyTypeAnnotation\'; + type: 'AnyTypeAnnotation'; _AnyTypeAnnotation: void; end: number; innerComments: ?Array; @@ -2814,7 +2816,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'ArrayTypeAnnotation\'; + type: 'ArrayTypeAnnotation'; _ArrayTypeAnnotation: void; elementType: Type; end: number; @@ -2827,7 +2829,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'BooleanLiteralTypeAnnotation\'; + type: 'BooleanLiteralTypeAnnotation'; _BooleanLiteralTypeAnnotation: void; raw: string; value: boolean; @@ -2841,7 +2843,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'BooleanTypeAnnotation\'; + type: 'BooleanTypeAnnotation'; _BooleanTypeAnnotation: void; end: number; innerComments: ?Array; @@ -2853,7 +2855,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'FunctionTypeAnnotation\'; + type: 'FunctionTypeAnnotation'; _FunctionTypeAnnotation: void; params: Array; rest: ?FunctionTypeParam; @@ -2869,7 +2871,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'GenericTypeAnnotation\'; + type: 'GenericTypeAnnotation'; _GenericTypeAnnotation: void; id: Node; typeParameters: ?TypeParameterInstantiation; @@ -2883,7 +2885,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'IntersectionTypeAnnotation\'; + type: 'IntersectionTypeAnnotation'; _IntersectionTypeAnnotation: void; types: Array; end: number; @@ -2896,7 +2898,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'MixedTypeAnnotation\'; + type: 'MixedTypeAnnotation'; _MixedTypeAnnotation: void; end: number; innerComments: ?Array; @@ -2908,7 +2910,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'NullableTypeAnnotation\'; + type: 'NullableTypeAnnotation'; _NullableTypeAnnotation: void; typeAnnotation: Type; end: number; @@ -2921,7 +2923,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'NumberLiteralTypeAnnotation\'; + type: 'NumberLiteralTypeAnnotation'; _NumberLiteralTypeAnnotation: void; raw: string; value: number; @@ -2935,7 +2937,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'NumberTypeAnnotation\'; + type: 'NumberTypeAnnotation'; _NumberTypeAnnotation: void; end: number; innerComments: ?Array; @@ -2947,7 +2949,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'StringLiteralTypeAnnotation\'; + type: 'StringLiteralTypeAnnotation'; _StringLiteralTypeAnnotation: void; raw: string; value: string; @@ -2961,7 +2963,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'StringTypeAnnotation\'; + type: 'StringTypeAnnotation'; _StringTypeAnnotation: void; end: number; innerComments: ?Array; @@ -2973,7 +2975,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'TupleTypeAnnotation\'; + type: 'TupleTypeAnnotation'; _TupleTypeAnnotation: void; types: Array; end: number; @@ -2986,7 +2988,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'ObjectTypeAnnotation\'; + type: 'ObjectTypeAnnotation'; _ObjectTypeAnnotation: void; callProperties: Array; indexers: Array; @@ -3001,7 +3003,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'UnionTypeAnnotation\'; + type: 'UnionTypeAnnotation'; _UnionTypeAnnotation: void; types: Array; end: number; @@ -3014,7 +3016,7 @@ export type Type = { start: number; trailingComments: ?Array; } | { - type: \'VoidTypeAnnotation\'; + type: 'VoidTypeAnnotation'; _VoidTypeAnnotation: void; end: number; innerComments: ?Array; @@ -3030,7 +3032,7 @@ export type Type = { // Concrete Types. Nothing can extend these. export type CommentLine = { - type: \'CommentLine\'; + type: 'CommentLine'; _CommentLine: void; value: string; end: number; @@ -3042,7 +3044,7 @@ export type CommentLine = { }; export type CommentBlock = { - type: \'CommentBlock\'; + type: 'CommentBlock'; _CommentBlock: void; value: string; end: number; @@ -3056,7 +3058,7 @@ export type CommentBlock = { // Babel concrete types. export type ArrayExpression = { - type: \'ArrayExpression\'; + type: 'ArrayExpression'; _ArrayExpression: void; elements: Array; end: number; @@ -3071,7 +3073,7 @@ export type ArrayExpression = { }; export type ArrayPattern = { - type: \'ArrayPattern\'; + type: 'ArrayPattern'; _ArrayPattern: void; elements: Array; typeAnnotation: ?TypeAnnotation; @@ -3087,7 +3089,7 @@ export type ArrayPattern = { }; export type ArrowFunctionExpression = { - type: \'ArrowFunctionExpression\'; + type: 'ArrowFunctionExpression'; _ArrowFunctionExpression: void; body: Node; id: ?Identifier; @@ -3111,21 +3113,21 @@ export type ArrowFunctionExpression = { }; type AssignmentOperator = - \'=\' | - \'+=\' | - \'-=\' | - \'*=\' | - \'/=\' | - \'%=\' | - \'<<=\' | - \'>>=\' | - \'>>>=\' | - \'|=\' | - \'^=\' | - \'&=\'; + '=' | + '+=' | + '-=' | + '*=' | + '/=' | + '%=' | + '<<=' | + '>>=' | + '>>>=' | + '|=' | + '^=' | + '&='; export type AssignmentExpression = { - type: \'AssignmentExpression\'; + type: 'AssignmentExpression'; _AssignmentExpression: void; left: Pattern; operator: AssignmentOperator; @@ -3142,7 +3144,7 @@ export type AssignmentExpression = { }; export type AssignmentPattern = { - type: \'AssignmentPattern\'; + type: 'AssignmentPattern'; _AssignmentPattern: void; left: Pattern; right: Expression; @@ -3158,7 +3160,7 @@ export type AssignmentPattern = { }; export type AwaitExpression = { - type: \'AwaitExpression\'; + type: 'AwaitExpression'; _AwaitExpression: void; all: boolean; argument: ?Expression; @@ -3174,31 +3176,31 @@ export type AwaitExpression = { }; type BinaryOperator = - \'==\' | - \'!=\' | - \'===\' | - \'!==\' | - \'<\' | - \'<=\' | - \'>\' | - \'>=\' | - \'<<\' | - \'>>\' | - \'>>>\' | - \'+\' | - \'-\' | - \'*\' | - \'/\' | - \'%\' | - \'&\' | - \'|\' | - \'^\' | - \'in\' | - \'instanceof\' | - \'..\'; + '==' | + '!=' | + '===' | + '!==' | + '<' | + '<=' | + '>' | + '>=' | + '<<' | + '>>' | + '>>>' | + '+' | + '-' | + '*' | + '/' | + '%' | + '&' | + '|' | + '^' | + 'in' | + 'instanceof' | + '..'; export type BinaryExpression = { - type: \'BinaryExpression\'; + type: 'BinaryExpression'; _BinaryExpression: void; left: Expression; operator: BinaryOperator; @@ -3216,7 +3218,7 @@ export type BinaryExpression = { // TODO: What is this? export type BindExpression = { - type: \'BindExpression\'; + type: 'BindExpression'; _BindExpression: void; callee: Node; object: Node; @@ -3232,7 +3234,7 @@ export type BindExpression = { }; export type BlockStatement = { - type: \'BlockStatement\'; + type: 'BlockStatement'; _BlockStatement: void; body: Array; end: number; @@ -3247,7 +3249,7 @@ export type BlockStatement = { }; export type BreakStatement = { - type: \'BreakStatement\'; + type: 'BreakStatement'; _BreakStatement: void; label: ?Identifier; end: number; @@ -3262,7 +3264,7 @@ export type BreakStatement = { }; export type CallExpression = { - type: \'CallExpression\'; + type: 'CallExpression'; _CallExpression: void; arguments: Array; callee: Expression; @@ -3278,7 +3280,7 @@ export type CallExpression = { }; export type CatchClause = { - type: \'CatchClause\'; + type: 'CatchClause'; _CatchClause: void; body: BlockStatement; param: Pattern; @@ -3294,7 +3296,7 @@ export type CatchClause = { }; export type ClassBody = { - type: \'ClassBody\'; + type: 'ClassBody'; _ClassBody: void; body: Array; end: number; @@ -3309,7 +3311,7 @@ export type ClassBody = { }; export type ClassDeclaration = { - type: \'ClassDeclaration\'; + type: 'ClassDeclaration'; _ClassDeclaration: void; body: ClassBody; id: ?Identifier; @@ -3329,7 +3331,7 @@ export type ClassDeclaration = { }; export type ClassExpression = { - type: \'ClassExpression\'; + type: 'ClassExpression'; _ClassExpression: void; body: ClassBody; id: ?Identifier; @@ -3349,7 +3351,7 @@ export type ClassExpression = { }; export type ComprehensionBlock = { - type: \'ComprehensionBlock\'; + type: 'ComprehensionBlock'; _ComprehensionBlock: void; each: boolean; left: Pattern; @@ -3366,7 +3368,7 @@ export type ComprehensionBlock = { }; export type ComprehensionExpression = { - type: \'ComprehensionExpression\'; + type: 'ComprehensionExpression'; _ComprehensionExpression: void; body: Expression; blocks: Array; @@ -3383,7 +3385,7 @@ export type ComprehensionExpression = { }; export type ConditionalExpression = { - type: \'ConditionalExpression\'; + type: 'ConditionalExpression'; _ConditionalExpression: void; alternate: Expression; consequent: Expression; @@ -3400,7 +3402,7 @@ export type ConditionalExpression = { }; export type ContinueStatement = { - type: \'ContinueStatement\'; + type: 'ContinueStatement'; _ContinueStatement: void; label: ?Identifier; end: number; @@ -3416,7 +3418,7 @@ export type ContinueStatement = { // TODO: Make this correct. export type Decorator = { - type: \'Decorator\'; + type: 'Decorator'; _Decorator: void; expression: Expression; end: number; @@ -3431,7 +3433,7 @@ export type Decorator = { }; export type DebuggerStatement = { - type: \'DebuggerStatement\'; + type: 'DebuggerStatement'; _DebuggerStatement: void; end: number; innerComments: ?Array; @@ -3445,7 +3447,7 @@ export type DebuggerStatement = { }; export type DoWhileStatement = { - type: \'DoWhileStatement\'; + type: 'DoWhileStatement'; _DoWhileStatement: void; body: Statement; test: Expression; @@ -3462,7 +3464,7 @@ export type DoWhileStatement = { // TODO: Make this correct. export type DoExpression = { - type: \'DoExpression\'; + type: 'DoExpression'; _DoExpression: void; body: Statement; end: number; @@ -3477,7 +3479,7 @@ export type DoExpression = { }; export type EmptyStatement = { - type: \'EmptyStatement\'; + type: 'EmptyStatement'; _EmptyStatement: void; end: number; innerComments: ?Array; @@ -3491,7 +3493,7 @@ export type EmptyStatement = { }; export type ExpressionStatement = { - type: \'ExpressionStatement\'; + type: 'ExpressionStatement'; _ExpressionStatement: void; expression: Expression; end: number; @@ -3506,7 +3508,7 @@ export type ExpressionStatement = { }; export type File = { - type: \'File\'; + type: 'File'; _File: void; program: Program; end: number; @@ -3521,7 +3523,7 @@ export type File = { }; export type ForInStatement = { - type: \'ForInStatement\'; + type: 'ForInStatement'; _ForInStatement: void; body: Statement; left: Node; @@ -3539,7 +3541,7 @@ export type ForInStatement = { // TODO: Make this correct. export type ForOfStatement = { - type: \'ForOfStatement\'; + type: 'ForOfStatement'; _ForOfStatement: void; body: Statement; left: Node; @@ -3556,7 +3558,7 @@ export type ForOfStatement = { }; export type ForStatement = { - type: \'ForStatement\'; + type: 'ForStatement'; _ForStatement: void; init: ?Node; test: ?Expression; @@ -3574,7 +3576,7 @@ export type ForStatement = { }; export type FunctionDeclaration = { - type: \'FunctionDeclaration\'; + type: 'FunctionDeclaration'; _FunctionDeclaration: void; body: BlockStatement; id: Identifier; @@ -3598,7 +3600,7 @@ export type FunctionDeclaration = { }; export type FunctionExpression = { - type: \'FunctionExpression\'; + type: 'FunctionExpression'; _FunctionExpression: void; body: BlockStatement; id: ?Identifier; @@ -3622,7 +3624,7 @@ export type FunctionExpression = { }; export type Identifier = { - type: \'Identifier\'; + type: 'Identifier'; _Identifier: void; name: string; typeAnnotation: ?TypeAnnotation; @@ -3638,7 +3640,7 @@ export type Identifier = { }; export type IfStatement = { - type: \'IfStatement\'; + type: 'IfStatement'; _IfStatement: void; alternate: ?Statement; consequent: Statement; @@ -3656,7 +3658,7 @@ export type IfStatement = { // TODO: Make this correct. export type ImportDefaultSpecifier = { - type: \'ImportDefaultSpecifier\'; + type: 'ImportDefaultSpecifier'; _ImportDefaultSpecifier: void; local: Node; end: number; @@ -3672,7 +3674,7 @@ export type ImportDefaultSpecifier = { // TODO: Make this correct. export type ImportNamespaceSpecifier = { - type: \'ImportNamespaceSpecifier\'; + type: 'ImportNamespaceSpecifier'; _ImportNamespaceSpecifier: void; local: Node; end: number; @@ -3688,7 +3690,7 @@ export type ImportNamespaceSpecifier = { // TODO: Make this correct. export type ImportDeclaration = { - type: \'ImportDeclaration\'; + type: 'ImportDeclaration'; _ImportDeclaration: void; specifiers: Array; source: Literal; @@ -3705,7 +3707,7 @@ export type ImportDeclaration = { // TODO: Make this correct. export type ImportSpecifier = { - type: \'ImportSpecifier\'; + type: 'ImportSpecifier'; _ImportSpecifier: void; imported: Node; local: Node; @@ -3721,7 +3723,7 @@ export type ImportSpecifier = { }; export type LabeledStatement = { - type: \'LabeledStatement\'; + type: 'LabeledStatement'; _LabeledStatement: void; body: Statement; label: Identifier; @@ -3737,7 +3739,7 @@ export type LabeledStatement = { }; export type Literal = { - type: \'Literal\'; + type: 'Literal'; _Literal: void; raw: string; regex: ?{pattern: string, flags: string}; @@ -3753,10 +3755,10 @@ export type Literal = { trailingComments: ?Array; }; -type LogicalOperator = \'||\' | \'&&\'; +type LogicalOperator = '||' | '&&'; export type LogicalExpression = { - type: \'LogicalExpression\'; + type: 'LogicalExpression'; _LogicalExpression: void; left: Expression; operator: LogicalOperator; @@ -3773,7 +3775,7 @@ export type LogicalExpression = { }; export type MemberExpression = { - type: \'MemberExpression\'; + type: 'MemberExpression'; _MemberExpression: void; computed: boolean; object: Expression; @@ -3791,7 +3793,7 @@ export type MemberExpression = { // TODO: Make this correct. export type MetaProperty = { - type: \'MetaProperty\'; + type: 'MetaProperty'; _MetaProperty: void; meta: Node; property: Node; @@ -3807,11 +3809,11 @@ export type MetaProperty = { }; export type MethodDefinition = { - type: \'MethodDefinition\'; + type: 'MethodDefinition'; _MethodDefinition: void; computed: boolean; key: Node; - kind: \'constructor\' | \'method\' | \'get\' | \'set\'; + kind: 'constructor' | 'method' | 'get' | 'set'; static: boolean; value: FunctionExpression; decorators: ?Array; @@ -3827,7 +3829,7 @@ export type MethodDefinition = { }; export type NewExpression = { - type: \'NewExpression\'; + type: 'NewExpression'; _NewExpression: void; arguments: Array; callee: Expression; @@ -3843,7 +3845,7 @@ export type NewExpression = { }; export type Noop = { - type: \'Noop\'; + type: 'Noop'; _Noop: void; end: number; innerComments: ?Array; @@ -3857,7 +3859,7 @@ export type Noop = { }; export type ObjectExpression = { - type: \'ObjectExpression\'; + type: 'ObjectExpression'; _ObjectExpression: void; properties: Array; end: number; @@ -3872,7 +3874,7 @@ export type ObjectExpression = { }; export type ObjectPattern = { - type: \'ObjectPattern\'; + type: 'ObjectPattern'; _ObjectPattern: void; properties: Array; typeAnnotation: ?TypeAnnotation; @@ -3888,7 +3890,7 @@ export type ObjectPattern = { }; export type Program = { - type: \'Program\'; + type: 'Program'; _Program: void; body: Array; end: number; @@ -3903,11 +3905,11 @@ export type Program = { }; export type Property = { - type: \'Property\'; + type: 'Property'; _Property: void; computed: boolean; key: Node; - kind: \'init\' | \'get\' | \'set\'; + kind: 'init' | 'get' | 'set'; method: boolean; shorthand: boolean; value: Node; @@ -3924,7 +3926,7 @@ export type Property = { }; export type RestElement = { - type: \'RestElement\'; + type: 'RestElement'; _RestElement: void; argument: Pattern; typeAnnotation: ?TypeAnnotation; @@ -3940,7 +3942,7 @@ export type RestElement = { }; export type ReturnStatement = { - type: \'ReturnStatement\'; + type: 'ReturnStatement'; _ReturnStatement: void; argument: ?Expression; end: number; @@ -3955,7 +3957,7 @@ export type ReturnStatement = { }; export type SequenceExpression = { - type: \'SequenceExpression\'; + type: 'SequenceExpression'; _SequenceExpression: void; expression: Array; end: number; @@ -3970,7 +3972,7 @@ export type SequenceExpression = { }; export type SpreadElement = { - type: \'SpreadElement\'; + type: 'SpreadElement'; _SpreadElement: void; argument: Expression; end: number; @@ -3985,7 +3987,7 @@ export type SpreadElement = { }; export type SpreadProperty = { - type: \'SpreadProperty\'; + type: 'SpreadProperty'; _SpreadProperty: void; argument: Expression; end: number; @@ -4000,7 +4002,7 @@ export type SpreadProperty = { }; export type Super = { - type: \'Super\'; + type: 'Super'; _Super: void; end: number; innerComments: ?Array; @@ -4014,7 +4016,7 @@ export type Super = { }; export type SwitchCase = { - type: \'SwitchCase\'; + type: 'SwitchCase'; _SwitchCase: void; consequent: Array; test: ?Expression; @@ -4030,7 +4032,7 @@ export type SwitchCase = { }; export type SwitchStatement = { - type: \'SwitchStatement\'; + type: 'SwitchStatement'; _SwitchStatement: void; cases: Array; discriminant: Expression; @@ -4047,7 +4049,7 @@ export type SwitchStatement = { }; export type TaggedTemplateExpression = { - type: \'TaggedTemplateExpression\'; + type: 'TaggedTemplateExpression'; _TaggedTemplateExpression: void; quasi: TemplateLiteral; tag: Expression; @@ -4063,7 +4065,7 @@ export type TaggedTemplateExpression = { }; export type TemplateElement = { - type: \'TemplateElement\'; + type: 'TemplateElement'; _TemplateElement: void; tail: boolean; value: {cooked: string, raw: string}; @@ -4079,7 +4081,7 @@ export type TemplateElement = { }; export type TemplateLiteral = { - type: \'TemplateLiteral\'; + type: 'TemplateLiteral'; _TemplateLiteral: void; expressions: Array; quasis: Array; @@ -4095,7 +4097,7 @@ export type TemplateLiteral = { }; export type ThisExpression = { - type: \'ThisExpression\'; + type: 'ThisExpression'; _ThisExpression: void; end: number; innerComments: ?Array; @@ -4109,7 +4111,7 @@ export type ThisExpression = { }; export type ThrowStatement = { - type: \'ThrowStatement\'; + type: 'ThrowStatement'; _ThrowStatement: void; argument: Expression; end: number; @@ -4124,7 +4126,7 @@ export type ThrowStatement = { }; export type TryStatement = { - type: \'TryStatement\'; + type: 'TryStatement'; _TryStatement: void; block: BlockStatement; finalizer: ?BlockStatement; @@ -4142,10 +4144,10 @@ export type TryStatement = { trailingComments: ?Array; }; -type UnaryOperator = \'-\' | \'+\' | \'!\' | \'~\' | \'typeof\' | \'void\' | \'delete\'; +type UnaryOperator = '-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete'; export type UnaryExpression = { - type: \'UnaryExpression\'; + type: 'UnaryExpression'; _UnaryExpression: void; argument: Expression; operator: UnaryOperator; @@ -4161,10 +4163,10 @@ export type UnaryExpression = { trailingComments: ?Array; }; -type UpdateOperator = \'++\' | \'--\'; +type UpdateOperator = '++' | '--'; export type UpdateExpression = { - type: \'UpdateExpression\'; + type: 'UpdateExpression'; _UpdateExpression: void; argument: Expression; operator: UpdateOperator; @@ -4181,10 +4183,10 @@ export type UpdateExpression = { }; export type VariableDeclaration = { - type: \'VariableDeclaration\'; + type: 'VariableDeclaration'; _VariableDeclaration: void; declarations: Array; - kind: \'var\' | \'let\' | \'const\'; + kind: 'var' | 'let' | 'const'; end: number; innerComments: ?Array; leadingComments: ?Array; @@ -4197,7 +4199,7 @@ export type VariableDeclaration = { }; export type VariableDeclarator = { - type: \'VariableDeclarator\'; + type: 'VariableDeclarator'; _VariableDeclarator: void; id: Pattern; init: ?Expression; @@ -4213,7 +4215,7 @@ export type VariableDeclarator = { }; export type WhileStatement = { - type: \'WhileStatement\'; + type: 'WhileStatement'; _WhileStatement: void; body: Statement; test: Expression; @@ -4229,7 +4231,7 @@ export type WhileStatement = { }; export type WithStatement = { - type: \'WithStatement\'; + type: 'WithStatement'; _WithStatement: void; body: Statement; object: Expression; @@ -4245,7 +4247,7 @@ export type WithStatement = { }; export type YieldExpression = { - type: \'YieldExpression\'; + type: 'YieldExpression'; _YieldExpression: void; argument: ?Expression; delegate: boolean; @@ -4262,7 +4264,7 @@ export type YieldExpression = { // TODO: Make this correct. export type ExportAllDeclaration = { - type: \'ExportAllDeclaration\'; + type: 'ExportAllDeclaration'; _ExportAllDeclaration: void; exported: Node; source: Node; @@ -4279,7 +4281,7 @@ export type ExportAllDeclaration = { // TODO: Make this correct. export type ExportDefaultDeclaration = { - type: \'ExportDefaultDeclaration\'; + type: 'ExportDefaultDeclaration'; _ExportDefaultDeclaration: void; declaration: Node; end: number; @@ -4295,7 +4297,7 @@ export type ExportDefaultDeclaration = { // TODO: Make this correct. export type ExportNamedDeclaration = { - type: \'ExportNamedDeclaration\'; + type: 'ExportNamedDeclaration'; _ExportNamedDeclaration: void; declaration: Node; source: Literal; @@ -4313,7 +4315,7 @@ export type ExportNamedDeclaration = { // TODO: Make this correct. export type ExportDefaultSpecifier = { - type: \'ExportDefaultSpecifier\'; + type: 'ExportDefaultSpecifier'; _ExportDefaultSpecifier: void; exported: Node; end: number; @@ -4329,7 +4331,7 @@ export type ExportDefaultSpecifier = { // TODO: Make this correct. export type ExportNamespaceSpecifier = { - type: \'ExportNamespaceSpecifier\'; + type: 'ExportNamespaceSpecifier'; _ExportNamespaceSpecifier: void; exported: Node; end: number; @@ -4345,7 +4347,7 @@ export type ExportNamespaceSpecifier = { // TODO: Make this correct. export type ExportSpecifier = { - type: \'ExportSpecifier\'; + type: 'ExportSpecifier'; _ExportSpecifier: void; local: Node; exported: Node; @@ -4361,7 +4363,7 @@ export type ExportSpecifier = { }; export type AnyTypeAnnotation = { - type: \'AnyTypeAnnotation\'; + type: 'AnyTypeAnnotation'; _AnyTypeAnnotation: void; end: number; innerComments: ?Array; @@ -4375,7 +4377,7 @@ export type AnyTypeAnnotation = { }; export type ArrayTypeAnnotation = { - type: \'ArrayTypeAnnotation\'; + type: 'ArrayTypeAnnotation'; _ArrayTypeAnnotation: void; elementType: Type; end: number; @@ -4390,7 +4392,7 @@ export type ArrayTypeAnnotation = { }; export type BooleanLiteralTypeAnnotation = { - type: \'BooleanLiteralTypeAnnotation\'; + type: 'BooleanLiteralTypeAnnotation'; _BooleanLiteralTypeAnnotation: void; raw: string; value: boolean; @@ -4406,7 +4408,7 @@ export type BooleanLiteralTypeAnnotation = { }; export type BooleanTypeAnnotation = { - type: \'BooleanTypeAnnotation\'; + type: 'BooleanTypeAnnotation'; _BooleanTypeAnnotation: void; end: number; innerComments: ?Array; @@ -4420,7 +4422,7 @@ export type BooleanTypeAnnotation = { }; export type ClassImplements = { - type: \'ClassImplements\'; + type: 'ClassImplements'; _ClassImplements: void; id: Identifier; typeParameters: ?TypeParameterInstantiation; @@ -4437,7 +4439,7 @@ export type ClassImplements = { }; export type ClassProperty = { - type: \'ClassProperty\'; + type: 'ClassProperty'; _ClassProperty: void; computed: boolean; key: Node; @@ -4457,7 +4459,7 @@ export type ClassProperty = { }; export type DeclareClass = { - type: \'DeclareClass\'; + type: 'DeclareClass'; _DeclareClass: void; body: ObjectTypeAnnotation; extends: Array; @@ -4476,7 +4478,7 @@ export type DeclareClass = { // TODO: Make this correct. export type DeclareFunction = { - type: \'DeclareFunction\'; + type: 'DeclareFunction'; _DeclareFunction: void; id: Identifier; end: number; @@ -4491,7 +4493,7 @@ export type DeclareFunction = { }; export type DeclareModule = { - type: \'DeclareModule\'; + type: 'DeclareModule'; _DeclareModule: void; body: BlockStatement; id: Node; @@ -4508,7 +4510,7 @@ export type DeclareModule = { // TODO: Make this correct. export type DeclareVariable = { - type: \'DeclareVariable\'; + type: 'DeclareVariable'; _DeclareVariable: void; id: Identifier; end: number; @@ -4523,7 +4525,7 @@ export type DeclareVariable = { }; export type FunctionTypeAnnotation = { - type: \'FunctionTypeAnnotation\'; + type: 'FunctionTypeAnnotation'; _FunctionTypeAnnotation: void; params: Array; rest: ?FunctionTypeParam; @@ -4541,7 +4543,7 @@ export type FunctionTypeAnnotation = { }; export type FunctionTypeParam = { - type: \'FunctionTypeParam\'; + type: 'FunctionTypeParam'; _FunctionTypeParam: void; name: Identifier; optional: boolean; @@ -4558,7 +4560,7 @@ export type FunctionTypeParam = { }; export type GenericTypeAnnotation = { - type: \'GenericTypeAnnotation\'; + type: 'GenericTypeAnnotation'; _GenericTypeAnnotation: void; id: Node; typeParameters: ?TypeParameterInstantiation; @@ -4574,7 +4576,7 @@ export type GenericTypeAnnotation = { }; export type InterfaceExtends = { - type: \'InterfaceExtends\'; + type: 'InterfaceExtends'; _InterfaceExtends: void; id: Identifier; typeParameters: ?TypeParameterInstantiation; @@ -4590,7 +4592,7 @@ export type InterfaceExtends = { }; export type InterfaceDeclaration = { - type: \'InterfaceDeclaration\'; + type: 'InterfaceDeclaration'; _InterfaceDeclaration: void; body: ObjectTypeAnnotation; extends: Array; @@ -4608,7 +4610,7 @@ export type InterfaceDeclaration = { }; export type IntersectionTypeAnnotation = { - type: \'IntersectionTypeAnnotation\'; + type: 'IntersectionTypeAnnotation'; _IntersectionTypeAnnotation: void; types: Array; end: number; @@ -4623,7 +4625,7 @@ export type IntersectionTypeAnnotation = { }; export type MixedTypeAnnotation = { - type: \'MixedTypeAnnotation\'; + type: 'MixedTypeAnnotation'; _MixedTypeAnnotation: void; end: number; innerComments: ?Array; @@ -4637,7 +4639,7 @@ export type MixedTypeAnnotation = { }; export type NullableTypeAnnotation = { - type: \'NullableTypeAnnotation\'; + type: 'NullableTypeAnnotation'; _NullableTypeAnnotation: void; typeAnnotation: Type; end: number; @@ -4652,7 +4654,7 @@ export type NullableTypeAnnotation = { }; export type NumberLiteralTypeAnnotation = { - type: \'NumberLiteralTypeAnnotation\'; + type: 'NumberLiteralTypeAnnotation'; _NumberLiteralTypeAnnotation: void; raw: string; value: number; @@ -4668,7 +4670,7 @@ export type NumberLiteralTypeAnnotation = { }; export type NumberTypeAnnotation = { - type: \'NumberTypeAnnotation\'; + type: 'NumberTypeAnnotation'; _NumberTypeAnnotation: void; end: number; innerComments: ?Array; @@ -4682,7 +4684,7 @@ export type NumberTypeAnnotation = { }; export type StringLiteralTypeAnnotation = { - type: \'StringLiteralTypeAnnotation\'; + type: 'StringLiteralTypeAnnotation'; _StringLiteralTypeAnnotation: void; raw: string; value: string; @@ -4698,7 +4700,7 @@ export type StringLiteralTypeAnnotation = { }; export type StringTypeAnnotation = { - type: \'StringTypeAnnotation\'; + type: 'StringTypeAnnotation'; _StringTypeAnnotation: void; end: number; innerComments: ?Array; @@ -4712,7 +4714,7 @@ export type StringTypeAnnotation = { }; export type TupleTypeAnnotation = { - type: \'TupleTypeAnnotation\'; + type: 'TupleTypeAnnotation'; _TupleTypeAnnotation: void; types: Array; end: number; @@ -4727,7 +4729,7 @@ export type TupleTypeAnnotation = { }; export type TypeofTypeAnnotation = { - type: \'TypeofTypeAnnotation\'; + type: 'TypeofTypeAnnotation'; _TypeofTypeAnnotation: void; argument: Type; end: number; @@ -4742,7 +4744,7 @@ export type TypeofTypeAnnotation = { }; export type TypeAlias = { - type: \'TypeAlias\'; + type: 'TypeAlias'; _TypeAlias: void; id: Identifier; right: Type; @@ -4759,7 +4761,7 @@ export type TypeAlias = { }; export type TypeAnnotation = { - type: \'TypeAnnotation\'; + type: 'TypeAnnotation'; _TypeAnnotation: void; typeAnnotation: Type; end: number; @@ -4774,7 +4776,7 @@ export type TypeAnnotation = { }; export type TypeCastExpression = { - type: \'TypeCastExpression\'; + type: 'TypeCastExpression'; _TypeCastExpression: void; expression: Expression; typeAnnotation: TypeAnnotation; @@ -4790,7 +4792,7 @@ export type TypeCastExpression = { }; export type TypeParameterDeclaration = { - type: \'TypeParameterDeclaration\'; + type: 'TypeParameterDeclaration'; _TypeParameterDeclaration: void; params: Array; end: number; @@ -4805,7 +4807,7 @@ export type TypeParameterDeclaration = { }; export type TypeParameterInstantiation = { - type: \'TypeParameterInstantiation\'; + type: 'TypeParameterInstantiation'; _TypeParameterInstantiation: void; params: Array; end: number; @@ -4820,7 +4822,7 @@ export type TypeParameterInstantiation = { }; export type ObjectTypeAnnotation = { - type: \'ObjectTypeAnnotation\'; + type: 'ObjectTypeAnnotation'; _ObjectTypeAnnotation: void; callProperties: Array; indexers: Array; @@ -4837,7 +4839,7 @@ export type ObjectTypeAnnotation = { }; export type ObjectTypeCallProperty = { - type: \'ObjectTypeCallProperty\'; + type: 'ObjectTypeCallProperty'; _ObjectTypeCallProperty: void; static: boolean; value: FunctionTypeAnnotation; @@ -4853,7 +4855,7 @@ export type ObjectTypeCallProperty = { }; export type ObjectTypeIndexer = { - type: \'ObjectTypeIndexer\'; + type: 'ObjectTypeIndexer'; _ObjectTypeIndexer: void; id: Identifier; key: Type; @@ -4870,7 +4872,7 @@ export type ObjectTypeIndexer = { }; export type ObjectTypeProperty = { - type: \'ObjectTypeProperty\'; + type: 'ObjectTypeProperty'; _ObjectTypeProperty: void; key: Node; optional: boolean; @@ -4887,7 +4889,7 @@ export type ObjectTypeProperty = { }; export type QualifiedTypeIdentifier = { - type: \'QualifiedTypeIdentifier\'; + type: 'QualifiedTypeIdentifier'; _QualifiedTypeIdentifier: void; id: Identifier; qualification: Node; @@ -4903,7 +4905,7 @@ export type QualifiedTypeIdentifier = { }; export type UnionTypeAnnotation = { - type: \'UnionTypeAnnotation\'; + type: 'UnionTypeAnnotation'; _UnionTypeAnnotation: void; types: Array; end: number; @@ -4918,7 +4920,7 @@ export type UnionTypeAnnotation = { }; export type VoidTypeAnnotation = { - type: \'VoidTypeAnnotation\'; + type: 'VoidTypeAnnotation'; _VoidTypeAnnotation: void; end: number; innerComments: ?Array; @@ -4932,7 +4934,7 @@ export type VoidTypeAnnotation = { }; export type JSXAttribute = { - type: \'JSXAttribute\'; + type: 'JSXAttribute'; _JSXAttribute: void; name: Node; value: ?Node; @@ -4948,7 +4950,7 @@ export type JSXAttribute = { }; export type JSXClosingElement = { - type: \'JSXClosingElement\'; + type: 'JSXClosingElement'; _JSXClosingElement: void; name: Node; end: number; @@ -4963,7 +4965,7 @@ export type JSXClosingElement = { }; export type JSXElement = { - type: \'JSXElement\'; + type: 'JSXElement'; _JSXElement: void; children: Array; closingElement: ?JSXClosingElement; @@ -4980,7 +4982,7 @@ export type JSXElement = { }; export type JSXEmptyExpression = { - type: \'JSXEmptyExpression\'; + type: 'JSXEmptyExpression'; _JSXEmptyExpression: void; end: number; innerComments: ?Array; @@ -4994,7 +4996,7 @@ export type JSXEmptyExpression = { }; export type JSXExpressionContainer = { - type: \'JSXExpressionContainer\'; + type: 'JSXExpressionContainer'; _JSXExpressionContainer: void; expression: Expression; end: number; @@ -5009,7 +5011,7 @@ export type JSXExpressionContainer = { }; export type JSXIdentifier = { - type: \'JSXIdentifier\'; + type: 'JSXIdentifier'; _JSXIdentifier: void; name: string; end: number; @@ -5024,7 +5026,7 @@ export type JSXIdentifier = { }; export type JSXMemberExpression = { - type: \'JSXMemberExpression\'; + type: 'JSXMemberExpression'; _JSXMemberExpression: void; computed: boolean; object: Node; @@ -5041,7 +5043,7 @@ export type JSXMemberExpression = { }; export type JSXNamespacedName = { - type: \'JSXNamespacedName\'; + type: 'JSXNamespacedName'; _JSXNamespacedName: void; name: JSXIdentifier; namespace: JSXIdentifier; @@ -5057,7 +5059,7 @@ export type JSXNamespacedName = { }; export type JSXOpeningElement = { - type: \'JSXOpeningElement\'; + type: 'JSXOpeningElement'; _JSXOpeningElement: void; attributes: Array; name: Array; @@ -5074,7 +5076,7 @@ export type JSXOpeningElement = { }; export type JSXSpreadAttribute = { - type: \'JSXSpreadAttribute\'; + type: 'JSXSpreadAttribute'; _JSXSpreadAttribute: void; argument: Expression; end: number; @@ -5092,7 +5094,7 @@ export type JSXSpreadAttribute = { * @flow */ -\"use strict\"; +\\"use strict\\"; /* * Flow types for the Babylon AST. @@ -5102,7 +5104,7 @@ export type JSXSpreadAttribute = { export type Comment = | { - type: \"CommentLine\", + type: \\"CommentLine\\", _CommentLine: void, value: string, end: number, @@ -5113,7 +5115,7 @@ export type Comment = start: number } | { - type: \"CommentBlock\", + type: \\"CommentBlock\\", _CommentBlock: void, value: string, end: number, @@ -5126,7 +5128,7 @@ export type Comment = export type Declaration = | { - type: \"ClassBody\", + type: \\"ClassBody\\", _ClassBody: void, body: Array, end: number, @@ -5140,7 +5142,7 @@ export type Declaration = trailingComments: ?Array } | { - type: \"ClassDeclaration\", + type: \\"ClassDeclaration\\", _ClassDeclaration: void, body: ClassBody, id: ?Identifier, @@ -5159,7 +5161,7 @@ export type Declaration = trailingComments: ?Array } | { - type: \"FunctionDeclaration\", + type: \\"FunctionDeclaration\\", _FunctionDeclaration: void, body: BlockStatement, id: Identifier, @@ -5182,11 +5184,11 @@ export type Declaration = typeParameters: ?TypeParameterDeclaration } | { - type: \"MethodDefinition\", + type: \\"MethodDefinition\\", _MethodDefinition: void, computed: boolean, key: Node, - kind: \"constructor\" | \"method\" | \"get\" | \"set\", + kind: \\"constructor\\" | \\"method\\" | \\"get\\" | \\"set\\", static: boolean, value: FunctionExpression, decorators: ?Array, @@ -5201,10 +5203,10 @@ export type Declaration = trailingComments: ?Array } | { - type: \"VariableDeclaration\", + type: \\"VariableDeclaration\\", _VariableDeclaration: void, declarations: Array, - kind: \"var\" | \"let\" | \"const\", + kind: \\"var\\" | \\"let\\" | \\"const\\", end: number, innerComments: ?Array, leadingComments: ?Array, @@ -5216,7 +5218,7 @@ export type Declaration = trailingComments: ?Array } | { - type: \"ClassProperty\", + type: \\"ClassProperty\\", _ClassProperty: void, computed: boolean, key: Node, @@ -5237,7 +5239,7 @@ export type Declaration = export type Expression = | { - type: \"ArrayExpression\", + type: \\"ArrayExpression\\", _ArrayExpression: void, elements: Array, end: number, @@ -5251,7 +5253,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"AssignmentExpression\", + type: \\"AssignmentExpression\\", _AssignmentExpression: void, left: Pattern, operator: AssignmentOperator, @@ -5267,7 +5269,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"AwaitExpression\", + type: \\"AwaitExpression\\", _AwaitExpression: void, all: boolean, argument: ?Expression, @@ -5282,7 +5284,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"BinaryExpression\", + type: \\"BinaryExpression\\", _BinaryExpression: void, left: Expression, operator: BinaryOperator, @@ -5298,7 +5300,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"BindExpression\", + type: \\"BindExpression\\", _BindExpression: void, callee: Node, object: Node, @@ -5313,7 +5315,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"CallExpression\", + type: \\"CallExpression\\", _CallExpression: void, arguments: Array, callee: Expression, @@ -5328,7 +5330,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"ClassExpression\", + type: \\"ClassExpression\\", _ClassExpression: void, body: ClassBody, id: ?Identifier, @@ -5347,7 +5349,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"ComprehensionExpression\", + type: \\"ComprehensionExpression\\", _ComprehensionExpression: void, body: Expression, blocks: Array, @@ -5363,7 +5365,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"ConditionalExpression\", + type: \\"ConditionalExpression\\", _ConditionalExpression: void, alternate: Expression, consequent: Expression, @@ -5379,7 +5381,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"DoExpression\", + type: \\"DoExpression\\", _DoExpression: void, body: Statement, end: number, @@ -5393,7 +5395,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"FunctionExpression\", + type: \\"FunctionExpression\\", _FunctionExpression: void, body: BlockStatement, id: ?Identifier, @@ -5416,7 +5418,7 @@ export type Expression = typeParameters: ?TypeParameterDeclaration } | { - type: \"Identifier\", + type: \\"Identifier\\", _Identifier: void, name: string, typeAnnotation: ?TypeAnnotation, @@ -5431,7 +5433,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"Literal\", + type: \\"Literal\\", _Literal: void, raw: string, regex: ?{ pattern: string, flags: string }, @@ -5447,7 +5449,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"LogicalExpression\", + type: \\"LogicalExpression\\", _LogicalExpression: void, left: Expression, operator: LogicalOperator, @@ -5463,7 +5465,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"MemberExpression\", + type: \\"MemberExpression\\", _MemberExpression: void, computed: boolean, object: Expression, @@ -5479,7 +5481,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"NewExpression\", + type: \\"NewExpression\\", _NewExpression: void, arguments: Array, callee: Expression, @@ -5494,7 +5496,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"ObjectExpression\", + type: \\"ObjectExpression\\", _ObjectExpression: void, properties: Array, end: number, @@ -5508,7 +5510,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"SequenceExpression\", + type: \\"SequenceExpression\\", _SequenceExpression: void, expression: Array, end: number, @@ -5522,7 +5524,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"TaggedTemplateExpression\", + type: \\"TaggedTemplateExpression\\", _TaggedTemplateExpression: void, quasi: TemplateLiteral, tag: Expression, @@ -5537,7 +5539,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"TemplateLiteral\", + type: \\"TemplateLiteral\\", _TemplateLiteral: void, expressions: Array, quasis: Array, @@ -5552,7 +5554,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"ThisExpression\", + type: \\"ThisExpression\\", _ThisExpression: void, end: number, innerComments: ?Array, @@ -5565,7 +5567,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"UnaryExpression\", + type: \\"UnaryExpression\\", _UnaryExpression: void, argument: Expression, operator: UnaryOperator, @@ -5581,7 +5583,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"UpdateExpression\", + type: \\"UpdateExpression\\", _UpdateExpression: void, argument: Expression, operator: UpdateOperator, @@ -5597,7 +5599,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"YieldExpression\", + type: \\"YieldExpression\\", _YieldExpression: void, argument: ?Expression, delegate: boolean, @@ -5612,7 +5614,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"TypeCastExpression\", + type: \\"TypeCastExpression\\", _TypeCastExpression: void, expression: Expression, typeAnnotation: TypeAnnotation, @@ -5627,7 +5629,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"JSXElement\", + type: \\"JSXElement\\", _JSXElement: void, children: Array, closingElement: ?JSXClosingElement, @@ -5643,7 +5645,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"JSXEmptyExpression\", + type: \\"JSXEmptyExpression\\", _JSXEmptyExpression: void, end: number, innerComments: ?Array, @@ -5656,7 +5658,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"JSXExpressionContainer\", + type: \\"JSXExpressionContainer\\", _JSXExpressionContainer: void, expression: Expression, end: number, @@ -5670,7 +5672,7 @@ export type Expression = trailingComments: ?Array } | { - type: \"JSXMemberExpression\", + type: \\"JSXMemberExpression\\", _JSXMemberExpression: void, computed: boolean, object: Node, @@ -5688,7 +5690,7 @@ export type Expression = export type Function = | { - type: \"ArrowFunctionExpression\", + type: \\"ArrowFunctionExpression\\", _ArrowFunctionExpression: void, body: Node, id: ?Identifier, @@ -5711,7 +5713,7 @@ export type Function = typeParameters: ?TypeParameterDeclaration } | { - type: \"FunctionDeclaration\", + type: \\"FunctionDeclaration\\", _FunctionDeclaration: void, body: BlockStatement, id: Identifier, @@ -5734,7 +5736,7 @@ export type Function = typeParameters: ?TypeParameterDeclaration } | { - type: \"FunctionExpression\", + type: \\"FunctionExpression\\", _FunctionExpression: void, body: BlockStatement, id: ?Identifier, @@ -5759,7 +5761,7 @@ export type Function = export type Node = | { - type: \"ArrayExpression\", + type: \\"ArrayExpression\\", _ArrayExpression: void, elements: Array, end: number, @@ -5773,7 +5775,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ArrayPattern\", + type: \\"ArrayPattern\\", _ArrayPattern: void, elements: Array, typeAnnotation: ?TypeAnnotation, @@ -5788,7 +5790,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ArrowFunctionExpression\", + type: \\"ArrowFunctionExpression\\", _ArrowFunctionExpression: void, body: Node, id: ?Identifier, @@ -5811,7 +5813,7 @@ export type Node = typeParameters: ?TypeParameterDeclaration } | { - type: \"AssignmentExpression\", + type: \\"AssignmentExpression\\", _AssignmentExpression: void, left: Pattern, operator: AssignmentOperator, @@ -5827,7 +5829,7 @@ export type Node = trailingComments: ?Array } | { - type: \"AssignmentPattern\", + type: \\"AssignmentPattern\\", _AssignmentPattern: void, left: Pattern, right: Expression, @@ -5842,7 +5844,7 @@ export type Node = trailingComments: ?Array } | { - type: \"AwaitExpression\", + type: \\"AwaitExpression\\", _AwaitExpression: void, all: boolean, argument: ?Expression, @@ -5857,7 +5859,7 @@ export type Node = trailingComments: ?Array } | { - type: \"BinaryExpression\", + type: \\"BinaryExpression\\", _BinaryExpression: void, left: Expression, operator: BinaryOperator, @@ -5873,7 +5875,7 @@ export type Node = trailingComments: ?Array } | { - type: \"BindExpression\", + type: \\"BindExpression\\", _BindExpression: void, callee: Node, object: Node, @@ -5888,7 +5890,7 @@ export type Node = trailingComments: ?Array } | { - type: \"BlockStatement\", + type: \\"BlockStatement\\", _BlockStatement: void, body: Array, end: number, @@ -5902,7 +5904,7 @@ export type Node = trailingComments: ?Array } | { - type: \"BreakStatement\", + type: \\"BreakStatement\\", _BreakStatement: void, label: ?Identifier, end: number, @@ -5916,7 +5918,7 @@ export type Node = trailingComments: ?Array } | { - type: \"CallExpression\", + type: \\"CallExpression\\", _CallExpression: void, arguments: Array, callee: Expression, @@ -5931,7 +5933,7 @@ export type Node = trailingComments: ?Array } | { - type: \"CatchClause\", + type: \\"CatchClause\\", _CatchClause: void, body: BlockStatement, param: Pattern, @@ -5946,7 +5948,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ClassBody\", + type: \\"ClassBody\\", _ClassBody: void, body: Array, end: number, @@ -5960,7 +5962,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ClassDeclaration\", + type: \\"ClassDeclaration\\", _ClassDeclaration: void, body: ClassBody, id: ?Identifier, @@ -5979,7 +5981,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ClassExpression\", + type: \\"ClassExpression\\", _ClassExpression: void, body: ClassBody, id: ?Identifier, @@ -5998,7 +6000,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ComprehensionBlock\", + type: \\"ComprehensionBlock\\", _ComprehensionBlock: void, each: boolean, left: Pattern, @@ -6014,7 +6016,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ComprehensionExpression\", + type: \\"ComprehensionExpression\\", _ComprehensionExpression: void, body: Expression, blocks: Array, @@ -6030,7 +6032,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ConditionalExpression\", + type: \\"ConditionalExpression\\", _ConditionalExpression: void, alternate: Expression, consequent: Expression, @@ -6046,7 +6048,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ContinueStatement\", + type: \\"ContinueStatement\\", _ContinueStatement: void, label: ?Identifier, end: number, @@ -6060,7 +6062,7 @@ export type Node = trailingComments: ?Array } | { - type: \"Decorator\", + type: \\"Decorator\\", _Decorator: void, expression: Expression, end: number, @@ -6074,7 +6076,7 @@ export type Node = trailingComments: ?Array } | { - type: \"DebuggerStatement\", + type: \\"DebuggerStatement\\", _DebuggerStatement: void, end: number, innerComments: ?Array, @@ -6087,7 +6089,7 @@ export type Node = trailingComments: ?Array } | { - type: \"DoWhileStatement\", + type: \\"DoWhileStatement\\", _DoWhileStatement: void, body: Statement, test: Expression, @@ -6102,7 +6104,7 @@ export type Node = trailingComments: ?Array } | { - type: \"DoExpression\", + type: \\"DoExpression\\", _DoExpression: void, body: Statement, end: number, @@ -6116,7 +6118,7 @@ export type Node = trailingComments: ?Array } | { - type: \"EmptyStatement\", + type: \\"EmptyStatement\\", _EmptyStatement: void, end: number, innerComments: ?Array, @@ -6129,7 +6131,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ExpressionStatement\", + type: \\"ExpressionStatement\\", _ExpressionStatement: void, expression: Expression, end: number, @@ -6143,7 +6145,7 @@ export type Node = trailingComments: ?Array } | { - type: \"File\", + type: \\"File\\", _File: void, program: Program, end: number, @@ -6157,7 +6159,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ForInStatement\", + type: \\"ForInStatement\\", _ForInStatement: void, body: Statement, left: Node, @@ -6173,7 +6175,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ForOfStatement\", + type: \\"ForOfStatement\\", _ForOfStatement: void, body: Statement, left: Node, @@ -6189,7 +6191,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ForStatement\", + type: \\"ForStatement\\", _ForStatement: void, init: ?Node, test: ?Expression, @@ -6206,7 +6208,7 @@ export type Node = trailingComments: ?Array } | { - type: \"FunctionDeclaration\", + type: \\"FunctionDeclaration\\", _FunctionDeclaration: void, body: BlockStatement, id: Identifier, @@ -6229,7 +6231,7 @@ export type Node = typeParameters: ?TypeParameterDeclaration } | { - type: \"FunctionExpression\", + type: \\"FunctionExpression\\", _FunctionExpression: void, body: BlockStatement, id: ?Identifier, @@ -6252,7 +6254,7 @@ export type Node = typeParameters: ?TypeParameterDeclaration } | { - type: \"Identifier\", + type: \\"Identifier\\", _Identifier: void, name: string, typeAnnotation: ?TypeAnnotation, @@ -6267,7 +6269,7 @@ export type Node = trailingComments: ?Array } | { - type: \"IfStatement\", + type: \\"IfStatement\\", _IfStatement: void, alternate: ?Statement, consequent: Statement, @@ -6283,7 +6285,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ImportDefaultSpecifier\", + type: \\"ImportDefaultSpecifier\\", _ImportDefaultSpecifier: void, local: Node, end: number, @@ -6297,7 +6299,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ImportNamespaceSpecifier\", + type: \\"ImportNamespaceSpecifier\\", _ImportNamespaceSpecifier: void, local: Node, end: number, @@ -6311,7 +6313,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ImportDeclaration\", + type: \\"ImportDeclaration\\", _ImportDeclaration: void, specifiers: Array, source: Literal, @@ -6326,7 +6328,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ImportSpecifier\", + type: \\"ImportSpecifier\\", _ImportSpecifier: void, imported: Node, local: Node, @@ -6341,7 +6343,7 @@ export type Node = trailingComments: ?Array } | { - type: \"LabeledStatement\", + type: \\"LabeledStatement\\", _LabeledStatement: void, body: Statement, label: Identifier, @@ -6356,7 +6358,7 @@ export type Node = trailingComments: ?Array } | { - type: \"Literal\", + type: \\"Literal\\", _Literal: void, raw: string, regex: ?{ pattern: string, flags: string }, @@ -6372,7 +6374,7 @@ export type Node = trailingComments: ?Array } | { - type: \"LogicalExpression\", + type: \\"LogicalExpression\\", _LogicalExpression: void, left: Expression, operator: LogicalOperator, @@ -6388,7 +6390,7 @@ export type Node = trailingComments: ?Array } | { - type: \"MemberExpression\", + type: \\"MemberExpression\\", _MemberExpression: void, computed: boolean, object: Expression, @@ -6404,7 +6406,7 @@ export type Node = trailingComments: ?Array } | { - type: \"MetaProperty\", + type: \\"MetaProperty\\", _MetaProperty: void, meta: Node, property: Node, @@ -6419,11 +6421,11 @@ export type Node = trailingComments: ?Array } | { - type: \"MethodDefinition\", + type: \\"MethodDefinition\\", _MethodDefinition: void, computed: boolean, key: Node, - kind: \"constructor\" | \"method\" | \"get\" | \"set\", + kind: \\"constructor\\" | \\"method\\" | \\"get\\" | \\"set\\", static: boolean, value: FunctionExpression, decorators: ?Array, @@ -6438,7 +6440,7 @@ export type Node = trailingComments: ?Array } | { - type: \"NewExpression\", + type: \\"NewExpression\\", _NewExpression: void, arguments: Array, callee: Expression, @@ -6453,7 +6455,7 @@ export type Node = trailingComments: ?Array } | { - type: \"Noop\", + type: \\"Noop\\", _Noop: void, end: number, innerComments: ?Array, @@ -6466,7 +6468,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ObjectExpression\", + type: \\"ObjectExpression\\", _ObjectExpression: void, properties: Array, end: number, @@ -6480,7 +6482,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ObjectPattern\", + type: \\"ObjectPattern\\", _ObjectPattern: void, properties: Array, typeAnnotation: ?TypeAnnotation, @@ -6495,7 +6497,7 @@ export type Node = trailingComments: ?Array } | { - type: \"Program\", + type: \\"Program\\", _Program: void, body: Array, end: number, @@ -6509,11 +6511,11 @@ export type Node = trailingComments: ?Array } | { - type: \"Property\", + type: \\"Property\\", _Property: void, computed: boolean, key: Node, - kind: \"init\" | \"get\" | \"set\", + kind: \\"init\\" | \\"get\\" | \\"set\\", method: boolean, shorthand: boolean, value: Node, @@ -6529,7 +6531,7 @@ export type Node = trailingComments: ?Array } | { - type: \"RestElement\", + type: \\"RestElement\\", _RestElement: void, argument: Pattern, typeAnnotation: ?TypeAnnotation, @@ -6544,7 +6546,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ReturnStatement\", + type: \\"ReturnStatement\\", _ReturnStatement: void, argument: ?Expression, end: number, @@ -6558,7 +6560,7 @@ export type Node = trailingComments: ?Array } | { - type: \"SequenceExpression\", + type: \\"SequenceExpression\\", _SequenceExpression: void, expression: Array, end: number, @@ -6572,7 +6574,7 @@ export type Node = trailingComments: ?Array } | { - type: \"SpreadElement\", + type: \\"SpreadElement\\", _SpreadElement: void, argument: Expression, end: number, @@ -6586,7 +6588,7 @@ export type Node = trailingComments: ?Array } | { - type: \"SpreadProperty\", + type: \\"SpreadProperty\\", _SpreadProperty: void, argument: Expression, end: number, @@ -6600,7 +6602,7 @@ export type Node = trailingComments: ?Array } | { - type: \"Super\", + type: \\"Super\\", _Super: void, end: number, innerComments: ?Array, @@ -6613,7 +6615,7 @@ export type Node = trailingComments: ?Array } | { - type: \"SwitchCase\", + type: \\"SwitchCase\\", _SwitchCase: void, consequent: Array, test: ?Expression, @@ -6628,7 +6630,7 @@ export type Node = trailingComments: ?Array } | { - type: \"SwitchStatement\", + type: \\"SwitchStatement\\", _SwitchStatement: void, cases: Array, discriminant: Expression, @@ -6644,7 +6646,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TaggedTemplateExpression\", + type: \\"TaggedTemplateExpression\\", _TaggedTemplateExpression: void, quasi: TemplateLiteral, tag: Expression, @@ -6659,7 +6661,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TemplateElement\", + type: \\"TemplateElement\\", _TemplateElement: void, tail: boolean, value: { cooked: string, raw: string }, @@ -6674,7 +6676,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TemplateLiteral\", + type: \\"TemplateLiteral\\", _TemplateLiteral: void, expressions: Array, quasis: Array, @@ -6689,7 +6691,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ThisExpression\", + type: \\"ThisExpression\\", _ThisExpression: void, end: number, innerComments: ?Array, @@ -6702,7 +6704,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ThrowStatement\", + type: \\"ThrowStatement\\", _ThrowStatement: void, argument: Expression, end: number, @@ -6716,7 +6718,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TryStatement\", + type: \\"TryStatement\\", _TryStatement: void, block: BlockStatement, finalizer: ?BlockStatement, @@ -6734,7 +6736,7 @@ export type Node = trailingComments: ?Array } | { - type: \"UnaryExpression\", + type: \\"UnaryExpression\\", _UnaryExpression: void, argument: Expression, operator: UnaryOperator, @@ -6750,7 +6752,7 @@ export type Node = trailingComments: ?Array } | { - type: \"UpdateExpression\", + type: \\"UpdateExpression\\", _UpdateExpression: void, argument: Expression, operator: UpdateOperator, @@ -6766,10 +6768,10 @@ export type Node = trailingComments: ?Array } | { - type: \"VariableDeclaration\", + type: \\"VariableDeclaration\\", _VariableDeclaration: void, declarations: Array, - kind: \"var\" | \"let\" | \"const\", + kind: \\"var\\" | \\"let\\" | \\"const\\", end: number, innerComments: ?Array, leadingComments: ?Array, @@ -6781,7 +6783,7 @@ export type Node = trailingComments: ?Array } | { - type: \"VariableDeclarator\", + type: \\"VariableDeclarator\\", _VariableDeclarator: void, id: Pattern, init: ?Expression, @@ -6796,7 +6798,7 @@ export type Node = trailingComments: ?Array } | { - type: \"WhileStatement\", + type: \\"WhileStatement\\", _WhileStatement: void, body: Statement, test: Expression, @@ -6811,7 +6813,7 @@ export type Node = trailingComments: ?Array } | { - type: \"WithStatement\", + type: \\"WithStatement\\", _WithStatement: void, body: Statement, object: Expression, @@ -6826,7 +6828,7 @@ export type Node = trailingComments: ?Array } | { - type: \"YieldExpression\", + type: \\"YieldExpression\\", _YieldExpression: void, argument: ?Expression, delegate: boolean, @@ -6841,7 +6843,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ExportAllDeclaration\", + type: \\"ExportAllDeclaration\\", _ExportAllDeclaration: void, exported: Node, source: Node, @@ -6856,7 +6858,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ExportDefaultDeclaration\", + type: \\"ExportDefaultDeclaration\\", _ExportDefaultDeclaration: void, declaration: Node, end: number, @@ -6870,7 +6872,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ExportNamedDeclaration\", + type: \\"ExportNamedDeclaration\\", _ExportNamedDeclaration: void, declaration: Node, source: Literal, @@ -6886,7 +6888,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ExportDefaultSpecifier\", + type: \\"ExportDefaultSpecifier\\", _ExportDefaultSpecifier: void, exported: Node, end: number, @@ -6900,7 +6902,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ExportNamespaceSpecifier\", + type: \\"ExportNamespaceSpecifier\\", _ExportNamespaceSpecifier: void, exported: Node, end: number, @@ -6914,7 +6916,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ExportSpecifier\", + type: \\"ExportSpecifier\\", _ExportSpecifier: void, local: Node, exported: Node, @@ -6929,7 +6931,7 @@ export type Node = trailingComments: ?Array } | { - type: \"AnyTypeAnnotation\", + type: \\"AnyTypeAnnotation\\", _AnyTypeAnnotation: void, end: number, innerComments: ?Array, @@ -6942,7 +6944,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ArrayTypeAnnotation\", + type: \\"ArrayTypeAnnotation\\", _ArrayTypeAnnotation: void, elementType: Type, end: number, @@ -6956,7 +6958,7 @@ export type Node = trailingComments: ?Array } | { - type: \"BooleanLiteralTypeAnnotation\", + type: \\"BooleanLiteralTypeAnnotation\\", _BooleanLiteralTypeAnnotation: void, raw: string, value: boolean, @@ -6971,7 +6973,7 @@ export type Node = trailingComments: ?Array } | { - type: \"BooleanTypeAnnotation\", + type: \\"BooleanTypeAnnotation\\", _BooleanTypeAnnotation: void, end: number, innerComments: ?Array, @@ -6984,7 +6986,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ClassImplements\", + type: \\"ClassImplements\\", _ClassImplements: void, id: Identifier, typeParameters: ?TypeParameterInstantiation, @@ -7000,7 +7002,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ClassProperty\", + type: \\"ClassProperty\\", _ClassProperty: void, computed: boolean, key: Node, @@ -7019,7 +7021,7 @@ export type Node = trailingComments: ?Array } | { - type: \"DeclareClass\", + type: \\"DeclareClass\\", _DeclareClass: void, body: ObjectTypeAnnotation, extends: Array, @@ -7036,7 +7038,7 @@ export type Node = trailingComments: ?Array } | { - type: \"DeclareFunction\", + type: \\"DeclareFunction\\", _DeclareFunction: void, id: Identifier, end: number, @@ -7050,7 +7052,7 @@ export type Node = trailingComments: ?Array } | { - type: \"DeclareModule\", + type: \\"DeclareModule\\", _DeclareModule: void, body: BlockStatement, id: Node, @@ -7065,7 +7067,7 @@ export type Node = trailingComments: ?Array } | { - type: \"DeclareVariable\", + type: \\"DeclareVariable\\", _DeclareVariable: void, id: Identifier, end: number, @@ -7079,7 +7081,7 @@ export type Node = trailingComments: ?Array } | { - type: \"FunctionTypeAnnotation\", + type: \\"FunctionTypeAnnotation\\", _FunctionTypeAnnotation: void, params: Array, rest: ?FunctionTypeParam, @@ -7096,7 +7098,7 @@ export type Node = trailingComments: ?Array } | { - type: \"FunctionTypeParam\", + type: \\"FunctionTypeParam\\", _FunctionTypeParam: void, name: Identifier, optional: boolean, @@ -7112,7 +7114,7 @@ export type Node = trailingComments: ?Array } | { - type: \"GenericTypeAnnotation\", + type: \\"GenericTypeAnnotation\\", _GenericTypeAnnotation: void, id: Node, typeParameters: ?TypeParameterInstantiation, @@ -7127,7 +7129,7 @@ export type Node = trailingComments: ?Array } | { - type: \"InterfaceExtends\", + type: \\"InterfaceExtends\\", _InterfaceExtends: void, id: Identifier, typeParameters: ?TypeParameterInstantiation, @@ -7142,7 +7144,7 @@ export type Node = trailingComments: ?Array } | { - type: \"InterfaceDeclaration\", + type: \\"InterfaceDeclaration\\", _InterfaceDeclaration: void, body: ObjectTypeAnnotation, extends: Array, @@ -7159,7 +7161,7 @@ export type Node = trailingComments: ?Array } | { - type: \"IntersectionTypeAnnotation\", + type: \\"IntersectionTypeAnnotation\\", _IntersectionTypeAnnotation: void, types: Array, end: number, @@ -7173,7 +7175,7 @@ export type Node = trailingComments: ?Array } | { - type: \"MixedTypeAnnotation\", + type: \\"MixedTypeAnnotation\\", _MixedTypeAnnotation: void, end: number, innerComments: ?Array, @@ -7186,7 +7188,7 @@ export type Node = trailingComments: ?Array } | { - type: \"NullableTypeAnnotation\", + type: \\"NullableTypeAnnotation\\", _NullableTypeAnnotation: void, typeAnnotation: Type, end: number, @@ -7200,7 +7202,7 @@ export type Node = trailingComments: ?Array } | { - type: \"NumberLiteralTypeAnnotation\", + type: \\"NumberLiteralTypeAnnotation\\", _NumberLiteralTypeAnnotation: void, raw: string, value: number, @@ -7215,7 +7217,7 @@ export type Node = trailingComments: ?Array } | { - type: \"NumberTypeAnnotation\", + type: \\"NumberTypeAnnotation\\", _NumberTypeAnnotation: void, end: number, innerComments: ?Array, @@ -7228,7 +7230,7 @@ export type Node = trailingComments: ?Array } | { - type: \"StringLiteralTypeAnnotation\", + type: \\"StringLiteralTypeAnnotation\\", _StringLiteralTypeAnnotation: void, raw: string, value: string, @@ -7243,7 +7245,7 @@ export type Node = trailingComments: ?Array } | { - type: \"StringTypeAnnotation\", + type: \\"StringTypeAnnotation\\", _StringTypeAnnotation: void, end: number, innerComments: ?Array, @@ -7256,7 +7258,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TupleTypeAnnotation\", + type: \\"TupleTypeAnnotation\\", _TupleTypeAnnotation: void, types: Array, end: number, @@ -7270,7 +7272,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TypeofTypeAnnotation\", + type: \\"TypeofTypeAnnotation\\", _TypeofTypeAnnotation: void, argument: Type, end: number, @@ -7284,7 +7286,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TypeAlias\", + type: \\"TypeAlias\\", _TypeAlias: void, id: Identifier, right: Type, @@ -7300,7 +7302,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TypeAnnotation\", + type: \\"TypeAnnotation\\", _TypeAnnotation: void, typeAnnotation: Type, end: number, @@ -7314,7 +7316,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TypeCastExpression\", + type: \\"TypeCastExpression\\", _TypeCastExpression: void, expression: Expression, typeAnnotation: TypeAnnotation, @@ -7329,7 +7331,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TypeParameterDeclaration\", + type: \\"TypeParameterDeclaration\\", _TypeParameterDeclaration: void, params: Array, end: number, @@ -7343,7 +7345,7 @@ export type Node = trailingComments: ?Array } | { - type: \"TypeParameterInstantiation\", + type: \\"TypeParameterInstantiation\\", _TypeParameterInstantiation: void, params: Array, end: number, @@ -7357,7 +7359,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ObjectTypeAnnotation\", + type: \\"ObjectTypeAnnotation\\", _ObjectTypeAnnotation: void, callProperties: Array, indexers: Array, @@ -7373,7 +7375,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ObjectTypeCallProperty\", + type: \\"ObjectTypeCallProperty\\", _ObjectTypeCallProperty: void, static: boolean, value: FunctionTypeAnnotation, @@ -7388,7 +7390,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ObjectTypeIndexer\", + type: \\"ObjectTypeIndexer\\", _ObjectTypeIndexer: void, id: Identifier, key: Type, @@ -7404,7 +7406,7 @@ export type Node = trailingComments: ?Array } | { - type: \"ObjectTypeProperty\", + type: \\"ObjectTypeProperty\\", _ObjectTypeProperty: void, key: Node, optional: boolean, @@ -7420,7 +7422,7 @@ export type Node = trailingComments: ?Array } | { - type: \"QualifiedTypeIdentifier\", + type: \\"QualifiedTypeIdentifier\\", _QualifiedTypeIdentifier: void, id: Identifier, qualification: Node, @@ -7435,7 +7437,7 @@ export type Node = trailingComments: ?Array } | { - type: \"UnionTypeAnnotation\", + type: \\"UnionTypeAnnotation\\", _UnionTypeAnnotation: void, types: Array, end: number, @@ -7449,7 +7451,7 @@ export type Node = trailingComments: ?Array } | { - type: \"VoidTypeAnnotation\", + type: \\"VoidTypeAnnotation\\", _VoidTypeAnnotation: void, end: number, innerComments: ?Array, @@ -7462,7 +7464,7 @@ export type Node = trailingComments: ?Array } | { - type: \"JSXAttribute\", + type: \\"JSXAttribute\\", _JSXAttribute: void, name: Node, value: ?Node, @@ -7477,7 +7479,7 @@ export type Node = trailingComments: ?Array } | { - type: \"JSXClosingElement\", + type: \\"JSXClosingElement\\", _JSXClosingElement: void, name: Node, end: number, @@ -7491,7 +7493,7 @@ export type Node = trailingComments: ?Array } | { - type: \"JSXElement\", + type: \\"JSXElement\\", _JSXElement: void, children: Array, closingElement: ?JSXClosingElement, @@ -7507,7 +7509,7 @@ export type Node = trailingComments: ?Array } | { - type: \"JSXEmptyExpression\", + type: \\"JSXEmptyExpression\\", _JSXEmptyExpression: void, end: number, innerComments: ?Array, @@ -7520,7 +7522,7 @@ export type Node = trailingComments: ?Array } | { - type: \"JSXExpressionContainer\", + type: \\"JSXExpressionContainer\\", _JSXExpressionContainer: void, expression: Expression, end: number, @@ -7534,7 +7536,7 @@ export type Node = trailingComments: ?Array } | { - type: \"JSXIdentifier\", + type: \\"JSXIdentifier\\", _JSXIdentifier: void, name: string, end: number, @@ -7548,7 +7550,7 @@ export type Node = trailingComments: ?Array } | { - type: \"JSXMemberExpression\", + type: \\"JSXMemberExpression\\", _JSXMemberExpression: void, computed: boolean, object: Node, @@ -7564,7 +7566,7 @@ export type Node = trailingComments: ?Array } | { - type: \"JSXNamespacedName\", + type: \\"JSXNamespacedName\\", _JSXNamespacedName: void, name: JSXIdentifier, namespace: JSXIdentifier, @@ -7579,7 +7581,7 @@ export type Node = trailingComments: ?Array } | { - type: \"JSXOpeningElement\", + type: \\"JSXOpeningElement\\", _JSXOpeningElement: void, attributes: Array, name: Array, @@ -7595,7 +7597,7 @@ export type Node = trailingComments: ?Array } | { - type: \"JSXSpreadAttribute\", + type: \\"JSXSpreadAttribute\\", _JSXSpreadAttribute: void, argument: Expression, end: number, @@ -7611,7 +7613,7 @@ export type Node = export type Pattern = | { - type: \"ArrayPattern\", + type: \\"ArrayPattern\\", _ArrayPattern: void, elements: Array, typeAnnotation: ?TypeAnnotation, @@ -7626,7 +7628,7 @@ export type Pattern = trailingComments: ?Array } | { - type: \"AssignmentPattern\", + type: \\"AssignmentPattern\\", _AssignmentPattern: void, left: Pattern, right: Expression, @@ -7641,7 +7643,7 @@ export type Pattern = trailingComments: ?Array } | { - type: \"Identifier\", + type: \\"Identifier\\", _Identifier: void, name: string, typeAnnotation: ?TypeAnnotation, @@ -7656,7 +7658,7 @@ export type Pattern = trailingComments: ?Array } | { - type: \"ObjectPattern\", + type: \\"ObjectPattern\\", _ObjectPattern: void, properties: Array, typeAnnotation: ?TypeAnnotation, @@ -7671,7 +7673,7 @@ export type Pattern = trailingComments: ?Array } | { - type: \"RestElement\", + type: \\"RestElement\\", _RestElement: void, argument: Pattern, typeAnnotation: ?TypeAnnotation, @@ -7688,7 +7690,7 @@ export type Pattern = export type Statement = | { - type: \"BlockStatement\", + type: \\"BlockStatement\\", _BlockStatement: void, body: Array, end: number, @@ -7702,7 +7704,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"BreakStatement\", + type: \\"BreakStatement\\", _BreakStatement: void, label: ?Identifier, end: number, @@ -7716,7 +7718,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"ContinueStatement\", + type: \\"ContinueStatement\\", _ContinueStatement: void, label: ?Identifier, end: number, @@ -7730,7 +7732,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"DoWhileStatement\", + type: \\"DoWhileStatement\\", _DoWhileStatement: void, body: Statement, test: Expression, @@ -7745,7 +7747,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"EmptyStatement\", + type: \\"EmptyStatement\\", _EmptyStatement: void, end: number, innerComments: ?Array, @@ -7758,7 +7760,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"ExpressionStatement\", + type: \\"ExpressionStatement\\", _ExpressionStatement: void, expression: Expression, end: number, @@ -7772,7 +7774,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"ForInStatement\", + type: \\"ForInStatement\\", _ForInStatement: void, body: Statement, left: Node, @@ -7788,7 +7790,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"ForOfStatement\", + type: \\"ForOfStatement\\", _ForOfStatement: void, body: Statement, left: Node, @@ -7804,7 +7806,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"ForStatement\", + type: \\"ForStatement\\", _ForStatement: void, init: ?Node, test: ?Expression, @@ -7821,7 +7823,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"IfStatement\", + type: \\"IfStatement\\", _IfStatement: void, alternate: ?Statement, consequent: Statement, @@ -7837,7 +7839,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"LabeledStatement\", + type: \\"LabeledStatement\\", _LabeledStatement: void, body: Statement, label: Identifier, @@ -7852,7 +7854,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"ReturnStatement\", + type: \\"ReturnStatement\\", _ReturnStatement: void, argument: ?Expression, end: number, @@ -7866,7 +7868,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"SwitchStatement\", + type: \\"SwitchStatement\\", _SwitchStatement: void, cases: Array, discriminant: Expression, @@ -7882,7 +7884,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"ThrowStatement\", + type: \\"ThrowStatement\\", _ThrowStatement: void, argument: Expression, end: number, @@ -7896,7 +7898,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"TryStatement\", + type: \\"TryStatement\\", _TryStatement: void, block: BlockStatement, finalizer: ?BlockStatement, @@ -7914,7 +7916,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"WhileStatement\", + type: \\"WhileStatement\\", _WhileStatement: void, body: Statement, test: Expression, @@ -7929,7 +7931,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"WithStatement\", + type: \\"WithStatement\\", _WithStatement: void, body: Statement, object: Expression, @@ -7944,7 +7946,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"DeclareClass\", + type: \\"DeclareClass\\", _DeclareClass: void, body: ObjectTypeAnnotation, extends: Array, @@ -7961,7 +7963,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"DeclareFunction\", + type: \\"DeclareFunction\\", _DeclareFunction: void, id: Identifier, end: number, @@ -7975,7 +7977,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"DeclareModule\", + type: \\"DeclareModule\\", _DeclareModule: void, body: BlockStatement, id: Node, @@ -7990,7 +7992,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"DeclareVariable\", + type: \\"DeclareVariable\\", _DeclareVariable: void, id: Identifier, end: number, @@ -8004,7 +8006,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"InterfaceDeclaration\", + type: \\"InterfaceDeclaration\\", _InterfaceDeclaration: void, body: ObjectTypeAnnotation, extends: Array, @@ -8021,7 +8023,7 @@ export type Statement = trailingComments: ?Array } | { - type: \"TypeAlias\", + type: \\"TypeAlias\\", _TypeAlias: void, id: Identifier, right: Type, @@ -8039,7 +8041,7 @@ export type Statement = export type Type = | { - type: \"AnyTypeAnnotation\", + type: \\"AnyTypeAnnotation\\", _AnyTypeAnnotation: void, end: number, innerComments: ?Array, @@ -8052,7 +8054,7 @@ export type Type = trailingComments: ?Array } | { - type: \"ArrayTypeAnnotation\", + type: \\"ArrayTypeAnnotation\\", _ArrayTypeAnnotation: void, elementType: Type, end: number, @@ -8066,7 +8068,7 @@ export type Type = trailingComments: ?Array } | { - type: \"BooleanLiteralTypeAnnotation\", + type: \\"BooleanLiteralTypeAnnotation\\", _BooleanLiteralTypeAnnotation: void, raw: string, value: boolean, @@ -8081,7 +8083,7 @@ export type Type = trailingComments: ?Array } | { - type: \"BooleanTypeAnnotation\", + type: \\"BooleanTypeAnnotation\\", _BooleanTypeAnnotation: void, end: number, innerComments: ?Array, @@ -8094,7 +8096,7 @@ export type Type = trailingComments: ?Array } | { - type: \"FunctionTypeAnnotation\", + type: \\"FunctionTypeAnnotation\\", _FunctionTypeAnnotation: void, params: Array, rest: ?FunctionTypeParam, @@ -8111,7 +8113,7 @@ export type Type = trailingComments: ?Array } | { - type: \"GenericTypeAnnotation\", + type: \\"GenericTypeAnnotation\\", _GenericTypeAnnotation: void, id: Node, typeParameters: ?TypeParameterInstantiation, @@ -8126,7 +8128,7 @@ export type Type = trailingComments: ?Array } | { - type: \"IntersectionTypeAnnotation\", + type: \\"IntersectionTypeAnnotation\\", _IntersectionTypeAnnotation: void, types: Array, end: number, @@ -8140,7 +8142,7 @@ export type Type = trailingComments: ?Array } | { - type: \"MixedTypeAnnotation\", + type: \\"MixedTypeAnnotation\\", _MixedTypeAnnotation: void, end: number, innerComments: ?Array, @@ -8153,7 +8155,7 @@ export type Type = trailingComments: ?Array } | { - type: \"NullableTypeAnnotation\", + type: \\"NullableTypeAnnotation\\", _NullableTypeAnnotation: void, typeAnnotation: Type, end: number, @@ -8167,7 +8169,7 @@ export type Type = trailingComments: ?Array } | { - type: \"NumberLiteralTypeAnnotation\", + type: \\"NumberLiteralTypeAnnotation\\", _NumberLiteralTypeAnnotation: void, raw: string, value: number, @@ -8182,7 +8184,7 @@ export type Type = trailingComments: ?Array } | { - type: \"NumberTypeAnnotation\", + type: \\"NumberTypeAnnotation\\", _NumberTypeAnnotation: void, end: number, innerComments: ?Array, @@ -8195,7 +8197,7 @@ export type Type = trailingComments: ?Array } | { - type: \"StringLiteralTypeAnnotation\", + type: \\"StringLiteralTypeAnnotation\\", _StringLiteralTypeAnnotation: void, raw: string, value: string, @@ -8210,7 +8212,7 @@ export type Type = trailingComments: ?Array } | { - type: \"StringTypeAnnotation\", + type: \\"StringTypeAnnotation\\", _StringTypeAnnotation: void, end: number, innerComments: ?Array, @@ -8223,7 +8225,7 @@ export type Type = trailingComments: ?Array } | { - type: \"TupleTypeAnnotation\", + type: \\"TupleTypeAnnotation\\", _TupleTypeAnnotation: void, types: Array, end: number, @@ -8237,7 +8239,7 @@ export type Type = trailingComments: ?Array } | { - type: \"ObjectTypeAnnotation\", + type: \\"ObjectTypeAnnotation\\", _ObjectTypeAnnotation: void, callProperties: Array, indexers: Array, @@ -8253,7 +8255,7 @@ export type Type = trailingComments: ?Array } | { - type: \"UnionTypeAnnotation\", + type: \\"UnionTypeAnnotation\\", _UnionTypeAnnotation: void, types: Array, end: number, @@ -8267,7 +8269,7 @@ export type Type = trailingComments: ?Array } | { - type: \"VoidTypeAnnotation\", + type: \\"VoidTypeAnnotation\\", _VoidTypeAnnotation: void, end: number, innerComments: ?Array, @@ -8283,7 +8285,7 @@ export type Type = // Concrete Types. Nothing can extend these. export type CommentLine = { - type: \"CommentLine\", + type: \\"CommentLine\\", _CommentLine: void, value: string, end: number, @@ -8295,7 +8297,7 @@ export type CommentLine = { }; export type CommentBlock = { - type: \"CommentBlock\", + type: \\"CommentBlock\\", _CommentBlock: void, value: string, end: number, @@ -8309,7 +8311,7 @@ export type CommentBlock = { // Babel concrete types. export type ArrayExpression = { - type: \"ArrayExpression\", + type: \\"ArrayExpression\\", _ArrayExpression: void, elements: Array, end: number, @@ -8324,7 +8326,7 @@ export type ArrayExpression = { }; export type ArrayPattern = { - type: \"ArrayPattern\", + type: \\"ArrayPattern\\", _ArrayPattern: void, elements: Array, typeAnnotation: ?TypeAnnotation, @@ -8340,7 +8342,7 @@ export type ArrayPattern = { }; export type ArrowFunctionExpression = { - type: \"ArrowFunctionExpression\", + type: \\"ArrowFunctionExpression\\", _ArrowFunctionExpression: void, body: Node, id: ?Identifier, @@ -8364,21 +8366,21 @@ export type ArrowFunctionExpression = { }; type AssignmentOperator = - | \"=\" - | \"+=\" - | \"-=\" - | \"*=\" - | \"/=\" - | \"%=\" - | \"<<=\" - | \">>=\" - | \">>>=\" - | \"|=\" - | \"^=\" - | \"&=\"; + | \\"=\\" + | \\"+=\\" + | \\"-=\\" + | \\"*=\\" + | \\"/=\\" + | \\"%=\\" + | \\"<<=\\" + | \\">>=\\" + | \\">>>=\\" + | \\"|=\\" + | \\"^=\\" + | \\"&=\\"; export type AssignmentExpression = { - type: \"AssignmentExpression\", + type: \\"AssignmentExpression\\", _AssignmentExpression: void, left: Pattern, operator: AssignmentOperator, @@ -8395,7 +8397,7 @@ export type AssignmentExpression = { }; export type AssignmentPattern = { - type: \"AssignmentPattern\", + type: \\"AssignmentPattern\\", _AssignmentPattern: void, left: Pattern, right: Expression, @@ -8411,7 +8413,7 @@ export type AssignmentPattern = { }; export type AwaitExpression = { - type: \"AwaitExpression\", + type: \\"AwaitExpression\\", _AwaitExpression: void, all: boolean, argument: ?Expression, @@ -8427,31 +8429,31 @@ export type AwaitExpression = { }; type BinaryOperator = - | \"==\" - | \"!=\" - | \"===\" - | \"!==\" - | \"<\" - | \"<=\" - | \">\" - | \">=\" - | \"<<\" - | \">>\" - | \">>>\" - | \"+\" - | \"-\" - | \"*\" - | \"/\" - | \"%\" - | \"&\" - | \"|\" - | \"^\" - | \"in\" - | \"instanceof\" - | \"..\"; + | \\"==\\" + | \\"!=\\" + | \\"===\\" + | \\"!==\\" + | \\"<\\" + | \\"<=\\" + | \\">\\" + | \\">=\\" + | \\"<<\\" + | \\">>\\" + | \\">>>\\" + | \\"+\\" + | \\"-\\" + | \\"*\\" + | \\"/\\" + | \\"%\\" + | \\"&\\" + | \\"|\\" + | \\"^\\" + | \\"in\\" + | \\"instanceof\\" + | \\"..\\"; export type BinaryExpression = { - type: \"BinaryExpression\", + type: \\"BinaryExpression\\", _BinaryExpression: void, left: Expression, operator: BinaryOperator, @@ -8469,7 +8471,7 @@ export type BinaryExpression = { // TODO: What is this? export type BindExpression = { - type: \"BindExpression\", + type: \\"BindExpression\\", _BindExpression: void, callee: Node, object: Node, @@ -8485,7 +8487,7 @@ export type BindExpression = { }; export type BlockStatement = { - type: \"BlockStatement\", + type: \\"BlockStatement\\", _BlockStatement: void, body: Array, end: number, @@ -8500,7 +8502,7 @@ export type BlockStatement = { }; export type BreakStatement = { - type: \"BreakStatement\", + type: \\"BreakStatement\\", _BreakStatement: void, label: ?Identifier, end: number, @@ -8515,7 +8517,7 @@ export type BreakStatement = { }; export type CallExpression = { - type: \"CallExpression\", + type: \\"CallExpression\\", _CallExpression: void, arguments: Array, callee: Expression, @@ -8531,7 +8533,7 @@ export type CallExpression = { }; export type CatchClause = { - type: \"CatchClause\", + type: \\"CatchClause\\", _CatchClause: void, body: BlockStatement, param: Pattern, @@ -8547,7 +8549,7 @@ export type CatchClause = { }; export type ClassBody = { - type: \"ClassBody\", + type: \\"ClassBody\\", _ClassBody: void, body: Array, end: number, @@ -8562,7 +8564,7 @@ export type ClassBody = { }; export type ClassDeclaration = { - type: \"ClassDeclaration\", + type: \\"ClassDeclaration\\", _ClassDeclaration: void, body: ClassBody, id: ?Identifier, @@ -8582,7 +8584,7 @@ export type ClassDeclaration = { }; export type ClassExpression = { - type: \"ClassExpression\", + type: \\"ClassExpression\\", _ClassExpression: void, body: ClassBody, id: ?Identifier, @@ -8602,7 +8604,7 @@ export type ClassExpression = { }; export type ComprehensionBlock = { - type: \"ComprehensionBlock\", + type: \\"ComprehensionBlock\\", _ComprehensionBlock: void, each: boolean, left: Pattern, @@ -8619,7 +8621,7 @@ export type ComprehensionBlock = { }; export type ComprehensionExpression = { - type: \"ComprehensionExpression\", + type: \\"ComprehensionExpression\\", _ComprehensionExpression: void, body: Expression, blocks: Array, @@ -8636,7 +8638,7 @@ export type ComprehensionExpression = { }; export type ConditionalExpression = { - type: \"ConditionalExpression\", + type: \\"ConditionalExpression\\", _ConditionalExpression: void, alternate: Expression, consequent: Expression, @@ -8653,7 +8655,7 @@ export type ConditionalExpression = { }; export type ContinueStatement = { - type: \"ContinueStatement\", + type: \\"ContinueStatement\\", _ContinueStatement: void, label: ?Identifier, end: number, @@ -8669,7 +8671,7 @@ export type ContinueStatement = { // TODO: Make this correct. export type Decorator = { - type: \"Decorator\", + type: \\"Decorator\\", _Decorator: void, expression: Expression, end: number, @@ -8684,7 +8686,7 @@ export type Decorator = { }; export type DebuggerStatement = { - type: \"DebuggerStatement\", + type: \\"DebuggerStatement\\", _DebuggerStatement: void, end: number, innerComments: ?Array, @@ -8698,7 +8700,7 @@ export type DebuggerStatement = { }; export type DoWhileStatement = { - type: \"DoWhileStatement\", + type: \\"DoWhileStatement\\", _DoWhileStatement: void, body: Statement, test: Expression, @@ -8715,7 +8717,7 @@ export type DoWhileStatement = { // TODO: Make this correct. export type DoExpression = { - type: \"DoExpression\", + type: \\"DoExpression\\", _DoExpression: void, body: Statement, end: number, @@ -8730,7 +8732,7 @@ export type DoExpression = { }; export type EmptyStatement = { - type: \"EmptyStatement\", + type: \\"EmptyStatement\\", _EmptyStatement: void, end: number, innerComments: ?Array, @@ -8744,7 +8746,7 @@ export type EmptyStatement = { }; export type ExpressionStatement = { - type: \"ExpressionStatement\", + type: \\"ExpressionStatement\\", _ExpressionStatement: void, expression: Expression, end: number, @@ -8759,7 +8761,7 @@ export type ExpressionStatement = { }; export type File = { - type: \"File\", + type: \\"File\\", _File: void, program: Program, end: number, @@ -8774,7 +8776,7 @@ export type File = { }; export type ForInStatement = { - type: \"ForInStatement\", + type: \\"ForInStatement\\", _ForInStatement: void, body: Statement, left: Node, @@ -8792,7 +8794,7 @@ export type ForInStatement = { // TODO: Make this correct. export type ForOfStatement = { - type: \"ForOfStatement\", + type: \\"ForOfStatement\\", _ForOfStatement: void, body: Statement, left: Node, @@ -8809,7 +8811,7 @@ export type ForOfStatement = { }; export type ForStatement = { - type: \"ForStatement\", + type: \\"ForStatement\\", _ForStatement: void, init: ?Node, test: ?Expression, @@ -8827,7 +8829,7 @@ export type ForStatement = { }; export type FunctionDeclaration = { - type: \"FunctionDeclaration\", + type: \\"FunctionDeclaration\\", _FunctionDeclaration: void, body: BlockStatement, id: Identifier, @@ -8851,7 +8853,7 @@ export type FunctionDeclaration = { }; export type FunctionExpression = { - type: \"FunctionExpression\", + type: \\"FunctionExpression\\", _FunctionExpression: void, body: BlockStatement, id: ?Identifier, @@ -8875,7 +8877,7 @@ export type FunctionExpression = { }; export type Identifier = { - type: \"Identifier\", + type: \\"Identifier\\", _Identifier: void, name: string, typeAnnotation: ?TypeAnnotation, @@ -8891,7 +8893,7 @@ export type Identifier = { }; export type IfStatement = { - type: \"IfStatement\", + type: \\"IfStatement\\", _IfStatement: void, alternate: ?Statement, consequent: Statement, @@ -8909,7 +8911,7 @@ export type IfStatement = { // TODO: Make this correct. export type ImportDefaultSpecifier = { - type: \"ImportDefaultSpecifier\", + type: \\"ImportDefaultSpecifier\\", _ImportDefaultSpecifier: void, local: Node, end: number, @@ -8925,7 +8927,7 @@ export type ImportDefaultSpecifier = { // TODO: Make this correct. export type ImportNamespaceSpecifier = { - type: \"ImportNamespaceSpecifier\", + type: \\"ImportNamespaceSpecifier\\", _ImportNamespaceSpecifier: void, local: Node, end: number, @@ -8941,7 +8943,7 @@ export type ImportNamespaceSpecifier = { // TODO: Make this correct. export type ImportDeclaration = { - type: \"ImportDeclaration\", + type: \\"ImportDeclaration\\", _ImportDeclaration: void, specifiers: Array, source: Literal, @@ -8958,7 +8960,7 @@ export type ImportDeclaration = { // TODO: Make this correct. export type ImportSpecifier = { - type: \"ImportSpecifier\", + type: \\"ImportSpecifier\\", _ImportSpecifier: void, imported: Node, local: Node, @@ -8974,7 +8976,7 @@ export type ImportSpecifier = { }; export type LabeledStatement = { - type: \"LabeledStatement\", + type: \\"LabeledStatement\\", _LabeledStatement: void, body: Statement, label: Identifier, @@ -8990,7 +8992,7 @@ export type LabeledStatement = { }; export type Literal = { - type: \"Literal\", + type: \\"Literal\\", _Literal: void, raw: string, regex: ?{ pattern: string, flags: string }, @@ -9006,10 +9008,10 @@ export type Literal = { trailingComments: ?Array }; -type LogicalOperator = \"||\" | \"&&\"; +type LogicalOperator = \\"||\\" | \\"&&\\"; export type LogicalExpression = { - type: \"LogicalExpression\", + type: \\"LogicalExpression\\", _LogicalExpression: void, left: Expression, operator: LogicalOperator, @@ -9026,7 +9028,7 @@ export type LogicalExpression = { }; export type MemberExpression = { - type: \"MemberExpression\", + type: \\"MemberExpression\\", _MemberExpression: void, computed: boolean, object: Expression, @@ -9044,7 +9046,7 @@ export type MemberExpression = { // TODO: Make this correct. export type MetaProperty = { - type: \"MetaProperty\", + type: \\"MetaProperty\\", _MetaProperty: void, meta: Node, property: Node, @@ -9060,11 +9062,11 @@ export type MetaProperty = { }; export type MethodDefinition = { - type: \"MethodDefinition\", + type: \\"MethodDefinition\\", _MethodDefinition: void, computed: boolean, key: Node, - kind: \"constructor\" | \"method\" | \"get\" | \"set\", + kind: \\"constructor\\" | \\"method\\" | \\"get\\" | \\"set\\", static: boolean, value: FunctionExpression, decorators: ?Array, @@ -9080,7 +9082,7 @@ export type MethodDefinition = { }; export type NewExpression = { - type: \"NewExpression\", + type: \\"NewExpression\\", _NewExpression: void, arguments: Array, callee: Expression, @@ -9096,7 +9098,7 @@ export type NewExpression = { }; export type Noop = { - type: \"Noop\", + type: \\"Noop\\", _Noop: void, end: number, innerComments: ?Array, @@ -9110,7 +9112,7 @@ export type Noop = { }; export type ObjectExpression = { - type: \"ObjectExpression\", + type: \\"ObjectExpression\\", _ObjectExpression: void, properties: Array, end: number, @@ -9125,7 +9127,7 @@ export type ObjectExpression = { }; export type ObjectPattern = { - type: \"ObjectPattern\", + type: \\"ObjectPattern\\", _ObjectPattern: void, properties: Array, typeAnnotation: ?TypeAnnotation, @@ -9141,7 +9143,7 @@ export type ObjectPattern = { }; export type Program = { - type: \"Program\", + type: \\"Program\\", _Program: void, body: Array, end: number, @@ -9156,11 +9158,11 @@ export type Program = { }; export type Property = { - type: \"Property\", + type: \\"Property\\", _Property: void, computed: boolean, key: Node, - kind: \"init\" | \"get\" | \"set\", + kind: \\"init\\" | \\"get\\" | \\"set\\", method: boolean, shorthand: boolean, value: Node, @@ -9177,7 +9179,7 @@ export type Property = { }; export type RestElement = { - type: \"RestElement\", + type: \\"RestElement\\", _RestElement: void, argument: Pattern, typeAnnotation: ?TypeAnnotation, @@ -9193,7 +9195,7 @@ export type RestElement = { }; export type ReturnStatement = { - type: \"ReturnStatement\", + type: \\"ReturnStatement\\", _ReturnStatement: void, argument: ?Expression, end: number, @@ -9208,7 +9210,7 @@ export type ReturnStatement = { }; export type SequenceExpression = { - type: \"SequenceExpression\", + type: \\"SequenceExpression\\", _SequenceExpression: void, expression: Array, end: number, @@ -9223,7 +9225,7 @@ export type SequenceExpression = { }; export type SpreadElement = { - type: \"SpreadElement\", + type: \\"SpreadElement\\", _SpreadElement: void, argument: Expression, end: number, @@ -9238,7 +9240,7 @@ export type SpreadElement = { }; export type SpreadProperty = { - type: \"SpreadProperty\", + type: \\"SpreadProperty\\", _SpreadProperty: void, argument: Expression, end: number, @@ -9253,7 +9255,7 @@ export type SpreadProperty = { }; export type Super = { - type: \"Super\", + type: \\"Super\\", _Super: void, end: number, innerComments: ?Array, @@ -9267,7 +9269,7 @@ export type Super = { }; export type SwitchCase = { - type: \"SwitchCase\", + type: \\"SwitchCase\\", _SwitchCase: void, consequent: Array, test: ?Expression, @@ -9283,7 +9285,7 @@ export type SwitchCase = { }; export type SwitchStatement = { - type: \"SwitchStatement\", + type: \\"SwitchStatement\\", _SwitchStatement: void, cases: Array, discriminant: Expression, @@ -9300,7 +9302,7 @@ export type SwitchStatement = { }; export type TaggedTemplateExpression = { - type: \"TaggedTemplateExpression\", + type: \\"TaggedTemplateExpression\\", _TaggedTemplateExpression: void, quasi: TemplateLiteral, tag: Expression, @@ -9316,7 +9318,7 @@ export type TaggedTemplateExpression = { }; export type TemplateElement = { - type: \"TemplateElement\", + type: \\"TemplateElement\\", _TemplateElement: void, tail: boolean, value: { cooked: string, raw: string }, @@ -9332,7 +9334,7 @@ export type TemplateElement = { }; export type TemplateLiteral = { - type: \"TemplateLiteral\", + type: \\"TemplateLiteral\\", _TemplateLiteral: void, expressions: Array, quasis: Array, @@ -9348,7 +9350,7 @@ export type TemplateLiteral = { }; export type ThisExpression = { - type: \"ThisExpression\", + type: \\"ThisExpression\\", _ThisExpression: void, end: number, innerComments: ?Array, @@ -9362,7 +9364,7 @@ export type ThisExpression = { }; export type ThrowStatement = { - type: \"ThrowStatement\", + type: \\"ThrowStatement\\", _ThrowStatement: void, argument: Expression, end: number, @@ -9377,7 +9379,7 @@ export type ThrowStatement = { }; export type TryStatement = { - type: \"TryStatement\", + type: \\"TryStatement\\", _TryStatement: void, block: BlockStatement, finalizer: ?BlockStatement, @@ -9395,10 +9397,10 @@ export type TryStatement = { trailingComments: ?Array }; -type UnaryOperator = \"-\" | \"+\" | \"!\" | \"~\" | \"typeof\" | \"void\" | \"delete\"; +type UnaryOperator = \\"-\\" | \\"+\\" | \\"!\\" | \\"~\\" | \\"typeof\\" | \\"void\\" | \\"delete\\"; export type UnaryExpression = { - type: \"UnaryExpression\", + type: \\"UnaryExpression\\", _UnaryExpression: void, argument: Expression, operator: UnaryOperator, @@ -9414,10 +9416,10 @@ export type UnaryExpression = { trailingComments: ?Array }; -type UpdateOperator = \"++\" | \"--\"; +type UpdateOperator = \\"++\\" | \\"--\\"; export type UpdateExpression = { - type: \"UpdateExpression\", + type: \\"UpdateExpression\\", _UpdateExpression: void, argument: Expression, operator: UpdateOperator, @@ -9434,10 +9436,10 @@ export type UpdateExpression = { }; export type VariableDeclaration = { - type: \"VariableDeclaration\", + type: \\"VariableDeclaration\\", _VariableDeclaration: void, declarations: Array, - kind: \"var\" | \"let\" | \"const\", + kind: \\"var\\" | \\"let\\" | \\"const\\", end: number, innerComments: ?Array, leadingComments: ?Array, @@ -9450,7 +9452,7 @@ export type VariableDeclaration = { }; export type VariableDeclarator = { - type: \"VariableDeclarator\", + type: \\"VariableDeclarator\\", _VariableDeclarator: void, id: Pattern, init: ?Expression, @@ -9466,7 +9468,7 @@ export type VariableDeclarator = { }; export type WhileStatement = { - type: \"WhileStatement\", + type: \\"WhileStatement\\", _WhileStatement: void, body: Statement, test: Expression, @@ -9482,7 +9484,7 @@ export type WhileStatement = { }; export type WithStatement = { - type: \"WithStatement\", + type: \\"WithStatement\\", _WithStatement: void, body: Statement, object: Expression, @@ -9498,7 +9500,7 @@ export type WithStatement = { }; export type YieldExpression = { - type: \"YieldExpression\", + type: \\"YieldExpression\\", _YieldExpression: void, argument: ?Expression, delegate: boolean, @@ -9515,7 +9517,7 @@ export type YieldExpression = { // TODO: Make this correct. export type ExportAllDeclaration = { - type: \"ExportAllDeclaration\", + type: \\"ExportAllDeclaration\\", _ExportAllDeclaration: void, exported: Node, source: Node, @@ -9532,7 +9534,7 @@ export type ExportAllDeclaration = { // TODO: Make this correct. export type ExportDefaultDeclaration = { - type: \"ExportDefaultDeclaration\", + type: \\"ExportDefaultDeclaration\\", _ExportDefaultDeclaration: void, declaration: Node, end: number, @@ -9548,7 +9550,7 @@ export type ExportDefaultDeclaration = { // TODO: Make this correct. export type ExportNamedDeclaration = { - type: \"ExportNamedDeclaration\", + type: \\"ExportNamedDeclaration\\", _ExportNamedDeclaration: void, declaration: Node, source: Literal, @@ -9566,7 +9568,7 @@ export type ExportNamedDeclaration = { // TODO: Make this correct. export type ExportDefaultSpecifier = { - type: \"ExportDefaultSpecifier\", + type: \\"ExportDefaultSpecifier\\", _ExportDefaultSpecifier: void, exported: Node, end: number, @@ -9582,7 +9584,7 @@ export type ExportDefaultSpecifier = { // TODO: Make this correct. export type ExportNamespaceSpecifier = { - type: \"ExportNamespaceSpecifier\", + type: \\"ExportNamespaceSpecifier\\", _ExportNamespaceSpecifier: void, exported: Node, end: number, @@ -9598,7 +9600,7 @@ export type ExportNamespaceSpecifier = { // TODO: Make this correct. export type ExportSpecifier = { - type: \"ExportSpecifier\", + type: \\"ExportSpecifier\\", _ExportSpecifier: void, local: Node, exported: Node, @@ -9614,7 +9616,7 @@ export type ExportSpecifier = { }; export type AnyTypeAnnotation = { - type: \"AnyTypeAnnotation\", + type: \\"AnyTypeAnnotation\\", _AnyTypeAnnotation: void, end: number, innerComments: ?Array, @@ -9628,7 +9630,7 @@ export type AnyTypeAnnotation = { }; export type ArrayTypeAnnotation = { - type: \"ArrayTypeAnnotation\", + type: \\"ArrayTypeAnnotation\\", _ArrayTypeAnnotation: void, elementType: Type, end: number, @@ -9643,7 +9645,7 @@ export type ArrayTypeAnnotation = { }; export type BooleanLiteralTypeAnnotation = { - type: \"BooleanLiteralTypeAnnotation\", + type: \\"BooleanLiteralTypeAnnotation\\", _BooleanLiteralTypeAnnotation: void, raw: string, value: boolean, @@ -9659,7 +9661,7 @@ export type BooleanLiteralTypeAnnotation = { }; export type BooleanTypeAnnotation = { - type: \"BooleanTypeAnnotation\", + type: \\"BooleanTypeAnnotation\\", _BooleanTypeAnnotation: void, end: number, innerComments: ?Array, @@ -9673,7 +9675,7 @@ export type BooleanTypeAnnotation = { }; export type ClassImplements = { - type: \"ClassImplements\", + type: \\"ClassImplements\\", _ClassImplements: void, id: Identifier, typeParameters: ?TypeParameterInstantiation, @@ -9690,7 +9692,7 @@ export type ClassImplements = { }; export type ClassProperty = { - type: \"ClassProperty\", + type: \\"ClassProperty\\", _ClassProperty: void, computed: boolean, key: Node, @@ -9710,7 +9712,7 @@ export type ClassProperty = { }; export type DeclareClass = { - type: \"DeclareClass\", + type: \\"DeclareClass\\", _DeclareClass: void, body: ObjectTypeAnnotation, extends: Array, @@ -9729,7 +9731,7 @@ export type DeclareClass = { // TODO: Make this correct. export type DeclareFunction = { - type: \"DeclareFunction\", + type: \\"DeclareFunction\\", _DeclareFunction: void, id: Identifier, end: number, @@ -9744,7 +9746,7 @@ export type DeclareFunction = { }; export type DeclareModule = { - type: \"DeclareModule\", + type: \\"DeclareModule\\", _DeclareModule: void, body: BlockStatement, id: Node, @@ -9761,7 +9763,7 @@ export type DeclareModule = { // TODO: Make this correct. export type DeclareVariable = { - type: \"DeclareVariable\", + type: \\"DeclareVariable\\", _DeclareVariable: void, id: Identifier, end: number, @@ -9776,7 +9778,7 @@ export type DeclareVariable = { }; export type FunctionTypeAnnotation = { - type: \"FunctionTypeAnnotation\", + type: \\"FunctionTypeAnnotation\\", _FunctionTypeAnnotation: void, params: Array, rest: ?FunctionTypeParam, @@ -9794,7 +9796,7 @@ export type FunctionTypeAnnotation = { }; export type FunctionTypeParam = { - type: \"FunctionTypeParam\", + type: \\"FunctionTypeParam\\", _FunctionTypeParam: void, name: Identifier, optional: boolean, @@ -9811,7 +9813,7 @@ export type FunctionTypeParam = { }; export type GenericTypeAnnotation = { - type: \"GenericTypeAnnotation\", + type: \\"GenericTypeAnnotation\\", _GenericTypeAnnotation: void, id: Node, typeParameters: ?TypeParameterInstantiation, @@ -9827,7 +9829,7 @@ export type GenericTypeAnnotation = { }; export type InterfaceExtends = { - type: \"InterfaceExtends\", + type: \\"InterfaceExtends\\", _InterfaceExtends: void, id: Identifier, typeParameters: ?TypeParameterInstantiation, @@ -9843,7 +9845,7 @@ export type InterfaceExtends = { }; export type InterfaceDeclaration = { - type: \"InterfaceDeclaration\", + type: \\"InterfaceDeclaration\\", _InterfaceDeclaration: void, body: ObjectTypeAnnotation, extends: Array, @@ -9861,7 +9863,7 @@ export type InterfaceDeclaration = { }; export type IntersectionTypeAnnotation = { - type: \"IntersectionTypeAnnotation\", + type: \\"IntersectionTypeAnnotation\\", _IntersectionTypeAnnotation: void, types: Array, end: number, @@ -9876,7 +9878,7 @@ export type IntersectionTypeAnnotation = { }; export type MixedTypeAnnotation = { - type: \"MixedTypeAnnotation\", + type: \\"MixedTypeAnnotation\\", _MixedTypeAnnotation: void, end: number, innerComments: ?Array, @@ -9890,7 +9892,7 @@ export type MixedTypeAnnotation = { }; export type NullableTypeAnnotation = { - type: \"NullableTypeAnnotation\", + type: \\"NullableTypeAnnotation\\", _NullableTypeAnnotation: void, typeAnnotation: Type, end: number, @@ -9905,7 +9907,7 @@ export type NullableTypeAnnotation = { }; export type NumberLiteralTypeAnnotation = { - type: \"NumberLiteralTypeAnnotation\", + type: \\"NumberLiteralTypeAnnotation\\", _NumberLiteralTypeAnnotation: void, raw: string, value: number, @@ -9921,7 +9923,7 @@ export type NumberLiteralTypeAnnotation = { }; export type NumberTypeAnnotation = { - type: \"NumberTypeAnnotation\", + type: \\"NumberTypeAnnotation\\", _NumberTypeAnnotation: void, end: number, innerComments: ?Array, @@ -9935,7 +9937,7 @@ export type NumberTypeAnnotation = { }; export type StringLiteralTypeAnnotation = { - type: \"StringLiteralTypeAnnotation\", + type: \\"StringLiteralTypeAnnotation\\", _StringLiteralTypeAnnotation: void, raw: string, value: string, @@ -9951,7 +9953,7 @@ export type StringLiteralTypeAnnotation = { }; export type StringTypeAnnotation = { - type: \"StringTypeAnnotation\", + type: \\"StringTypeAnnotation\\", _StringTypeAnnotation: void, end: number, innerComments: ?Array, @@ -9965,7 +9967,7 @@ export type StringTypeAnnotation = { }; export type TupleTypeAnnotation = { - type: \"TupleTypeAnnotation\", + type: \\"TupleTypeAnnotation\\", _TupleTypeAnnotation: void, types: Array, end: number, @@ -9980,7 +9982,7 @@ export type TupleTypeAnnotation = { }; export type TypeofTypeAnnotation = { - type: \"TypeofTypeAnnotation\", + type: \\"TypeofTypeAnnotation\\", _TypeofTypeAnnotation: void, argument: Type, end: number, @@ -9995,7 +9997,7 @@ export type TypeofTypeAnnotation = { }; export type TypeAlias = { - type: \"TypeAlias\", + type: \\"TypeAlias\\", _TypeAlias: void, id: Identifier, right: Type, @@ -10012,7 +10014,7 @@ export type TypeAlias = { }; export type TypeAnnotation = { - type: \"TypeAnnotation\", + type: \\"TypeAnnotation\\", _TypeAnnotation: void, typeAnnotation: Type, end: number, @@ -10027,7 +10029,7 @@ export type TypeAnnotation = { }; export type TypeCastExpression = { - type: \"TypeCastExpression\", + type: \\"TypeCastExpression\\", _TypeCastExpression: void, expression: Expression, typeAnnotation: TypeAnnotation, @@ -10043,7 +10045,7 @@ export type TypeCastExpression = { }; export type TypeParameterDeclaration = { - type: \"TypeParameterDeclaration\", + type: \\"TypeParameterDeclaration\\", _TypeParameterDeclaration: void, params: Array, end: number, @@ -10058,7 +10060,7 @@ export type TypeParameterDeclaration = { }; export type TypeParameterInstantiation = { - type: \"TypeParameterInstantiation\", + type: \\"TypeParameterInstantiation\\", _TypeParameterInstantiation: void, params: Array, end: number, @@ -10073,7 +10075,7 @@ export type TypeParameterInstantiation = { }; export type ObjectTypeAnnotation = { - type: \"ObjectTypeAnnotation\", + type: \\"ObjectTypeAnnotation\\", _ObjectTypeAnnotation: void, callProperties: Array, indexers: Array, @@ -10090,7 +10092,7 @@ export type ObjectTypeAnnotation = { }; export type ObjectTypeCallProperty = { - type: \"ObjectTypeCallProperty\", + type: \\"ObjectTypeCallProperty\\", _ObjectTypeCallProperty: void, static: boolean, value: FunctionTypeAnnotation, @@ -10106,7 +10108,7 @@ export type ObjectTypeCallProperty = { }; export type ObjectTypeIndexer = { - type: \"ObjectTypeIndexer\", + type: \\"ObjectTypeIndexer\\", _ObjectTypeIndexer: void, id: Identifier, key: Type, @@ -10123,7 +10125,7 @@ export type ObjectTypeIndexer = { }; export type ObjectTypeProperty = { - type: \"ObjectTypeProperty\", + type: \\"ObjectTypeProperty\\", _ObjectTypeProperty: void, key: Node, optional: boolean, @@ -10140,7 +10142,7 @@ export type ObjectTypeProperty = { }; export type QualifiedTypeIdentifier = { - type: \"QualifiedTypeIdentifier\", + type: \\"QualifiedTypeIdentifier\\", _QualifiedTypeIdentifier: void, id: Identifier, qualification: Node, @@ -10156,7 +10158,7 @@ export type QualifiedTypeIdentifier = { }; export type UnionTypeAnnotation = { - type: \"UnionTypeAnnotation\", + type: \\"UnionTypeAnnotation\\", _UnionTypeAnnotation: void, types: Array, end: number, @@ -10171,7 +10173,7 @@ export type UnionTypeAnnotation = { }; export type VoidTypeAnnotation = { - type: \"VoidTypeAnnotation\", + type: \\"VoidTypeAnnotation\\", _VoidTypeAnnotation: void, end: number, innerComments: ?Array, @@ -10185,7 +10187,7 @@ export type VoidTypeAnnotation = { }; export type JSXAttribute = { - type: \"JSXAttribute\", + type: \\"JSXAttribute\\", _JSXAttribute: void, name: Node, value: ?Node, @@ -10201,7 +10203,7 @@ export type JSXAttribute = { }; export type JSXClosingElement = { - type: \"JSXClosingElement\", + type: \\"JSXClosingElement\\", _JSXClosingElement: void, name: Node, end: number, @@ -10216,7 +10218,7 @@ export type JSXClosingElement = { }; export type JSXElement = { - type: \"JSXElement\", + type: \\"JSXElement\\", _JSXElement: void, children: Array, closingElement: ?JSXClosingElement, @@ -10233,7 +10235,7 @@ export type JSXElement = { }; export type JSXEmptyExpression = { - type: \"JSXEmptyExpression\", + type: \\"JSXEmptyExpression\\", _JSXEmptyExpression: void, end: number, innerComments: ?Array, @@ -10247,7 +10249,7 @@ export type JSXEmptyExpression = { }; export type JSXExpressionContainer = { - type: \"JSXExpressionContainer\", + type: \\"JSXExpressionContainer\\", _JSXExpressionContainer: void, expression: Expression, end: number, @@ -10262,7 +10264,7 @@ export type JSXExpressionContainer = { }; export type JSXIdentifier = { - type: \"JSXIdentifier\", + type: \\"JSXIdentifier\\", _JSXIdentifier: void, name: string, end: number, @@ -10277,7 +10279,7 @@ export type JSXIdentifier = { }; export type JSXMemberExpression = { - type: \"JSXMemberExpression\", + type: \\"JSXMemberExpression\\", _JSXMemberExpression: void, computed: boolean, object: Node, @@ -10294,7 +10296,7 @@ export type JSXMemberExpression = { }; export type JSXNamespacedName = { - type: \"JSXNamespacedName\", + type: \\"JSXNamespacedName\\", _JSXNamespacedName: void, name: JSXIdentifier, namespace: JSXIdentifier, @@ -10310,7 +10312,7 @@ export type JSXNamespacedName = { }; export type JSXOpeningElement = { - type: \"JSXOpeningElement\", + type: \\"JSXOpeningElement\\", _JSXOpeningElement: void, attributes: Array, name: Array, @@ -10327,7 +10329,7 @@ export type JSXOpeningElement = { }; export type JSXSpreadAttribute = { - type: \"JSXSpreadAttribute\", + type: \\"JSXSpreadAttribute\\", _JSXSpreadAttribute: void, argument: Expression, end: number, diff --git a/tests/flow/type_args_nonstrict/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_args_nonstrict/__snapshots__/jsfmt.spec.js.snap index dedb06ca8..7c6d8407f 100644 --- a/tests/flow/type_args_nonstrict/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type_args_nonstrict/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "/** * Test nonstrict type param arity checking, * as enabled by @@ -33,7 +35,7 @@ class MyClass2 { } } -var c2: MyClass2 = new MyClass2(0, \"\"); // no error +var c2: MyClass2 = new MyClass2(0, \\"\\"); // no error // no arity error in type annotation using polymorphic type alias @@ -106,7 +108,7 @@ class MyClass2 { } } -var c2: MyClass2 = new MyClass2(0, \"\"); // no error +var c2: MyClass2 = new MyClass2(0, \\"\\"); // no error // no arity error in type annotation using polymorphic type alias diff --git a/tests/flow/type_args_strict/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_args_strict/__snapshots__/jsfmt.spec.js.snap index d3067bae0..120231d4b 100644 --- a/tests/flow/type_args_strict/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type_args_strict/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "/** * Test strict type param arity checking. * @@ -32,7 +34,7 @@ class MyClass2 { } } -var c2: MyClass2 = new MyClass2(0, \"\"); // error, missing argument list (1-2) +var c2: MyClass2 = new MyClass2(0, \\"\\"); // error, missing argument list (1-2) // arity error in type annotation using polymorphic type alias @@ -104,7 +106,7 @@ class MyClass2 { } } -var c2: MyClass2 = new MyClass2(0, \"\"); // error, missing argument list (1-2) +var c2: MyClass2 = new MyClass2(0, \\"\\"); // error, missing argument list (1-2) // arity error in type annotation using polymorphic type alias diff --git a/tests/flow/type_only_vars/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_only_vars/__snapshots__/jsfmt.spec.js.snap index bedfebb27..83e83b752 100644 --- a/tests/flow/type_only_vars/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type_only_vars/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test A.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`A.js 1`] = ` "/** * @flow */ @@ -29,56 +31,56 @@ module.exports = { " `; -exports[`test bad_shadowing.js 1`] = ` +exports[`bad_shadowing.js 1`] = ` "/** * @flow */ -import typeof A from \"./A.js\"; -import type {Foo, Bar as Baz} from \"./A.js\"; +import typeof A from \\"./A.js\\"; +import type {Foo, Bar as Baz} from \\"./A.js\\"; type duck = { quack: () => string; } // These string types should confict with the imported types -var A: string = \"Hello\"; -var Foo: string = \"Goodbye\"; -var Baz: string = \"Go away please\"; +var A: string = \\"Hello\\"; +var Foo: string = \\"Goodbye\\"; +var Baz: string = \\"Go away please\\"; // This string type should conflict with the typedef -var duck: string = \"quack\"; +var duck: string = \\"quack\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow */ -import typeof A from \"./A.js\"; -import type { Foo, Bar as Baz } from \"./A.js\"; +import typeof A from \\"./A.js\\"; +import type { Foo, Bar as Baz } from \\"./A.js\\"; type duck = { quack: () => string }; // These string types should confict with the imported types -var A: string = \"Hello\"; -var Foo: string = \"Goodbye\"; -var Baz: string = \"Go away please\"; +var A: string = \\"Hello\\"; +var Foo: string = \\"Goodbye\\"; +var Baz: string = \\"Go away please\\"; // This string type should conflict with the typedef -var duck: string = \"quack\"; +var duck: string = \\"quack\\"; " `; -exports[`test good_shadowing.js 1`] = ` +exports[`good_shadowing.js 1`] = ` "/** * @flow */ -import typeof A from \"./A.js\"; -import type {Foo, Bar as Baz} from \"./A.js\"; +import typeof A from \\"./A.js\\"; +import type {Foo, Bar as Baz} from \\"./A.js\\"; -var A = require(\'./A.js\'); +var A = require('./A.js'); var Foo = A.Foo; var Baz = A.Bar; @@ -96,10 +98,10 @@ var b: Foo = new A.Foo(); * @flow */ -import typeof A from \"./A.js\"; -import type { Foo, Bar as Baz } from \"./A.js\"; +import typeof A from \\"./A.js\\"; +import type { Foo, Bar as Baz } from \\"./A.js\\"; -var A = require(\"./A.js\"); +var A = require(\\"./A.js\\"); var Foo = A.Foo; var Baz = A.Bar; @@ -115,17 +117,17 @@ var b: Foo = new A.Foo(); " `; -exports[`test import_type.js 1`] = ` +exports[`import_type.js 1`] = ` "/** * @flow */ -import typeof A from \"./A.js\"; -import type {Foo, Bar as Baz} from \"./A.js\"; +import typeof A from \\"./A.js\\"; +import type {Foo, Bar as Baz} from \\"./A.js\\"; -var actualA = require(\'./A.js\'); +var actualA = require('./A.js'); -// You can\'t use it as an identifier +// You can't use it as an identifier var m = A; var n = Foo; var o = Baz; @@ -138,12 +140,12 @@ var a: Foo = new actualA.Foo(); * @flow */ -import typeof A from \"./A.js\"; -import type { Foo, Bar as Baz } from \"./A.js\"; +import typeof A from \\"./A.js\\"; +import type { Foo, Bar as Baz } from \\"./A.js\\"; -var actualA = require(\"./A.js\"); +var actualA = require(\\"./A.js\\"); -// You can\'t use it as an identifier +// You can't use it as an identifier var m = A; var n = Foo; var o = Baz; @@ -154,14 +156,14 @@ var a: Foo = new actualA.Foo(); " `; -exports[`test type_alias.js 1`] = ` +exports[`type_alias.js 1`] = ` "/** * @flow */ type Foo = number; -// You can\'t use it as an identifier +// You can't use it as an identifier var x = Foo; // But using it in a type should still work @@ -175,7 +177,7 @@ type c = Foo; type Foo = number; -// You can\'t use it as an identifier +// You can't use it as an identifier var x = Foo; // But using it in a type should still work diff --git a/tests/flow/type_param_defaults/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_param_defaults/__snapshots__/jsfmt.spec.js.snap index e69ed11d6..8819ac4e9 100644 --- a/tests/flow/type_param_defaults/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type_param_defaults/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test classes.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`classes.js 1`] = ` "/* @flow */ class A { @@ -13,7 +15,7 @@ class B extends A {} var b_number: B = new B(123); var b_void: B = new B(); -var b_default: B<> = new B(\'hello\'); +var b_default: B<> = new B('hello'); var b_star: B<*> = new B(123); @@ -27,8 +29,8 @@ class C extends A {} var c_number: C = new C(123); // Error number ~> ?string var c_void: C = new C(); -var c_default: C<> = new C(\'hello\'); -var c_star: C<*> = new C(\'hello\'); +var c_default: C<> = new C('hello'); +var c_star: C<*> = new C('hello'); (c_void.p: boolean); // Error void ~> boolean (c_default.p: boolean); // Error string ~> boolean @@ -37,9 +39,9 @@ var c_star: C<*> = new C(\'hello\'); class D extends A {} var d_number: D = new D(123); var d_void: D = new D(); -var d_default: D = new D(\'hello\'); -var d_too_few_args: D<> = new D(\'hello\'); // Error too few tparams -var d_too_many: D = new D(\'hello\'); // Error too many tparams +var d_default: D = new D('hello'); +var d_too_few_args: D<> = new D('hello'); // Error too few tparams +var d_too_many: D = new D('hello'); // Error too many tparams var d_star: D<*> = new D(10); // error, number ~> string (d_number.p: boolean); // Error number ~> boolean @@ -52,18 +54,18 @@ class F {} // Error: number ~> string class G extends A {} -var g_default: G = new G(\'hello\'); +var g_default: G = new G('hello'); (g_default.p: boolean); // Error string ~> boolean -class H {} // Error - can\'t refer to T before it\'s defined +class H {} // Error - can't refer to T before it's defined class I extends A {} var i_number: I = new I(123); // Error number ~> ?string var i_void: I = new I(); -var i_default: I<> = new I(\'hello\'); -var i_star: I<*> = new I(\'hello\'); +var i_default: I<> = new I('hello'); +var i_star: I<*> = new I('hello'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -79,7 +81,7 @@ class B extends A {} var b_number: B = new B(123); var b_void: B = new B(); -var b_default: B<> = new B(\"hello\"); +var b_default: B<> = new B(\\"hello\\"); var b_star: B<*> = new B(123); @@ -93,8 +95,8 @@ class C extends A {} var c_number: C = new C(123); // Error number ~> ?string var c_void: C = new C(); -var c_default: C<> = new C(\"hello\"); -var c_star: C<*> = new C(\"hello\"); +var c_default: C<> = new C(\\"hello\\"); +var c_star: C<*> = new C(\\"hello\\"); (c_void.p: boolean); // Error void ~> boolean (c_default.p: boolean); // Error string ~> boolean @@ -103,9 +105,9 @@ var c_star: C<*> = new C(\"hello\"); class D extends A {} var d_number: D = new D(123); var d_void: D = new D(); -var d_default: D = new D(\"hello\"); -var d_too_few_args: D<> = new D(\"hello\"); // Error too few tparams -var d_too_many: D = new D(\"hello\"); // Error too many tparams +var d_default: D = new D(\\"hello\\"); +var d_too_few_args: D<> = new D(\\"hello\\"); // Error too few tparams +var d_too_many: D = new D(\\"hello\\"); // Error too many tparams var d_star: D<*> = new D(10); // error, number ~> string (d_number.p: boolean); // Error number ~> boolean @@ -118,17 +120,17 @@ class F {} // Error: number ~> string class G extends A {} -var g_default: G = new G(\"hello\"); +var g_default: G = new G(\\"hello\\"); (g_default.p: boolean); // Error string ~> boolean -class H {} // Error - can\'t refer to T before it\'s defined +class H {} // Error - can't refer to T before it's defined class I extends A {} var i_number: I = new I(123); // Error number ~> ?string var i_void: I = new I(); -var i_default: I<> = new I(\"hello\"); -var i_star: I<*> = new I(\"hello\"); +var i_default: I<> = new I(\\"hello\\"); +var i_star: I<*> = new I(\\"hello\\"); " `; diff --git a/tests/flow/type_param_scope/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_param_scope/__snapshots__/jsfmt.spec.js.snap index 1906b8db8..8353f4618 100644 --- a/tests/flow/type_param_scope/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type_param_scope/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test class.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class.js 1`] = ` "class C { a(x:T, a:A) { this.b(x); // ok @@ -19,7 +21,7 @@ class C { " `; -exports[`test default_params.js 1`] = ` +exports[`default_params.js 1`] = ` "function f(a:T) { function g(b:U, c:T = a) { function h(d:U = b) {} @@ -48,7 +50,7 @@ f(0); // ok " `; -exports[`test method_shadow.js 1`] = ` +exports[`method_shadow.js 1`] = ` "// Ensure method type params properly shadow outer type params. Subclass ensures // the generated insttype has the correct tvars. Should behave the same for // classes, interfaces, and declared classes. @@ -85,13 +87,13 @@ declare class F extends E { class G { x:T; constructor(x:T) { this.x = x } - m(x:T):G { return new G(x) } // T-as-bound is G\'s T + m(x:T):G { return new G(x) } // T-as-bound is G's T } declare var g: G; g.m(0); // ok g.m(true); // err, bool ~> number|string -(g.m(\"\"): G); // err, string ~> number +(g.m(\\"\\"): G); // err, string ~> number // Shadow bounds incompatible with parent @@ -99,7 +101,7 @@ g.m(true); // err, bool ~> number|string class H { x:T; m(x:T) { - this.x = x; // err, m\'s T != H\'s T + this.x = x; // err, m's T != H's T } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -148,20 +150,20 @@ class G { } m(x: T): G { return new G(x); - } // T-as-bound is G\'s T + } // T-as-bound is G's T } declare var g: G; g.m(0); // ok g.m(true); // err, bool ~> number|string -(g.m(\"\"): G); // err, string ~> number +(g.m(\\"\\"): G); // err, string ~> number // Shadow bounds incompatible with parent class H { x: T; m(x: T) { - this.x = x; // err, m\'s T != H\'s T + this.x = x; // err, m's T != H's T } } " diff --git a/tests/flow/type_param_variance/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_param_variance/__snapshots__/jsfmt.spec.js.snap index ceeda7f84..a42199cd4 100644 --- a/tests/flow/type_param_variance/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type_param_variance/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test promise.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`promise.js 1`] = ` "/** * At the moment, all type params are invariant with * the exception of the single param to the Promise class, * which is covariant. * * Explicit variance control via annotation is coming, - * but not immediately. In the meantime, Promise\'s + * but not immediately. In the meantime, Promise's * participation in async/await makes certain kinds of * errors onerous (and nonobvious) without covariance. * @@ -14,7 +16,7 @@ exports[`test promise.js 1`] = ` async function foo(x: boolean): Promise { if (x) { - return {bar: \'baz\'}; // OK, because of covariant type param + return {bar: 'baz'}; // OK, because of covariant type param } else { return null; } @@ -33,7 +35,7 @@ run() * which is covariant. * * Explicit variance control via annotation is coming, - * but not immediately. In the meantime, Promise\'s + * but not immediately. In the meantime, Promise's * participation in async/await makes certain kinds of * errors onerous (and nonobvious) without covariance. * @@ -42,7 +44,7 @@ run() async function foo(x: boolean): Promise { if (x) { - return { bar: \"baz\" }; // OK, because of covariant type param + return { bar: \\"baz\\" }; // OK, because of covariant type param } else { return null; } diff --git a/tests/flow/type_param_variance2/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_param_variance2/__snapshots__/jsfmt.spec.js.snap index 831e7d9b1..e4179252d 100644 --- a/tests/flow/type_param_variance2/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type_param_variance2/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test promise.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`promise.js 1`] = ` "/** * Here the definition of Promise is routed to the class Promise * in the user-specified library libs/Promise.js @@ -11,7 +13,7 @@ exports[`test promise.js 1`] = ` async function foo(x: boolean): Promise { if (x) { - return {bar: \'baz\'}; // OK, because of covariant type param + return {bar: 'baz'}; // OK, because of covariant type param } else { return null; } @@ -36,7 +38,7 @@ run() async function foo(x: boolean): Promise { if (x) { - return { bar: \"baz\" }; // OK, because of covariant type param + return { bar: \\"baz\\" }; // OK, because of covariant type param } else { return null; } diff --git a/tests/flow/type_param_variance2/libs/__snapshots__/jsfmt.spec.js.snap b/tests/flow/type_param_variance2/libs/__snapshots__/jsfmt.spec.js.snap index c373ecf90..5ca2a596b 100644 --- a/tests/flow/type_param_variance2/libs/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/type_param_variance2/libs/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test Promise.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Promise.js 1`] = ` "// Copyright 2004-present Facebook. All Rights Reserved. // These annotations are copy/pasted from the built-in Flow definitions for diff --git a/tests/flow/typeapp_perf/__snapshots__/jsfmt.spec.js.snap b/tests/flow/typeapp_perf/__snapshots__/jsfmt.spec.js.snap index 2089a496a..8ed5aa972 100644 --- a/tests/flow/typeapp_perf/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/typeapp_perf/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test1.js 1`] = ` "/* This test ensures that the code below does not take a long time to check. If * this test is taking a very long time to complete, there is a bug. */ @@ -43,7 +45,7 @@ declare var b: B; " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "/* This test ensures that the code below does not take a long time to check. If * this test is taking a very long time to complete, there is a bug. */ diff --git a/tests/flow/typecast/__snapshots__/jsfmt.spec.js.snap b/tests/flow/typecast/__snapshots__/jsfmt.spec.js.snap index 90f414af5..8b0911505 100644 --- a/tests/flow/typecast/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/typecast/__snapshots__/jsfmt.spec.js.snap @@ -1,20 +1,22 @@ -exports[`test typecast.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typecast.js 1`] = ` "/** * Copyright 2004-present Facebook. All Rights Reserved. */ var tests = [ () => { // erroneous typcasts raise errors... - var n = (\"hey\" : number); - // ...but \'any\' does dynamic downcasts, if you must - var x: number = (\"hey\": any); - var y = ((\"hey\": any): number); + var n = (\\"hey\\" : number); + // ...but 'any' does dynamic downcasts, if you must + var x: number = (\\"hey\\": any); + var y = ((\\"hey\\": any): number); }, () => { // typecasts in sequences // (parens always required around typecasts) - var s: string = ((0: number), (\"hey\": string)); + var s: string = ((0: number), (\\"hey\\": string)); }, () => { @@ -32,16 +34,16 @@ var tests = [ var tests = [ () => { // erroneous typcasts raise errors... - var n = (\"hey\": number); - // ...but \'any\' does dynamic downcasts, if you must - var x: number = (\"hey\": any); - var y = ((\"hey\": any): number); + var n = (\\"hey\\": number); + // ...but 'any' does dynamic downcasts, if you must + var x: number = (\\"hey\\": any); + var y = ((\\"hey\\": any): number); }, () => { // typecasts in sequences // (parens always required around typecasts) - var s: string = ((0: number), (\"hey\": string)); + var s: string = ((0: number), (\\"hey\\": string)); }, () => { diff --git a/tests/flow/typeof/__snapshots__/jsfmt.spec.js.snap b/tests/flow/typeof/__snapshots__/jsfmt.spec.js.snap index d64e21a25..d32615f67 100644 --- a/tests/flow/typeof/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/typeof/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test typeof.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typeof.js 1`] = ` "/** * @flow */ @@ -23,7 +25,7 @@ var a: MyClass1 = new MyClass1(); // of the class value itself with the type of its // instances. -// Aside: it\'s worth staring at the following (correct) +// Aside: it's worth staring at the following (correct) // type annotations until they make sense: // // MyClass1 : Class @@ -59,7 +61,7 @@ var c: typeof MyClass2 = new MyClass2(); var numValue:number = 42; var d: typeof numValue = 100; -var e: typeof numValue = \'asdf\'; // Error: string ~> number +var e: typeof numValue = 'asdf'; // Error: string ~> number ///////////////////////////////// // == typeof <> == // @@ -69,18 +71,18 @@ type numberAlias = number; // This is an error because typeof takes a value, not // a type, as an argument. However, the current error -// is suboptimal - just \'cannot resolve name\'. TODO. +// is suboptimal - just 'cannot resolve name'. TODO. // -var f: typeof numberAlias = 42; // Error: \'typeof <>\' makes no sense... +var f: typeof numberAlias = 42; // Error: 'typeof <>' makes no sense... /** * Use of a non-class/non-function value in type annotation. * These provoke a specific error, not just the generic - * \"type is incompatible\" + * \\"type is incompatible\\" */ - var Map = { \"A\": \"this is A\", \"B\": \"this is B\", \"C\": \"this is C\" }; - var keys: $Keys = \"A\"; // Error: ineligible value used in type anno + var Map = { \\"A\\": \\"this is A\\", \\"B\\": \\"this is B\\", \\"C\\": \\"this is C\\" }; + var keys: $Keys = \\"A\\"; // Error: ineligible value used in type anno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * @flow @@ -108,7 +110,7 @@ var a: MyClass1 = new MyClass1(); // of the class value itself with the type of its // instances. -// Aside: it\'s worth staring at the following (correct) +// Aside: it's worth staring at the following (correct) // type annotations until they make sense: // // MyClass1 : Class @@ -146,7 +148,7 @@ var c: typeof MyClass2 = new MyClass2(); var numValue: number = 42; var d: typeof numValue = 100; -var e: typeof numValue = \"asdf\"; // Error: string ~> number +var e: typeof numValue = \\"asdf\\"; // Error: string ~> number ///////////////////////////////// // == typeof <> == // @@ -156,17 +158,17 @@ type numberAlias = number; // This is an error because typeof takes a value, not // a type, as an argument. However, the current error -// is suboptimal - just \'cannot resolve name\'. TODO. +// is suboptimal - just 'cannot resolve name'. TODO. // -var f: typeof numberAlias = 42; // Error: \'typeof <>\' makes no sense... +var f: typeof numberAlias = 42; // Error: 'typeof <>' makes no sense... /** * Use of a non-class/non-function value in type annotation. * These provoke a specific error, not just the generic - * \"type is incompatible\" + * \\"type is incompatible\\" */ -var Map = { A: \"this is A\", B: \"this is B\", C: \"this is C\" }; -var keys: $Keys = \"A\"; // Error: ineligible value used in type anno +var Map = { A: \\"this is A\\", B: \\"this is B\\", C: \\"this is C\\" }; +var keys: $Keys = \\"A\\"; // Error: ineligible value used in type anno " `; diff --git a/tests/flow/unary/__snapshots__/jsfmt.spec.js.snap b/tests/flow/unary/__snapshots__/jsfmt.spec.js.snap index aef906d5b..e45116194 100644 --- a/tests/flow/unary/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/unary/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test unary.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`unary.js 1`] = ` "/* @flow */ function x0(y: string): number { @@ -6,11 +8,11 @@ function x0(y: string): number { } function x1(y: string): number { - return -y; // error, we don\'t allow coercion here + return -y; // error, we don't allow coercion here } function x3(y: string) { - return ~y; // error, we don\'t allow coercion here + return ~y; // error, we don't allow coercion here } function x4(y: string): boolean { @@ -26,11 +28,11 @@ function x0(y: string): number { } function x1(y: string): number { - return -y; // error, we don\'t allow coercion here + return -y; // error, we don't allow coercion here } function x3(y: string) { - return ~y; // error, we don\'t allow coercion here + return ~y; // error, we don't allow coercion here } function x4(y: string): boolean { @@ -41,7 +43,7 @@ function x4(y: string): boolean { " `; -exports[`test update.js 1`] = ` +exports[`update.js 1`] = ` "// @flow let tests = [ @@ -53,27 +55,27 @@ let tests = [ }, function(y: string) { - y++; // error, we don\'t allow coercion here + y++; // error, we don't allow coercion here (y: number); // ok, y is a number now - y++; // error, but you still can\'t write a number to a string + y++; // error, but you still can't write a number to a string }, function(y: string) { - y--; // error, we don\'t allow coercion here + y--; // error, we don't allow coercion here }, function(y: string) { - ++y; // error, we don\'t allow coercion here + ++y; // error, we don't allow coercion here }, function(y: string) { - --y; // error, we don\'t allow coercion here + --y; // error, we don't allow coercion here }, function() { const y = 123; - y++; // error, can\'t update const - y--; // error, can\'t update const + y++; // error, can't update const + y--; // error, can't update const }, function(y: any) { @@ -92,27 +94,27 @@ let tests = [ }, function(y: string) { - y++; // error, we don\'t allow coercion here + y++; // error, we don't allow coercion here (y: number); // ok, y is a number now - y++; // error, but you still can\'t write a number to a string + y++; // error, but you still can't write a number to a string }, function(y: string) { - y--; // error, we don\'t allow coercion here + y--; // error, we don't allow coercion here }, function(y: string) { - ++y; // error, we don\'t allow coercion here + ++y; // error, we don't allow coercion here }, function(y: string) { - --y; // error, we don\'t allow coercion here + --y; // error, we don't allow coercion here }, function() { const y = 123; - y++; // error, can\'t update const - y--; // error, can\'t update const + y++; // error, can't update const + y--; // error, can't update const }, function(y: any) { diff --git a/tests/flow/unchecked_haste_module_vs_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/unchecked_haste_module_vs_lib/__snapshots__/jsfmt.spec.js.snap index 664ac1e22..4e080e5c9 100644 --- a/tests/flow/unchecked_haste_module_vs_lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/unchecked_haste_module_vs_lib/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test buffer.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`buffer.js 1`] = ` "/** * @providesModule buffer * * Not in flow. * If this module is successfully imported/required, its - * type will be Any, so arbitraty uses won\'t cause errors. + * type will be Any, so arbitraty uses won't cause errors. * However, if a library module declaration is bound to * the same name as an unchecked module, it will be used * to satisfy imports/requires instead. @@ -17,7 +19,7 @@ export var INSPECT_MAX_BYTES = 0; * * Not in flow. * If this module is successfully imported/required, its - * type will be Any, so arbitraty uses won\'t cause errors. + * type will be Any, so arbitraty uses won't cause errors. * However, if a library module declaration is bound to * the same name as an unchecked module, it will be used * to satisfy imports/requires instead. @@ -27,19 +29,19 @@ export var INSPECT_MAX_BYTES = 0; " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "/** * Copyright 2004-present Facebook. All Rights Reserved. * @flow */ -/* \'buffer\' is the name of both an unchecked module in this directory, +/* 'buffer' is the name of both an unchecked module in this directory, * and a module declared in library file node.js. * If the require below resolves to the unchecked module, the mistyping * that follows will cause no errors, but if we resolve to the library - * instead, we\'ll get the desired error. + * instead, we'll get the desired error. */ -var buffer = require(\"buffer\"); +var buffer = require(\\"buffer\\"); var x: string = buffer.INSPECT_MAX_BYTES; // error, number ~/> string ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** @@ -47,13 +49,13 @@ var x: string = buffer.INSPECT_MAX_BYTES; // error, number ~/> string * @flow */ -/* \'buffer\' is the name of both an unchecked module in this directory, +/* 'buffer' is the name of both an unchecked module in this directory, * and a module declared in library file node.js. * If the require below resolves to the unchecked module, the mistyping * that follows will cause no errors, but if we resolve to the library - * instead, we\'ll get the desired error. + * instead, we'll get the desired error. */ -var buffer = require(\"buffer\"); +var buffer = require(\\"buffer\\"); var x: string = buffer.INSPECT_MAX_BYTES; // error, number ~/> string " `; diff --git a/tests/flow/unchecked_node_module_vs_lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/unchecked_node_module_vs_lib/__snapshots__/jsfmt.spec.js.snap index 128511cab..b14bdf32e 100644 --- a/tests/flow/unchecked_node_module_vs_lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/unchecked_node_module_vs_lib/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "/** * Test resolution precedence in node: * checked module > lib def > unchecked module @@ -7,23 +9,23 @@ exports[`test test.js 1`] = ` */ // node_modules/buffer/index.js is unchecked, -// so we shouldn\'t pick up its boolean redefinition of INSPECT_MAX_BYTES +// so we shouldn't pick up its boolean redefinition of INSPECT_MAX_BYTES // -var buffer = require(\"buffer\"); +var buffer = require(\\"buffer\\"); var b: boolean = buffer.INSPECT_MAX_BYTES; // error, number ~/> boolean // node_modules/crypto/index.js is checked, // so we should pick up its boolean redefinition of DEFAULT_ENCODING // -var crypto = require(\"crypto\"); -var b: boolean = crypto.DEFAULT_ENCODING; // no error, we\'ve overridden +var crypto = require(\\"crypto\\"); +var b: boolean = crypto.DEFAULT_ENCODING; // no error, we've overridden -// names that are explicit paths shouldn\'t fall back to lib defs +// names that are explicit paths shouldn't fall back to lib defs // -var buffer2 = require(\"./buffer\"); +var buffer2 = require(\\"./buffer\\"); var x2: string = buffer2.INSPECT_MAX_BYTES; // error, module not found -var buffer3 = require(\"./buffer.js\"); +var buffer3 = require(\\"./buffer.js\\"); var x3: string = buffer3.INSPECT_MAX_BYTES; // error, module not found ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** @@ -34,23 +36,23 @@ var x3: string = buffer3.INSPECT_MAX_BYTES; // error, module not found */ // node_modules/buffer/index.js is unchecked, -// so we shouldn\'t pick up its boolean redefinition of INSPECT_MAX_BYTES +// so we shouldn't pick up its boolean redefinition of INSPECT_MAX_BYTES // -var buffer = require(\"buffer\"); +var buffer = require(\\"buffer\\"); var b: boolean = buffer.INSPECT_MAX_BYTES; // error, number ~/> boolean // node_modules/crypto/index.js is checked, // so we should pick up its boolean redefinition of DEFAULT_ENCODING // -var crypto = require(\"crypto\"); -var b: boolean = crypto.DEFAULT_ENCODING; // no error, we\'ve overridden +var crypto = require(\\"crypto\\"); +var b: boolean = crypto.DEFAULT_ENCODING; // no error, we've overridden -// names that are explicit paths shouldn\'t fall back to lib defs +// names that are explicit paths shouldn't fall back to lib defs // -var buffer2 = require(\"./buffer\"); +var buffer2 = require(\\"./buffer\\"); var x2: string = buffer2.INSPECT_MAX_BYTES; // error, module not found -var buffer3 = require(\"./buffer.js\"); +var buffer3 = require(\\"./buffer.js\\"); var x3: string = buffer3.INSPECT_MAX_BYTES; // error, module not found " `; diff --git a/tests/flow/undefined/__snapshots__/jsfmt.spec.js.snap b/tests/flow/undefined/__snapshots__/jsfmt.spec.js.snap index a340f78ef..0a01d5739 100644 --- a/tests/flow/undefined/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/undefined/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test issue-518.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`issue-518.js 1`] = ` "function doSomethingAsync(): Promise { return new Promise((resolve, reject) => { resolve(); // OK to leave out arg, same as resolve(undefined) @@ -27,7 +29,7 @@ foo(); " `; -exports[`test undefined.js 1`] = ` +exports[`undefined.js 1`] = ` "function foo() { var x; x.foo(); @@ -38,7 +40,7 @@ function bar() { if (x) x.bar(); } -function qux(x?: number, y:string = \"\", z) { } +function qux(x?: number, y:string = \\"\\", z) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function foo() { var x; @@ -50,28 +52,28 @@ function bar() { if (x) x.bar(); } -function qux(x?: number, y: string = \"\", z) {} +function qux(x?: number, y: string = \\"\\", z) {} " `; -exports[`test undefined2.js 1`] = ` +exports[`undefined2.js 1`] = ` "// @flow let tests = [ function(x: number) { var id; - var name = id ? \'John\' : undefined; + var name = id ? 'John' : undefined; (name: boolean); // error, string or void const bar = [ undefined, - \'bar\', + 'bar', ]; (bar[x]: boolean); // error, string or void }, function(x: number) { - var undefined = \'foo\'; + var undefined = 'foo'; (undefined: string); // ok var x; @@ -81,7 +83,7 @@ let tests = [ const bar = [ undefined, - \'bar\', + 'bar', ]; (bar[x]: boolean); // error, string only }, @@ -92,15 +94,15 @@ let tests = [ let tests = [ function(x: number) { var id; - var name = id ? \"John\" : undefined; + var name = id ? \\"John\\" : undefined; (name: boolean); // error, string or void - const bar = [undefined, \"bar\"]; + const bar = [undefined, \\"bar\\"]; (bar[x]: boolean); // error, string or void }, function(x: number) { - var undefined = \"foo\"; + var undefined = \\"foo\\"; (undefined: string); // ok var x; @@ -108,7 +110,7 @@ let tests = [ x[0]; // should error, could be void } - const bar = [undefined, \"bar\"]; + const bar = [undefined, \\"bar\\"]; (bar[x]: boolean); // error, string only } ]; diff --git a/tests/flow/unicode/__snapshots__/jsfmt.spec.js.snap b/tests/flow/unicode/__snapshots__/jsfmt.spec.js.snap index 693664a25..c1f814f2b 100644 --- a/tests/flow/unicode/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/unicode/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test UnicodeUtils.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`UnicodeUtils.js 1`] = ` "/** * @flow */ @@ -20,11 +22,11 @@ function inSurrogateRange(codeUnit) { * representing non-BMP characters ([U+10000..U+10FFFF]). * * Examples: - * - \'\\u0020\' => 1 - * - \'\\u3020\' => 1 - * - \'\\uD835\' => 2 - * - \'\\uD835\\uDDEF\' => 2 - * - \'\\uDDEF\' => 2 + * - '\\\\u0020' => 1 + * - '\\\\u3020' => 1 + * - '\\\\uD835' => 2 + * - '\\\\uD835\\\\uDDEF' => 2 + * - '\\\\uDDEF' => 2 * * @param {string} str Non-empty string * @param {number} pos Position in the string to look for one code unit @@ -54,11 +56,11 @@ function inSurrogateRange(codeUnit) { * representing non-BMP characters ([U+10000..U+10FFFF]). * * Examples: - * - \'\\u0020\' => 1 - * - \'\\u3020\' => 1 - * - \'\\uD835\' => 2 - * - \'\\uD835\\uDDEF\' => 2 - * - \'\\uDDEF\' => 2 + * - '\\\\u0020' => 1 + * - '\\\\u3020' => 1 + * - '\\\\uD835' => 2 + * - '\\\\uD835\\\\uDDEF' => 2 + * - '\\\\uDDEF' => 2 * * @param {string} str Non-empty string * @param {number} pos Position in the string to look for one code unit @@ -70,9 +72,9 @@ function utf16Length(str, pos) { " `; -exports[`test keys.js 1`] = ` -"({\'この事はつもり素晴らしいことさ\': \'35jL9V\'}) +exports[`keys.js 1`] = ` +"({'この事はつもり素晴らしいことさ': '35jL9V'}) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -({ \"この事はつもり素晴らしいことさ\": \"35jL9V\" }); +({ \\"この事はつもり素晴らしいことさ\\": \\"35jL9V\\" }); " `; diff --git a/tests/flow/union-intersection/__snapshots__/jsfmt.spec.js.snap b/tests/flow/union-intersection/__snapshots__/jsfmt.spec.js.snap index 38df242d7..e7fbe2880 100644 --- a/tests/flow/union-intersection/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/union-intersection/__snapshots__/jsfmt.spec.js.snap @@ -1,4004 +1,4006 @@ -exports[`test gen_big_disjoint_union.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`gen_big_disjoint_union.js 1`] = ` "// perf test for big disjoint union with 1000 cases type TAction = { - type: \'a1\', + type: 'a1', a1: number, } | { - type: \'a2\', + type: 'a2', a1: number, } | { - type: \'a3\', + type: 'a3', a1: number, } | { - type: \'a4\', + type: 'a4', a1: number, } | { - type: \'a5\', + type: 'a5', a1: number, } | { - type: \'a6\', + type: 'a6', a1: number, } | { - type: \'a7\', + type: 'a7', a1: number, } | { - type: \'a8\', + type: 'a8', a1: number, } | { - type: \'a9\', + type: 'a9', a1: number, } | { - type: \'a10\', + type: 'a10', a1: number, } | { - type: \'a11\', + type: 'a11', a2: number, } | { - type: \'a12\', + type: 'a12', a2: number, } | { - type: \'a13\', + type: 'a13', a2: number, } | { - type: \'a14\', + type: 'a14', a2: number, } | { - type: \'a15\', + type: 'a15', a2: number, } | { - type: \'a16\', + type: 'a16', a2: number, } | { - type: \'a17\', + type: 'a17', a2: number, } | { - type: \'a18\', + type: 'a18', a2: number, } | { - type: \'a19\', + type: 'a19', a2: number, } | { - type: \'a20\', + type: 'a20', a2: number, } | { - type: \'a21\', + type: 'a21', a3: number, } | { - type: \'a22\', + type: 'a22', a3: number, } | { - type: \'a23\', + type: 'a23', a3: number, } | { - type: \'a24\', + type: 'a24', a3: number, } | { - type: \'a25\', + type: 'a25', a3: number, } | { - type: \'a26\', + type: 'a26', a3: number, } | { - type: \'a27\', + type: 'a27', a3: number, } | { - type: \'a28\', + type: 'a28', a3: number, } | { - type: \'a29\', + type: 'a29', a3: number, } | { - type: \'a30\', + type: 'a30', a3: number, } | { - type: \'a31\', + type: 'a31', a4: number, } | { - type: \'a32\', + type: 'a32', a4: number, } | { - type: \'a33\', + type: 'a33', a4: number, } | { - type: \'a34\', + type: 'a34', a4: number, } | { - type: \'a35\', + type: 'a35', a4: number, } | { - type: \'a36\', + type: 'a36', a4: number, } | { - type: \'a37\', + type: 'a37', a4: number, } | { - type: \'a38\', + type: 'a38', a4: number, } | { - type: \'a39\', + type: 'a39', a4: number, } | { - type: \'a40\', + type: 'a40', a4: number, } | { - type: \'a41\', + type: 'a41', a5: number, } | { - type: \'a42\', + type: 'a42', a5: number, } | { - type: \'a43\', + type: 'a43', a5: number, } | { - type: \'a44\', + type: 'a44', a5: number, } | { - type: \'a45\', + type: 'a45', a5: number, } | { - type: \'a46\', + type: 'a46', a5: number, } | { - type: \'a47\', + type: 'a47', a5: number, } | { - type: \'a48\', + type: 'a48', a5: number, } | { - type: \'a49\', + type: 'a49', a5: number, } | { - type: \'a50\', + type: 'a50', a5: number, } | { - type: \'a51\', + type: 'a51', a6: number, } | { - type: \'a52\', + type: 'a52', a6: number, } | { - type: \'a53\', + type: 'a53', a6: number, } | { - type: \'a54\', + type: 'a54', a6: number, } | { - type: \'a55\', + type: 'a55', a6: number, } | { - type: \'a56\', + type: 'a56', a6: number, } | { - type: \'a57\', + type: 'a57', a6: number, } | { - type: \'a58\', + type: 'a58', a6: number, } | { - type: \'a59\', + type: 'a59', a6: number, } | { - type: \'a60\', + type: 'a60', a6: number, } | { - type: \'a61\', + type: 'a61', a7: number, } | { - type: \'a62\', + type: 'a62', a7: number, } | { - type: \'a63\', + type: 'a63', a7: number, } | { - type: \'a64\', + type: 'a64', a7: number, } | { - type: \'a65\', + type: 'a65', a7: number, } | { - type: \'a66\', + type: 'a66', a7: number, } | { - type: \'a67\', + type: 'a67', a7: number, } | { - type: \'a68\', + type: 'a68', a7: number, } | { - type: \'a69\', + type: 'a69', a7: number, } | { - type: \'a70\', + type: 'a70', a7: number, } | { - type: \'a71\', + type: 'a71', a8: number, } | { - type: \'a72\', + type: 'a72', a8: number, } | { - type: \'a73\', + type: 'a73', a8: number, } | { - type: \'a74\', + type: 'a74', a8: number, } | { - type: \'a75\', + type: 'a75', a8: number, } | { - type: \'a76\', + type: 'a76', a8: number, } | { - type: \'a77\', + type: 'a77', a8: number, } | { - type: \'a78\', + type: 'a78', a8: number, } | { - type: \'a79\', + type: 'a79', a8: number, } | { - type: \'a80\', + type: 'a80', a8: number, } | { - type: \'a81\', + type: 'a81', a9: number, } | { - type: \'a82\', + type: 'a82', a9: number, } | { - type: \'a83\', + type: 'a83', a9: number, } | { - type: \'a84\', + type: 'a84', a9: number, } | { - type: \'a85\', + type: 'a85', a9: number, } | { - type: \'a86\', + type: 'a86', a9: number, } | { - type: \'a87\', + type: 'a87', a9: number, } | { - type: \'a88\', + type: 'a88', a9: number, } | { - type: \'a89\', + type: 'a89', a9: number, } | { - type: \'a90\', + type: 'a90', a9: number, } | { - type: \'a91\', + type: 'a91', a10: number, } | { - type: \'a92\', + type: 'a92', a10: number, } | { - type: \'a93\', + type: 'a93', a10: number, } | { - type: \'a94\', + type: 'a94', a10: number, } | { - type: \'a95\', + type: 'a95', a10: number, } | { - type: \'a96\', + type: 'a96', a10: number, } | { - type: \'a97\', + type: 'a97', a10: number, } | { - type: \'a98\', + type: 'a98', a10: number, } | { - type: \'a99\', + type: 'a99', a10: number, } | { - type: \'a100\', + type: 'a100', a10: number, } | { - type: \'a101\', + type: 'a101', a11: number, } | { - type: \'a102\', + type: 'a102', a11: number, } | { - type: \'a103\', + type: 'a103', a11: number, } | { - type: \'a104\', + type: 'a104', a11: number, } | { - type: \'a105\', + type: 'a105', a11: number, } | { - type: \'a106\', + type: 'a106', a11: number, } | { - type: \'a107\', + type: 'a107', a11: number, } | { - type: \'a108\', + type: 'a108', a11: number, } | { - type: \'a109\', + type: 'a109', a11: number, } | { - type: \'a110\', + type: 'a110', a11: number, } | { - type: \'a111\', + type: 'a111', a12: number, } | { - type: \'a112\', + type: 'a112', a12: number, } | { - type: \'a113\', + type: 'a113', a12: number, } | { - type: \'a114\', + type: 'a114', a12: number, } | { - type: \'a115\', + type: 'a115', a12: number, } | { - type: \'a116\', + type: 'a116', a12: number, } | { - type: \'a117\', + type: 'a117', a12: number, } | { - type: \'a118\', + type: 'a118', a12: number, } | { - type: \'a119\', + type: 'a119', a12: number, } | { - type: \'a120\', + type: 'a120', a12: number, } | { - type: \'a121\', + type: 'a121', a13: number, } | { - type: \'a122\', + type: 'a122', a13: number, } | { - type: \'a123\', + type: 'a123', a13: number, } | { - type: \'a124\', + type: 'a124', a13: number, } | { - type: \'a125\', + type: 'a125', a13: number, } | { - type: \'a126\', + type: 'a126', a13: number, } | { - type: \'a127\', + type: 'a127', a13: number, } | { - type: \'a128\', + type: 'a128', a13: number, } | { - type: \'a129\', + type: 'a129', a13: number, } | { - type: \'a130\', + type: 'a130', a13: number, } | { - type: \'a131\', + type: 'a131', a14: number, } | { - type: \'a132\', + type: 'a132', a14: number, } | { - type: \'a133\', + type: 'a133', a14: number, } | { - type: \'a134\', + type: 'a134', a14: number, } | { - type: \'a135\', + type: 'a135', a14: number, } | { - type: \'a136\', + type: 'a136', a14: number, } | { - type: \'a137\', + type: 'a137', a14: number, } | { - type: \'a138\', + type: 'a138', a14: number, } | { - type: \'a139\', + type: 'a139', a14: number, } | { - type: \'a140\', + type: 'a140', a14: number, } | { - type: \'a141\', + type: 'a141', a15: number, } | { - type: \'a142\', + type: 'a142', a15: number, } | { - type: \'a143\', + type: 'a143', a15: number, } | { - type: \'a144\', + type: 'a144', a15: number, } | { - type: \'a145\', + type: 'a145', a15: number, } | { - type: \'a146\', + type: 'a146', a15: number, } | { - type: \'a147\', + type: 'a147', a15: number, } | { - type: \'a148\', + type: 'a148', a15: number, } | { - type: \'a149\', + type: 'a149', a15: number, } | { - type: \'a150\', + type: 'a150', a15: number, } | { - type: \'a151\', + type: 'a151', a16: number, } | { - type: \'a152\', + type: 'a152', a16: number, } | { - type: \'a153\', + type: 'a153', a16: number, } | { - type: \'a154\', + type: 'a154', a16: number, } | { - type: \'a155\', + type: 'a155', a16: number, } | { - type: \'a156\', + type: 'a156', a16: number, } | { - type: \'a157\', + type: 'a157', a16: number, } | { - type: \'a158\', + type: 'a158', a16: number, } | { - type: \'a159\', + type: 'a159', a16: number, } | { - type: \'a160\', + type: 'a160', a16: number, } | { - type: \'a161\', + type: 'a161', a17: number, } | { - type: \'a162\', + type: 'a162', a17: number, } | { - type: \'a163\', + type: 'a163', a17: number, } | { - type: \'a164\', + type: 'a164', a17: number, } | { - type: \'a165\', + type: 'a165', a17: number, } | { - type: \'a166\', + type: 'a166', a17: number, } | { - type: \'a167\', + type: 'a167', a17: number, } | { - type: \'a168\', + type: 'a168', a17: number, } | { - type: \'a169\', + type: 'a169', a17: number, } | { - type: \'a170\', + type: 'a170', a17: number, } | { - type: \'a171\', + type: 'a171', a18: number, } | { - type: \'a172\', + type: 'a172', a18: number, } | { - type: \'a173\', + type: 'a173', a18: number, } | { - type: \'a174\', + type: 'a174', a18: number, } | { - type: \'a175\', + type: 'a175', a18: number, } | { - type: \'a176\', + type: 'a176', a18: number, } | { - type: \'a177\', + type: 'a177', a18: number, } | { - type: \'a178\', + type: 'a178', a18: number, } | { - type: \'a179\', + type: 'a179', a18: number, } | { - type: \'a180\', + type: 'a180', a18: number, } | { - type: \'a181\', + type: 'a181', a19: number, } | { - type: \'a182\', + type: 'a182', a19: number, } | { - type: \'a183\', + type: 'a183', a19: number, } | { - type: \'a184\', + type: 'a184', a19: number, } | { - type: \'a185\', + type: 'a185', a19: number, } | { - type: \'a186\', + type: 'a186', a19: number, } | { - type: \'a187\', + type: 'a187', a19: number, } | { - type: \'a188\', + type: 'a188', a19: number, } | { - type: \'a189\', + type: 'a189', a19: number, } | { - type: \'a190\', + type: 'a190', a19: number, } | { - type: \'a191\', + type: 'a191', a20: number, } | { - type: \'a192\', + type: 'a192', a20: number, } | { - type: \'a193\', + type: 'a193', a20: number, } | { - type: \'a194\', + type: 'a194', a20: number, } | { - type: \'a195\', + type: 'a195', a20: number, } | { - type: \'a196\', + type: 'a196', a20: number, } | { - type: \'a197\', + type: 'a197', a20: number, } | { - type: \'a198\', + type: 'a198', a20: number, } | { - type: \'a199\', + type: 'a199', a20: number, } | { - type: \'a200\', + type: 'a200', a20: number, } | { - type: \'a201\', + type: 'a201', a21: number, } | { - type: \'a202\', + type: 'a202', a21: number, } | { - type: \'a203\', + type: 'a203', a21: number, } | { - type: \'a204\', + type: 'a204', a21: number, } | { - type: \'a205\', + type: 'a205', a21: number, } | { - type: \'a206\', + type: 'a206', a21: number, } | { - type: \'a207\', + type: 'a207', a21: number, } | { - type: \'a208\', + type: 'a208', a21: number, } | { - type: \'a209\', + type: 'a209', a21: number, } | { - type: \'a210\', + type: 'a210', a21: number, } | { - type: \'a211\', + type: 'a211', a22: number, } | { - type: \'a212\', + type: 'a212', a22: number, } | { - type: \'a213\', + type: 'a213', a22: number, } | { - type: \'a214\', + type: 'a214', a22: number, } | { - type: \'a215\', + type: 'a215', a22: number, } | { - type: \'a216\', + type: 'a216', a22: number, } | { - type: \'a217\', + type: 'a217', a22: number, } | { - type: \'a218\', + type: 'a218', a22: number, } | { - type: \'a219\', + type: 'a219', a22: number, } | { - type: \'a220\', + type: 'a220', a22: number, } | { - type: \'a221\', + type: 'a221', a23: number, } | { - type: \'a222\', + type: 'a222', a23: number, } | { - type: \'a223\', + type: 'a223', a23: number, } | { - type: \'a224\', + type: 'a224', a23: number, } | { - type: \'a225\', + type: 'a225', a23: number, } | { - type: \'a226\', + type: 'a226', a23: number, } | { - type: \'a227\', + type: 'a227', a23: number, } | { - type: \'a228\', + type: 'a228', a23: number, } | { - type: \'a229\', + type: 'a229', a23: number, } | { - type: \'a230\', + type: 'a230', a23: number, } | { - type: \'a231\', + type: 'a231', a24: number, } | { - type: \'a232\', + type: 'a232', a24: number, } | { - type: \'a233\', + type: 'a233', a24: number, } | { - type: \'a234\', + type: 'a234', a24: number, } | { - type: \'a235\', + type: 'a235', a24: number, } | { - type: \'a236\', + type: 'a236', a24: number, } | { - type: \'a237\', + type: 'a237', a24: number, } | { - type: \'a238\', + type: 'a238', a24: number, } | { - type: \'a239\', + type: 'a239', a24: number, } | { - type: \'a240\', + type: 'a240', a24: number, } | { - type: \'a241\', + type: 'a241', a25: number, } | { - type: \'a242\', + type: 'a242', a25: number, } | { - type: \'a243\', + type: 'a243', a25: number, } | { - type: \'a244\', + type: 'a244', a25: number, } | { - type: \'a245\', + type: 'a245', a25: number, } | { - type: \'a246\', + type: 'a246', a25: number, } | { - type: \'a247\', + type: 'a247', a25: number, } | { - type: \'a248\', + type: 'a248', a25: number, } | { - type: \'a249\', + type: 'a249', a25: number, } | { - type: \'a250\', + type: 'a250', a25: number, } | { - type: \'a251\', + type: 'a251', a26: number, } | { - type: \'a252\', + type: 'a252', a26: number, } | { - type: \'a253\', + type: 'a253', a26: number, } | { - type: \'a254\', + type: 'a254', a26: number, } | { - type: \'a255\', + type: 'a255', a26: number, } | { - type: \'a256\', + type: 'a256', a26: number, } | { - type: \'a257\', + type: 'a257', a26: number, } | { - type: \'a258\', + type: 'a258', a26: number, } | { - type: \'a259\', + type: 'a259', a26: number, } | { - type: \'a260\', + type: 'a260', a26: number, } | { - type: \'a261\', + type: 'a261', a27: number, } | { - type: \'a262\', + type: 'a262', a27: number, } | { - type: \'a263\', + type: 'a263', a27: number, } | { - type: \'a264\', + type: 'a264', a27: number, } | { - type: \'a265\', + type: 'a265', a27: number, } | { - type: \'a266\', + type: 'a266', a27: number, } | { - type: \'a267\', + type: 'a267', a27: number, } | { - type: \'a268\', + type: 'a268', a27: number, } | { - type: \'a269\', + type: 'a269', a27: number, } | { - type: \'a270\', + type: 'a270', a27: number, } | { - type: \'a271\', + type: 'a271', a28: number, } | { - type: \'a272\', + type: 'a272', a28: number, } | { - type: \'a273\', + type: 'a273', a28: number, } | { - type: \'a274\', + type: 'a274', a28: number, } | { - type: \'a275\', + type: 'a275', a28: number, } | { - type: \'a276\', + type: 'a276', a28: number, } | { - type: \'a277\', + type: 'a277', a28: number, } | { - type: \'a278\', + type: 'a278', a28: number, } | { - type: \'a279\', + type: 'a279', a28: number, } | { - type: \'a280\', + type: 'a280', a28: number, } | { - type: \'a281\', + type: 'a281', a29: number, } | { - type: \'a282\', + type: 'a282', a29: number, } | { - type: \'a283\', + type: 'a283', a29: number, } | { - type: \'a284\', + type: 'a284', a29: number, } | { - type: \'a285\', + type: 'a285', a29: number, } | { - type: \'a286\', + type: 'a286', a29: number, } | { - type: \'a287\', + type: 'a287', a29: number, } | { - type: \'a288\', + type: 'a288', a29: number, } | { - type: \'a289\', + type: 'a289', a29: number, } | { - type: \'a290\', + type: 'a290', a29: number, } | { - type: \'a291\', + type: 'a291', a30: number, } | { - type: \'a292\', + type: 'a292', a30: number, } | { - type: \'a293\', + type: 'a293', a30: number, } | { - type: \'a294\', + type: 'a294', a30: number, } | { - type: \'a295\', + type: 'a295', a30: number, } | { - type: \'a296\', + type: 'a296', a30: number, } | { - type: \'a297\', + type: 'a297', a30: number, } | { - type: \'a298\', + type: 'a298', a30: number, } | { - type: \'a299\', + type: 'a299', a30: number, } | { - type: \'a300\', + type: 'a300', a30: number, } | { - type: \'a301\', + type: 'a301', a31: number, } | { - type: \'a302\', + type: 'a302', a31: number, } | { - type: \'a303\', + type: 'a303', a31: number, } | { - type: \'a304\', + type: 'a304', a31: number, } | { - type: \'a305\', + type: 'a305', a31: number, } | { - type: \'a306\', + type: 'a306', a31: number, } | { - type: \'a307\', + type: 'a307', a31: number, } | { - type: \'a308\', + type: 'a308', a31: number, } | { - type: \'a309\', + type: 'a309', a31: number, } | { - type: \'a310\', + type: 'a310', a31: number, } | { - type: \'a311\', + type: 'a311', a32: number, } | { - type: \'a312\', + type: 'a312', a32: number, } | { - type: \'a313\', + type: 'a313', a32: number, } | { - type: \'a314\', + type: 'a314', a32: number, } | { - type: \'a315\', + type: 'a315', a32: number, } | { - type: \'a316\', + type: 'a316', a32: number, } | { - type: \'a317\', + type: 'a317', a32: number, } | { - type: \'a318\', + type: 'a318', a32: number, } | { - type: \'a319\', + type: 'a319', a32: number, } | { - type: \'a320\', + type: 'a320', a32: number, } | { - type: \'a321\', + type: 'a321', a33: number, } | { - type: \'a322\', + type: 'a322', a33: number, } | { - type: \'a323\', + type: 'a323', a33: number, } | { - type: \'a324\', + type: 'a324', a33: number, } | { - type: \'a325\', + type: 'a325', a33: number, } | { - type: \'a326\', + type: 'a326', a33: number, } | { - type: \'a327\', + type: 'a327', a33: number, } | { - type: \'a328\', + type: 'a328', a33: number, } | { - type: \'a329\', + type: 'a329', a33: number, } | { - type: \'a330\', + type: 'a330', a33: number, } | { - type: \'a331\', + type: 'a331', a34: number, } | { - type: \'a332\', + type: 'a332', a34: number, } | { - type: \'a333\', + type: 'a333', a34: number, } | { - type: \'a334\', + type: 'a334', a34: number, } | { - type: \'a335\', + type: 'a335', a34: number, } | { - type: \'a336\', + type: 'a336', a34: number, } | { - type: \'a337\', + type: 'a337', a34: number, } | { - type: \'a338\', + type: 'a338', a34: number, } | { - type: \'a339\', + type: 'a339', a34: number, } | { - type: \'a340\', + type: 'a340', a34: number, } | { - type: \'a341\', + type: 'a341', a35: number, } | { - type: \'a342\', + type: 'a342', a35: number, } | { - type: \'a343\', + type: 'a343', a35: number, } | { - type: \'a344\', + type: 'a344', a35: number, } | { - type: \'a345\', + type: 'a345', a35: number, } | { - type: \'a346\', + type: 'a346', a35: number, } | { - type: \'a347\', + type: 'a347', a35: number, } | { - type: \'a348\', + type: 'a348', a35: number, } | { - type: \'a349\', + type: 'a349', a35: number, } | { - type: \'a350\', + type: 'a350', a35: number, } | { - type: \'a351\', + type: 'a351', a36: number, } | { - type: \'a352\', + type: 'a352', a36: number, } | { - type: \'a353\', + type: 'a353', a36: number, } | { - type: \'a354\', + type: 'a354', a36: number, } | { - type: \'a355\', + type: 'a355', a36: number, } | { - type: \'a356\', + type: 'a356', a36: number, } | { - type: \'a357\', + type: 'a357', a36: number, } | { - type: \'a358\', + type: 'a358', a36: number, } | { - type: \'a359\', + type: 'a359', a36: number, } | { - type: \'a360\', + type: 'a360', a36: number, } | { - type: \'a361\', + type: 'a361', a37: number, } | { - type: \'a362\', + type: 'a362', a37: number, } | { - type: \'a363\', + type: 'a363', a37: number, } | { - type: \'a364\', + type: 'a364', a37: number, } | { - type: \'a365\', + type: 'a365', a37: number, } | { - type: \'a366\', + type: 'a366', a37: number, } | { - type: \'a367\', + type: 'a367', a37: number, } | { - type: \'a368\', + type: 'a368', a37: number, } | { - type: \'a369\', + type: 'a369', a37: number, } | { - type: \'a370\', + type: 'a370', a37: number, } | { - type: \'a371\', + type: 'a371', a38: number, } | { - type: \'a372\', + type: 'a372', a38: number, } | { - type: \'a373\', + type: 'a373', a38: number, } | { - type: \'a374\', + type: 'a374', a38: number, } | { - type: \'a375\', + type: 'a375', a38: number, } | { - type: \'a376\', + type: 'a376', a38: number, } | { - type: \'a377\', + type: 'a377', a38: number, } | { - type: \'a378\', + type: 'a378', a38: number, } | { - type: \'a379\', + type: 'a379', a38: number, } | { - type: \'a380\', + type: 'a380', a38: number, } | { - type: \'a381\', + type: 'a381', a39: number, } | { - type: \'a382\', + type: 'a382', a39: number, } | { - type: \'a383\', + type: 'a383', a39: number, } | { - type: \'a384\', + type: 'a384', a39: number, } | { - type: \'a385\', + type: 'a385', a39: number, } | { - type: \'a386\', + type: 'a386', a39: number, } | { - type: \'a387\', + type: 'a387', a39: number, } | { - type: \'a388\', + type: 'a388', a39: number, } | { - type: \'a389\', + type: 'a389', a39: number, } | { - type: \'a390\', + type: 'a390', a39: number, } | { - type: \'a391\', + type: 'a391', a40: number, } | { - type: \'a392\', + type: 'a392', a40: number, } | { - type: \'a393\', + type: 'a393', a40: number, } | { - type: \'a394\', + type: 'a394', a40: number, } | { - type: \'a395\', + type: 'a395', a40: number, } | { - type: \'a396\', + type: 'a396', a40: number, } | { - type: \'a397\', + type: 'a397', a40: number, } | { - type: \'a398\', + type: 'a398', a40: number, } | { - type: \'a399\', + type: 'a399', a40: number, } | { - type: \'a400\', + type: 'a400', a40: number, } | { - type: \'a401\', + type: 'a401', a41: number, } | { - type: \'a402\', + type: 'a402', a41: number, } | { - type: \'a403\', + type: 'a403', a41: number, } | { - type: \'a404\', + type: 'a404', a41: number, } | { - type: \'a405\', + type: 'a405', a41: number, } | { - type: \'a406\', + type: 'a406', a41: number, } | { - type: \'a407\', + type: 'a407', a41: number, } | { - type: \'a408\', + type: 'a408', a41: number, } | { - type: \'a409\', + type: 'a409', a41: number, } | { - type: \'a410\', + type: 'a410', a41: number, } | { - type: \'a411\', + type: 'a411', a42: number, } | { - type: \'a412\', + type: 'a412', a42: number, } | { - type: \'a413\', + type: 'a413', a42: number, } | { - type: \'a414\', + type: 'a414', a42: number, } | { - type: \'a415\', + type: 'a415', a42: number, } | { - type: \'a416\', + type: 'a416', a42: number, } | { - type: \'a417\', + type: 'a417', a42: number, } | { - type: \'a418\', + type: 'a418', a42: number, } | { - type: \'a419\', + type: 'a419', a42: number, } | { - type: \'a420\', + type: 'a420', a42: number, } | { - type: \'a421\', + type: 'a421', a43: number, } | { - type: \'a422\', + type: 'a422', a43: number, } | { - type: \'a423\', + type: 'a423', a43: number, } | { - type: \'a424\', + type: 'a424', a43: number, } | { - type: \'a425\', + type: 'a425', a43: number, } | { - type: \'a426\', + type: 'a426', a43: number, } | { - type: \'a427\', + type: 'a427', a43: number, } | { - type: \'a428\', + type: 'a428', a43: number, } | { - type: \'a429\', + type: 'a429', a43: number, } | { - type: \'a430\', + type: 'a430', a43: number, } | { - type: \'a431\', + type: 'a431', a44: number, } | { - type: \'a432\', + type: 'a432', a44: number, } | { - type: \'a433\', + type: 'a433', a44: number, } | { - type: \'a434\', + type: 'a434', a44: number, } | { - type: \'a435\', + type: 'a435', a44: number, } | { - type: \'a436\', + type: 'a436', a44: number, } | { - type: \'a437\', + type: 'a437', a44: number, } | { - type: \'a438\', + type: 'a438', a44: number, } | { - type: \'a439\', + type: 'a439', a44: number, } | { - type: \'a440\', + type: 'a440', a44: number, } | { - type: \'a441\', + type: 'a441', a45: number, } | { - type: \'a442\', + type: 'a442', a45: number, } | { - type: \'a443\', + type: 'a443', a45: number, } | { - type: \'a444\', + type: 'a444', a45: number, } | { - type: \'a445\', + type: 'a445', a45: number, } | { - type: \'a446\', + type: 'a446', a45: number, } | { - type: \'a447\', + type: 'a447', a45: number, } | { - type: \'a448\', + type: 'a448', a45: number, } | { - type: \'a449\', + type: 'a449', a45: number, } | { - type: \'a450\', + type: 'a450', a45: number, } | { - type: \'a451\', + type: 'a451', a46: number, } | { - type: \'a452\', + type: 'a452', a46: number, } | { - type: \'a453\', + type: 'a453', a46: number, } | { - type: \'a454\', + type: 'a454', a46: number, } | { - type: \'a455\', + type: 'a455', a46: number, } | { - type: \'a456\', + type: 'a456', a46: number, } | { - type: \'a457\', + type: 'a457', a46: number, } | { - type: \'a458\', + type: 'a458', a46: number, } | { - type: \'a459\', + type: 'a459', a46: number, } | { - type: \'a460\', + type: 'a460', a46: number, } | { - type: \'a461\', + type: 'a461', a47: number, } | { - type: \'a462\', + type: 'a462', a47: number, } | { - type: \'a463\', + type: 'a463', a47: number, } | { - type: \'a464\', + type: 'a464', a47: number, } | { - type: \'a465\', + type: 'a465', a47: number, } | { - type: \'a466\', + type: 'a466', a47: number, } | { - type: \'a467\', + type: 'a467', a47: number, } | { - type: \'a468\', + type: 'a468', a47: number, } | { - type: \'a469\', + type: 'a469', a47: number, } | { - type: \'a470\', + type: 'a470', a47: number, } | { - type: \'a471\', + type: 'a471', a48: number, } | { - type: \'a472\', + type: 'a472', a48: number, } | { - type: \'a473\', + type: 'a473', a48: number, } | { - type: \'a474\', + type: 'a474', a48: number, } | { - type: \'a475\', + type: 'a475', a48: number, } | { - type: \'a476\', + type: 'a476', a48: number, } | { - type: \'a477\', + type: 'a477', a48: number, } | { - type: \'a478\', + type: 'a478', a48: number, } | { - type: \'a479\', + type: 'a479', a48: number, } | { - type: \'a480\', + type: 'a480', a48: number, } | { - type: \'a481\', + type: 'a481', a49: number, } | { - type: \'a482\', + type: 'a482', a49: number, } | { - type: \'a483\', + type: 'a483', a49: number, } | { - type: \'a484\', + type: 'a484', a49: number, } | { - type: \'a485\', + type: 'a485', a49: number, } | { - type: \'a486\', + type: 'a486', a49: number, } | { - type: \'a487\', + type: 'a487', a49: number, } | { - type: \'a488\', + type: 'a488', a49: number, } | { - type: \'a489\', + type: 'a489', a49: number, } | { - type: \'a490\', + type: 'a490', a49: number, } | { - type: \'a491\', + type: 'a491', a50: number, } | { - type: \'a492\', + type: 'a492', a50: number, } | { - type: \'a493\', + type: 'a493', a50: number, } | { - type: \'a494\', + type: 'a494', a50: number, } | { - type: \'a495\', + type: 'a495', a50: number, } | { - type: \'a496\', + type: 'a496', a50: number, } | { - type: \'a497\', + type: 'a497', a50: number, } | { - type: \'a498\', + type: 'a498', a50: number, } | { - type: \'a499\', + type: 'a499', a50: number, } | { - type: \'a500\', + type: 'a500', a50: number, } | { - type: \'a501\', + type: 'a501', a51: number, } | { - type: \'a502\', + type: 'a502', a51: number, } | { - type: \'a503\', + type: 'a503', a51: number, } | { - type: \'a504\', + type: 'a504', a51: number, } | { - type: \'a505\', + type: 'a505', a51: number, } | { - type: \'a506\', + type: 'a506', a51: number, } | { - type: \'a507\', + type: 'a507', a51: number, } | { - type: \'a508\', + type: 'a508', a51: number, } | { - type: \'a509\', + type: 'a509', a51: number, } | { - type: \'a510\', + type: 'a510', a51: number, } | { - type: \'a511\', + type: 'a511', a52: number, } | { - type: \'a512\', + type: 'a512', a52: number, } | { - type: \'a513\', + type: 'a513', a52: number, } | { - type: \'a514\', + type: 'a514', a52: number, } | { - type: \'a515\', + type: 'a515', a52: number, } | { - type: \'a516\', + type: 'a516', a52: number, } | { - type: \'a517\', + type: 'a517', a52: number, } | { - type: \'a518\', + type: 'a518', a52: number, } | { - type: \'a519\', + type: 'a519', a52: number, } | { - type: \'a520\', + type: 'a520', a52: number, } | { - type: \'a521\', + type: 'a521', a53: number, } | { - type: \'a522\', + type: 'a522', a53: number, } | { - type: \'a523\', + type: 'a523', a53: number, } | { - type: \'a524\', + type: 'a524', a53: number, } | { - type: \'a525\', + type: 'a525', a53: number, } | { - type: \'a526\', + type: 'a526', a53: number, } | { - type: \'a527\', + type: 'a527', a53: number, } | { - type: \'a528\', + type: 'a528', a53: number, } | { - type: \'a529\', + type: 'a529', a53: number, } | { - type: \'a530\', + type: 'a530', a53: number, } | { - type: \'a531\', + type: 'a531', a54: number, } | { - type: \'a532\', + type: 'a532', a54: number, } | { - type: \'a533\', + type: 'a533', a54: number, } | { - type: \'a534\', + type: 'a534', a54: number, } | { - type: \'a535\', + type: 'a535', a54: number, } | { - type: \'a536\', + type: 'a536', a54: number, } | { - type: \'a537\', + type: 'a537', a54: number, } | { - type: \'a538\', + type: 'a538', a54: number, } | { - type: \'a539\', + type: 'a539', a54: number, } | { - type: \'a540\', + type: 'a540', a54: number, } | { - type: \'a541\', + type: 'a541', a55: number, } | { - type: \'a542\', + type: 'a542', a55: number, } | { - type: \'a543\', + type: 'a543', a55: number, } | { - type: \'a544\', + type: 'a544', a55: number, } | { - type: \'a545\', + type: 'a545', a55: number, } | { - type: \'a546\', + type: 'a546', a55: number, } | { - type: \'a547\', + type: 'a547', a55: number, } | { - type: \'a548\', + type: 'a548', a55: number, } | { - type: \'a549\', + type: 'a549', a55: number, } | { - type: \'a550\', + type: 'a550', a55: number, } | { - type: \'a551\', + type: 'a551', a56: number, } | { - type: \'a552\', + type: 'a552', a56: number, } | { - type: \'a553\', + type: 'a553', a56: number, } | { - type: \'a554\', + type: 'a554', a56: number, } | { - type: \'a555\', + type: 'a555', a56: number, } | { - type: \'a556\', + type: 'a556', a56: number, } | { - type: \'a557\', + type: 'a557', a56: number, } | { - type: \'a558\', + type: 'a558', a56: number, } | { - type: \'a559\', + type: 'a559', a56: number, } | { - type: \'a560\', + type: 'a560', a56: number, } | { - type: \'a561\', + type: 'a561', a57: number, } | { - type: \'a562\', + type: 'a562', a57: number, } | { - type: \'a563\', + type: 'a563', a57: number, } | { - type: \'a564\', + type: 'a564', a57: number, } | { - type: \'a565\', + type: 'a565', a57: number, } | { - type: \'a566\', + type: 'a566', a57: number, } | { - type: \'a567\', + type: 'a567', a57: number, } | { - type: \'a568\', + type: 'a568', a57: number, } | { - type: \'a569\', + type: 'a569', a57: number, } | { - type: \'a570\', + type: 'a570', a57: number, } | { - type: \'a571\', + type: 'a571', a58: number, } | { - type: \'a572\', + type: 'a572', a58: number, } | { - type: \'a573\', + type: 'a573', a58: number, } | { - type: \'a574\', + type: 'a574', a58: number, } | { - type: \'a575\', + type: 'a575', a58: number, } | { - type: \'a576\', + type: 'a576', a58: number, } | { - type: \'a577\', + type: 'a577', a58: number, } | { - type: \'a578\', + type: 'a578', a58: number, } | { - type: \'a579\', + type: 'a579', a58: number, } | { - type: \'a580\', + type: 'a580', a58: number, } | { - type: \'a581\', + type: 'a581', a59: number, } | { - type: \'a582\', + type: 'a582', a59: number, } | { - type: \'a583\', + type: 'a583', a59: number, } | { - type: \'a584\', + type: 'a584', a59: number, } | { - type: \'a585\', + type: 'a585', a59: number, } | { - type: \'a586\', + type: 'a586', a59: number, } | { - type: \'a587\', + type: 'a587', a59: number, } | { - type: \'a588\', + type: 'a588', a59: number, } | { - type: \'a589\', + type: 'a589', a59: number, } | { - type: \'a590\', + type: 'a590', a59: number, } | { - type: \'a591\', + type: 'a591', a60: number, } | { - type: \'a592\', + type: 'a592', a60: number, } | { - type: \'a593\', + type: 'a593', a60: number, } | { - type: \'a594\', + type: 'a594', a60: number, } | { - type: \'a595\', + type: 'a595', a60: number, } | { - type: \'a596\', + type: 'a596', a60: number, } | { - type: \'a597\', + type: 'a597', a60: number, } | { - type: \'a598\', + type: 'a598', a60: number, } | { - type: \'a599\', + type: 'a599', a60: number, } | { - type: \'a600\', + type: 'a600', a60: number, } | { - type: \'a601\', + type: 'a601', a61: number, } | { - type: \'a602\', + type: 'a602', a61: number, } | { - type: \'a603\', + type: 'a603', a61: number, } | { - type: \'a604\', + type: 'a604', a61: number, } | { - type: \'a605\', + type: 'a605', a61: number, } | { - type: \'a606\', + type: 'a606', a61: number, } | { - type: \'a607\', + type: 'a607', a61: number, } | { - type: \'a608\', + type: 'a608', a61: number, } | { - type: \'a609\', + type: 'a609', a61: number, } | { - type: \'a610\', + type: 'a610', a61: number, } | { - type: \'a611\', + type: 'a611', a62: number, } | { - type: \'a612\', + type: 'a612', a62: number, } | { - type: \'a613\', + type: 'a613', a62: number, } | { - type: \'a614\', + type: 'a614', a62: number, } | { - type: \'a615\', + type: 'a615', a62: number, } | { - type: \'a616\', + type: 'a616', a62: number, } | { - type: \'a617\', + type: 'a617', a62: number, } | { - type: \'a618\', + type: 'a618', a62: number, } | { - type: \'a619\', + type: 'a619', a62: number, } | { - type: \'a620\', + type: 'a620', a62: number, } | { - type: \'a621\', + type: 'a621', a63: number, } | { - type: \'a622\', + type: 'a622', a63: number, } | { - type: \'a623\', + type: 'a623', a63: number, } | { - type: \'a624\', + type: 'a624', a63: number, } | { - type: \'a625\', + type: 'a625', a63: number, } | { - type: \'a626\', + type: 'a626', a63: number, } | { - type: \'a627\', + type: 'a627', a63: number, } | { - type: \'a628\', + type: 'a628', a63: number, } | { - type: \'a629\', + type: 'a629', a63: number, } | { - type: \'a630\', + type: 'a630', a63: number, } | { - type: \'a631\', + type: 'a631', a64: number, } | { - type: \'a632\', + type: 'a632', a64: number, } | { - type: \'a633\', + type: 'a633', a64: number, } | { - type: \'a634\', + type: 'a634', a64: number, } | { - type: \'a635\', + type: 'a635', a64: number, } | { - type: \'a636\', + type: 'a636', a64: number, } | { - type: \'a637\', + type: 'a637', a64: number, } | { - type: \'a638\', + type: 'a638', a64: number, } | { - type: \'a639\', + type: 'a639', a64: number, } | { - type: \'a640\', + type: 'a640', a64: number, } | { - type: \'a641\', + type: 'a641', a65: number, } | { - type: \'a642\', + type: 'a642', a65: number, } | { - type: \'a643\', + type: 'a643', a65: number, } | { - type: \'a644\', + type: 'a644', a65: number, } | { - type: \'a645\', + type: 'a645', a65: number, } | { - type: \'a646\', + type: 'a646', a65: number, } | { - type: \'a647\', + type: 'a647', a65: number, } | { - type: \'a648\', + type: 'a648', a65: number, } | { - type: \'a649\', + type: 'a649', a65: number, } | { - type: \'a650\', + type: 'a650', a65: number, } | { - type: \'a651\', + type: 'a651', a66: number, } | { - type: \'a652\', + type: 'a652', a66: number, } | { - type: \'a653\', + type: 'a653', a66: number, } | { - type: \'a654\', + type: 'a654', a66: number, } | { - type: \'a655\', + type: 'a655', a66: number, } | { - type: \'a656\', + type: 'a656', a66: number, } | { - type: \'a657\', + type: 'a657', a66: number, } | { - type: \'a658\', + type: 'a658', a66: number, } | { - type: \'a659\', + type: 'a659', a66: number, } | { - type: \'a660\', + type: 'a660', a66: number, } | { - type: \'a661\', + type: 'a661', a67: number, } | { - type: \'a662\', + type: 'a662', a67: number, } | { - type: \'a663\', + type: 'a663', a67: number, } | { - type: \'a664\', + type: 'a664', a67: number, } | { - type: \'a665\', + type: 'a665', a67: number, } | { - type: \'a666\', + type: 'a666', a67: number, } | { - type: \'a667\', + type: 'a667', a67: number, } | { - type: \'a668\', + type: 'a668', a67: number, } | { - type: \'a669\', + type: 'a669', a67: number, } | { - type: \'a670\', + type: 'a670', a67: number, } | { - type: \'a671\', + type: 'a671', a68: number, } | { - type: \'a672\', + type: 'a672', a68: number, } | { - type: \'a673\', + type: 'a673', a68: number, } | { - type: \'a674\', + type: 'a674', a68: number, } | { - type: \'a675\', + type: 'a675', a68: number, } | { - type: \'a676\', + type: 'a676', a68: number, } | { - type: \'a677\', + type: 'a677', a68: number, } | { - type: \'a678\', + type: 'a678', a68: number, } | { - type: \'a679\', + type: 'a679', a68: number, } | { - type: \'a680\', + type: 'a680', a68: number, } | { - type: \'a681\', + type: 'a681', a69: number, } | { - type: \'a682\', + type: 'a682', a69: number, } | { - type: \'a683\', + type: 'a683', a69: number, } | { - type: \'a684\', + type: 'a684', a69: number, } | { - type: \'a685\', + type: 'a685', a69: number, } | { - type: \'a686\', + type: 'a686', a69: number, } | { - type: \'a687\', + type: 'a687', a69: number, } | { - type: \'a688\', + type: 'a688', a69: number, } | { - type: \'a689\', + type: 'a689', a69: number, } | { - type: \'a690\', + type: 'a690', a69: number, } | { - type: \'a691\', + type: 'a691', a70: number, } | { - type: \'a692\', + type: 'a692', a70: number, } | { - type: \'a693\', + type: 'a693', a70: number, } | { - type: \'a694\', + type: 'a694', a70: number, } | { - type: \'a695\', + type: 'a695', a70: number, } | { - type: \'a696\', + type: 'a696', a70: number, } | { - type: \'a697\', + type: 'a697', a70: number, } | { - type: \'a698\', + type: 'a698', a70: number, } | { - type: \'a699\', + type: 'a699', a70: number, } | { - type: \'a700\', + type: 'a700', a70: number, } | { - type: \'a701\', + type: 'a701', a71: number, } | { - type: \'a702\', + type: 'a702', a71: number, } | { - type: \'a703\', + type: 'a703', a71: number, } | { - type: \'a704\', + type: 'a704', a71: number, } | { - type: \'a705\', + type: 'a705', a71: number, } | { - type: \'a706\', + type: 'a706', a71: number, } | { - type: \'a707\', + type: 'a707', a71: number, } | { - type: \'a708\', + type: 'a708', a71: number, } | { - type: \'a709\', + type: 'a709', a71: number, } | { - type: \'a710\', + type: 'a710', a71: number, } | { - type: \'a711\', + type: 'a711', a72: number, } | { - type: \'a712\', + type: 'a712', a72: number, } | { - type: \'a713\', + type: 'a713', a72: number, } | { - type: \'a714\', + type: 'a714', a72: number, } | { - type: \'a715\', + type: 'a715', a72: number, } | { - type: \'a716\', + type: 'a716', a72: number, } | { - type: \'a717\', + type: 'a717', a72: number, } | { - type: \'a718\', + type: 'a718', a72: number, } | { - type: \'a719\', + type: 'a719', a72: number, } | { - type: \'a720\', + type: 'a720', a72: number, } | { - type: \'a721\', + type: 'a721', a73: number, } | { - type: \'a722\', + type: 'a722', a73: number, } | { - type: \'a723\', + type: 'a723', a73: number, } | { - type: \'a724\', + type: 'a724', a73: number, } | { - type: \'a725\', + type: 'a725', a73: number, } | { - type: \'a726\', + type: 'a726', a73: number, } | { - type: \'a727\', + type: 'a727', a73: number, } | { - type: \'a728\', + type: 'a728', a73: number, } | { - type: \'a729\', + type: 'a729', a73: number, } | { - type: \'a730\', + type: 'a730', a73: number, } | { - type: \'a731\', + type: 'a731', a74: number, } | { - type: \'a732\', + type: 'a732', a74: number, } | { - type: \'a733\', + type: 'a733', a74: number, } | { - type: \'a734\', + type: 'a734', a74: number, } | { - type: \'a735\', + type: 'a735', a74: number, } | { - type: \'a736\', + type: 'a736', a74: number, } | { - type: \'a737\', + type: 'a737', a74: number, } | { - type: \'a738\', + type: 'a738', a74: number, } | { - type: \'a739\', + type: 'a739', a74: number, } | { - type: \'a740\', + type: 'a740', a74: number, } | { - type: \'a741\', + type: 'a741', a75: number, } | { - type: \'a742\', + type: 'a742', a75: number, } | { - type: \'a743\', + type: 'a743', a75: number, } | { - type: \'a744\', + type: 'a744', a75: number, } | { - type: \'a745\', + type: 'a745', a75: number, } | { - type: \'a746\', + type: 'a746', a75: number, } | { - type: \'a747\', + type: 'a747', a75: number, } | { - type: \'a748\', + type: 'a748', a75: number, } | { - type: \'a749\', + type: 'a749', a75: number, } | { - type: \'a750\', + type: 'a750', a75: number, } | { - type: \'a751\', + type: 'a751', a76: number, } | { - type: \'a752\', + type: 'a752', a76: number, } | { - type: \'a753\', + type: 'a753', a76: number, } | { - type: \'a754\', + type: 'a754', a76: number, } | { - type: \'a755\', + type: 'a755', a76: number, } | { - type: \'a756\', + type: 'a756', a76: number, } | { - type: \'a757\', + type: 'a757', a76: number, } | { - type: \'a758\', + type: 'a758', a76: number, } | { - type: \'a759\', + type: 'a759', a76: number, } | { - type: \'a760\', + type: 'a760', a76: number, } | { - type: \'a761\', + type: 'a761', a77: number, } | { - type: \'a762\', + type: 'a762', a77: number, } | { - type: \'a763\', + type: 'a763', a77: number, } | { - type: \'a764\', + type: 'a764', a77: number, } | { - type: \'a765\', + type: 'a765', a77: number, } | { - type: \'a766\', + type: 'a766', a77: number, } | { - type: \'a767\', + type: 'a767', a77: number, } | { - type: \'a768\', + type: 'a768', a77: number, } | { - type: \'a769\', + type: 'a769', a77: number, } | { - type: \'a770\', + type: 'a770', a77: number, } | { - type: \'a771\', + type: 'a771', a78: number, } | { - type: \'a772\', + type: 'a772', a78: number, } | { - type: \'a773\', + type: 'a773', a78: number, } | { - type: \'a774\', + type: 'a774', a78: number, } | { - type: \'a775\', + type: 'a775', a78: number, } | { - type: \'a776\', + type: 'a776', a78: number, } | { - type: \'a777\', + type: 'a777', a78: number, } | { - type: \'a778\', + type: 'a778', a78: number, } | { - type: \'a779\', + type: 'a779', a78: number, } | { - type: \'a780\', + type: 'a780', a78: number, } | { - type: \'a781\', + type: 'a781', a79: number, } | { - type: \'a782\', + type: 'a782', a79: number, } | { - type: \'a783\', + type: 'a783', a79: number, } | { - type: \'a784\', + type: 'a784', a79: number, } | { - type: \'a785\', + type: 'a785', a79: number, } | { - type: \'a786\', + type: 'a786', a79: number, } | { - type: \'a787\', + type: 'a787', a79: number, } | { - type: \'a788\', + type: 'a788', a79: number, } | { - type: \'a789\', + type: 'a789', a79: number, } | { - type: \'a790\', + type: 'a790', a79: number, } | { - type: \'a791\', + type: 'a791', a80: number, } | { - type: \'a792\', + type: 'a792', a80: number, } | { - type: \'a793\', + type: 'a793', a80: number, } | { - type: \'a794\', + type: 'a794', a80: number, } | { - type: \'a795\', + type: 'a795', a80: number, } | { - type: \'a796\', + type: 'a796', a80: number, } | { - type: \'a797\', + type: 'a797', a80: number, } | { - type: \'a798\', + type: 'a798', a80: number, } | { - type: \'a799\', + type: 'a799', a80: number, } | { - type: \'a800\', + type: 'a800', a80: number, } | { - type: \'a801\', + type: 'a801', a81: number, } | { - type: \'a802\', + type: 'a802', a81: number, } | { - type: \'a803\', + type: 'a803', a81: number, } | { - type: \'a804\', + type: 'a804', a81: number, } | { - type: \'a805\', + type: 'a805', a81: number, } | { - type: \'a806\', + type: 'a806', a81: number, } | { - type: \'a807\', + type: 'a807', a81: number, } | { - type: \'a808\', + type: 'a808', a81: number, } | { - type: \'a809\', + type: 'a809', a81: number, } | { - type: \'a810\', + type: 'a810', a81: number, } | { - type: \'a811\', + type: 'a811', a82: number, } | { - type: \'a812\', + type: 'a812', a82: number, } | { - type: \'a813\', + type: 'a813', a82: number, } | { - type: \'a814\', + type: 'a814', a82: number, } | { - type: \'a815\', + type: 'a815', a82: number, } | { - type: \'a816\', + type: 'a816', a82: number, } | { - type: \'a817\', + type: 'a817', a82: number, } | { - type: \'a818\', + type: 'a818', a82: number, } | { - type: \'a819\', + type: 'a819', a82: number, } | { - type: \'a820\', + type: 'a820', a82: number, } | { - type: \'a821\', + type: 'a821', a83: number, } | { - type: \'a822\', + type: 'a822', a83: number, } | { - type: \'a823\', + type: 'a823', a83: number, } | { - type: \'a824\', + type: 'a824', a83: number, } | { - type: \'a825\', + type: 'a825', a83: number, } | { - type: \'a826\', + type: 'a826', a83: number, } | { - type: \'a827\', + type: 'a827', a83: number, } | { - type: \'a828\', + type: 'a828', a83: number, } | { - type: \'a829\', + type: 'a829', a83: number, } | { - type: \'a830\', + type: 'a830', a83: number, } | { - type: \'a831\', + type: 'a831', a84: number, } | { - type: \'a832\', + type: 'a832', a84: number, } | { - type: \'a833\', + type: 'a833', a84: number, } | { - type: \'a834\', + type: 'a834', a84: number, } | { - type: \'a835\', + type: 'a835', a84: number, } | { - type: \'a836\', + type: 'a836', a84: number, } | { - type: \'a837\', + type: 'a837', a84: number, } | { - type: \'a838\', + type: 'a838', a84: number, } | { - type: \'a839\', + type: 'a839', a84: number, } | { - type: \'a840\', + type: 'a840', a84: number, } | { - type: \'a841\', + type: 'a841', a85: number, } | { - type: \'a842\', + type: 'a842', a85: number, } | { - type: \'a843\', + type: 'a843', a85: number, } | { - type: \'a844\', + type: 'a844', a85: number, } | { - type: \'a845\', + type: 'a845', a85: number, } | { - type: \'a846\', + type: 'a846', a85: number, } | { - type: \'a847\', + type: 'a847', a85: number, } | { - type: \'a848\', + type: 'a848', a85: number, } | { - type: \'a849\', + type: 'a849', a85: number, } | { - type: \'a850\', + type: 'a850', a85: number, } | { - type: \'a851\', + type: 'a851', a86: number, } | { - type: \'a852\', + type: 'a852', a86: number, } | { - type: \'a853\', + type: 'a853', a86: number, } | { - type: \'a854\', + type: 'a854', a86: number, } | { - type: \'a855\', + type: 'a855', a86: number, } | { - type: \'a856\', + type: 'a856', a86: number, } | { - type: \'a857\', + type: 'a857', a86: number, } | { - type: \'a858\', + type: 'a858', a86: number, } | { - type: \'a859\', + type: 'a859', a86: number, } | { - type: \'a860\', + type: 'a860', a86: number, } | { - type: \'a861\', + type: 'a861', a87: number, } | { - type: \'a862\', + type: 'a862', a87: number, } | { - type: \'a863\', + type: 'a863', a87: number, } | { - type: \'a864\', + type: 'a864', a87: number, } | { - type: \'a865\', + type: 'a865', a87: number, } | { - type: \'a866\', + type: 'a866', a87: number, } | { - type: \'a867\', + type: 'a867', a87: number, } | { - type: \'a868\', + type: 'a868', a87: number, } | { - type: \'a869\', + type: 'a869', a87: number, } | { - type: \'a870\', + type: 'a870', a87: number, } | { - type: \'a871\', + type: 'a871', a88: number, } | { - type: \'a872\', + type: 'a872', a88: number, } | { - type: \'a873\', + type: 'a873', a88: number, } | { - type: \'a874\', + type: 'a874', a88: number, } | { - type: \'a875\', + type: 'a875', a88: number, } | { - type: \'a876\', + type: 'a876', a88: number, } | { - type: \'a877\', + type: 'a877', a88: number, } | { - type: \'a878\', + type: 'a878', a88: number, } | { - type: \'a879\', + type: 'a879', a88: number, } | { - type: \'a880\', + type: 'a880', a88: number, } | { - type: \'a881\', + type: 'a881', a89: number, } | { - type: \'a882\', + type: 'a882', a89: number, } | { - type: \'a883\', + type: 'a883', a89: number, } | { - type: \'a884\', + type: 'a884', a89: number, } | { - type: \'a885\', + type: 'a885', a89: number, } | { - type: \'a886\', + type: 'a886', a89: number, } | { - type: \'a887\', + type: 'a887', a89: number, } | { - type: \'a888\', + type: 'a888', a89: number, } | { - type: \'a889\', + type: 'a889', a89: number, } | { - type: \'a890\', + type: 'a890', a89: number, } | { - type: \'a891\', + type: 'a891', a90: number, } | { - type: \'a892\', + type: 'a892', a90: number, } | { - type: \'a893\', + type: 'a893', a90: number, } | { - type: \'a894\', + type: 'a894', a90: number, } | { - type: \'a895\', + type: 'a895', a90: number, } | { - type: \'a896\', + type: 'a896', a90: number, } | { - type: \'a897\', + type: 'a897', a90: number, } | { - type: \'a898\', + type: 'a898', a90: number, } | { - type: \'a899\', + type: 'a899', a90: number, } | { - type: \'a900\', + type: 'a900', a90: number, } | { - type: \'a901\', + type: 'a901', a91: number, } | { - type: \'a902\', + type: 'a902', a91: number, } | { - type: \'a903\', + type: 'a903', a91: number, } | { - type: \'a904\', + type: 'a904', a91: number, } | { - type: \'a905\', + type: 'a905', a91: number, } | { - type: \'a906\', + type: 'a906', a91: number, } | { - type: \'a907\', + type: 'a907', a91: number, } | { - type: \'a908\', + type: 'a908', a91: number, } | { - type: \'a909\', + type: 'a909', a91: number, } | { - type: \'a910\', + type: 'a910', a91: number, } | { - type: \'a911\', + type: 'a911', a92: number, } | { - type: \'a912\', + type: 'a912', a92: number, } | { - type: \'a913\', + type: 'a913', a92: number, } | { - type: \'a914\', + type: 'a914', a92: number, } | { - type: \'a915\', + type: 'a915', a92: number, } | { - type: \'a916\', + type: 'a916', a92: number, } | { - type: \'a917\', + type: 'a917', a92: number, } | { - type: \'a918\', + type: 'a918', a92: number, } | { - type: \'a919\', + type: 'a919', a92: number, } | { - type: \'a920\', + type: 'a920', a92: number, } | { - type: \'a921\', + type: 'a921', a93: number, } | { - type: \'a922\', + type: 'a922', a93: number, } | { - type: \'a923\', + type: 'a923', a93: number, } | { - type: \'a924\', + type: 'a924', a93: number, } | { - type: \'a925\', + type: 'a925', a93: number, } | { - type: \'a926\', + type: 'a926', a93: number, } | { - type: \'a927\', + type: 'a927', a93: number, } | { - type: \'a928\', + type: 'a928', a93: number, } | { - type: \'a929\', + type: 'a929', a93: number, } | { - type: \'a930\', + type: 'a930', a93: number, } | { - type: \'a931\', + type: 'a931', a94: number, } | { - type: \'a932\', + type: 'a932', a94: number, } | { - type: \'a933\', + type: 'a933', a94: number, } | { - type: \'a934\', + type: 'a934', a94: number, } | { - type: \'a935\', + type: 'a935', a94: number, } | { - type: \'a936\', + type: 'a936', a94: number, } | { - type: \'a937\', + type: 'a937', a94: number, } | { - type: \'a938\', + type: 'a938', a94: number, } | { - type: \'a939\', + type: 'a939', a94: number, } | { - type: \'a940\', + type: 'a940', a94: number, } | { - type: \'a941\', + type: 'a941', a95: number, } | { - type: \'a942\', + type: 'a942', a95: number, } | { - type: \'a943\', + type: 'a943', a95: number, } | { - type: \'a944\', + type: 'a944', a95: number, } | { - type: \'a945\', + type: 'a945', a95: number, } | { - type: \'a946\', + type: 'a946', a95: number, } | { - type: \'a947\', + type: 'a947', a95: number, } | { - type: \'a948\', + type: 'a948', a95: number, } | { - type: \'a949\', + type: 'a949', a95: number, } | { - type: \'a950\', + type: 'a950', a95: number, } | { - type: \'a951\', + type: 'a951', a96: number, } | { - type: \'a952\', + type: 'a952', a96: number, } | { - type: \'a953\', + type: 'a953', a96: number, } | { - type: \'a954\', + type: 'a954', a96: number, } | { - type: \'a955\', + type: 'a955', a96: number, } | { - type: \'a956\', + type: 'a956', a96: number, } | { - type: \'a957\', + type: 'a957', a96: number, } | { - type: \'a958\', + type: 'a958', a96: number, } | { - type: \'a959\', + type: 'a959', a96: number, } | { - type: \'a960\', + type: 'a960', a96: number, } | { - type: \'a961\', + type: 'a961', a97: number, } | { - type: \'a962\', + type: 'a962', a97: number, } | { - type: \'a963\', + type: 'a963', a97: number, } | { - type: \'a964\', + type: 'a964', a97: number, } | { - type: \'a965\', + type: 'a965', a97: number, } | { - type: \'a966\', + type: 'a966', a97: number, } | { - type: \'a967\', + type: 'a967', a97: number, } | { - type: \'a968\', + type: 'a968', a97: number, } | { - type: \'a969\', + type: 'a969', a97: number, } | { - type: \'a970\', + type: 'a970', a97: number, } | { - type: \'a971\', + type: 'a971', a98: number, } | { - type: \'a972\', + type: 'a972', a98: number, } | { - type: \'a973\', + type: 'a973', a98: number, } | { - type: \'a974\', + type: 'a974', a98: number, } | { - type: \'a975\', + type: 'a975', a98: number, } | { - type: \'a976\', + type: 'a976', a98: number, } | { - type: \'a977\', + type: 'a977', a98: number, } | { - type: \'a978\', + type: 'a978', a98: number, } | { - type: \'a979\', + type: 'a979', a98: number, } | { - type: \'a980\', + type: 'a980', a98: number, } | { - type: \'a981\', + type: 'a981', a99: number, } | { - type: \'a982\', + type: 'a982', a99: number, } | { - type: \'a983\', + type: 'a983', a99: number, } | { - type: \'a984\', + type: 'a984', a99: number, } | { - type: \'a985\', + type: 'a985', a99: number, } | { - type: \'a986\', + type: 'a986', a99: number, } | { - type: \'a987\', + type: 'a987', a99: number, } | { - type: \'a988\', + type: 'a988', a99: number, } | { - type: \'a989\', + type: 'a989', a99: number, } | { - type: \'a990\', + type: 'a990', a99: number, } | { - type: \'a991\', + type: 'a991', a100: number, } | { - type: \'a992\', + type: 'a992', a100: number, } | { - type: \'a993\', + type: 'a993', a100: number, } | { - type: \'a994\', + type: 'a994', a100: number, } | { - type: \'a995\', + type: 'a995', a100: number, } | { - type: \'a996\', + type: 'a996', a100: number, } | { - type: \'a997\', + type: 'a997', a100: number, } | { - type: \'a998\', + type: 'a998', a100: number, } | { - type: \'a999\', + type: 'a999', a100: number, } | { - type: \'a1000\', + type: 'a1000', a100: number, }; function foo(x: TAction): TAction { return x; } @@ -4006,4003 +4008,4003 @@ function foo(x: TAction): TAction { return x; } // perf test for big disjoint union with 1000 cases type TAction = | { - type: \"a1\", + type: \\"a1\\", a1: number } | { - type: \"a2\", + type: \\"a2\\", a1: number } | { - type: \"a3\", + type: \\"a3\\", a1: number } | { - type: \"a4\", + type: \\"a4\\", a1: number } | { - type: \"a5\", + type: \\"a5\\", a1: number } | { - type: \"a6\", + type: \\"a6\\", a1: number } | { - type: \"a7\", + type: \\"a7\\", a1: number } | { - type: \"a8\", + type: \\"a8\\", a1: number } | { - type: \"a9\", + type: \\"a9\\", a1: number } | { - type: \"a10\", + type: \\"a10\\", a1: number } | { - type: \"a11\", + type: \\"a11\\", a2: number } | { - type: \"a12\", + type: \\"a12\\", a2: number } | { - type: \"a13\", + type: \\"a13\\", a2: number } | { - type: \"a14\", + type: \\"a14\\", a2: number } | { - type: \"a15\", + type: \\"a15\\", a2: number } | { - type: \"a16\", + type: \\"a16\\", a2: number } | { - type: \"a17\", + type: \\"a17\\", a2: number } | { - type: \"a18\", + type: \\"a18\\", a2: number } | { - type: \"a19\", + type: \\"a19\\", a2: number } | { - type: \"a20\", + type: \\"a20\\", a2: number } | { - type: \"a21\", + type: \\"a21\\", a3: number } | { - type: \"a22\", + type: \\"a22\\", a3: number } | { - type: \"a23\", + type: \\"a23\\", a3: number } | { - type: \"a24\", + type: \\"a24\\", a3: number } | { - type: \"a25\", + type: \\"a25\\", a3: number } | { - type: \"a26\", + type: \\"a26\\", a3: number } | { - type: \"a27\", + type: \\"a27\\", a3: number } | { - type: \"a28\", + type: \\"a28\\", a3: number } | { - type: \"a29\", + type: \\"a29\\", a3: number } | { - type: \"a30\", + type: \\"a30\\", a3: number } | { - type: \"a31\", + type: \\"a31\\", a4: number } | { - type: \"a32\", + type: \\"a32\\", a4: number } | { - type: \"a33\", + type: \\"a33\\", a4: number } | { - type: \"a34\", + type: \\"a34\\", a4: number } | { - type: \"a35\", + type: \\"a35\\", a4: number } | { - type: \"a36\", + type: \\"a36\\", a4: number } | { - type: \"a37\", + type: \\"a37\\", a4: number } | { - type: \"a38\", + type: \\"a38\\", a4: number } | { - type: \"a39\", + type: \\"a39\\", a4: number } | { - type: \"a40\", + type: \\"a40\\", a4: number } | { - type: \"a41\", + type: \\"a41\\", a5: number } | { - type: \"a42\", + type: \\"a42\\", a5: number } | { - type: \"a43\", + type: \\"a43\\", a5: number } | { - type: \"a44\", + type: \\"a44\\", a5: number } | { - type: \"a45\", + type: \\"a45\\", a5: number } | { - type: \"a46\", + type: \\"a46\\", a5: number } | { - type: \"a47\", + type: \\"a47\\", a5: number } | { - type: \"a48\", + type: \\"a48\\", a5: number } | { - type: \"a49\", + type: \\"a49\\", a5: number } | { - type: \"a50\", + type: \\"a50\\", a5: number } | { - type: \"a51\", + type: \\"a51\\", a6: number } | { - type: \"a52\", + type: \\"a52\\", a6: number } | { - type: \"a53\", + type: \\"a53\\", a6: number } | { - type: \"a54\", + type: \\"a54\\", a6: number } | { - type: \"a55\", + type: \\"a55\\", a6: number } | { - type: \"a56\", + type: \\"a56\\", a6: number } | { - type: \"a57\", + type: \\"a57\\", a6: number } | { - type: \"a58\", + type: \\"a58\\", a6: number } | { - type: \"a59\", + type: \\"a59\\", a6: number } | { - type: \"a60\", + type: \\"a60\\", a6: number } | { - type: \"a61\", + type: \\"a61\\", a7: number } | { - type: \"a62\", + type: \\"a62\\", a7: number } | { - type: \"a63\", + type: \\"a63\\", a7: number } | { - type: \"a64\", + type: \\"a64\\", a7: number } | { - type: \"a65\", + type: \\"a65\\", a7: number } | { - type: \"a66\", + type: \\"a66\\", a7: number } | { - type: \"a67\", + type: \\"a67\\", a7: number } | { - type: \"a68\", + type: \\"a68\\", a7: number } | { - type: \"a69\", + type: \\"a69\\", a7: number } | { - type: \"a70\", + type: \\"a70\\", a7: number } | { - type: \"a71\", + type: \\"a71\\", a8: number } | { - type: \"a72\", + type: \\"a72\\", a8: number } | { - type: \"a73\", + type: \\"a73\\", a8: number } | { - type: \"a74\", + type: \\"a74\\", a8: number } | { - type: \"a75\", + type: \\"a75\\", a8: number } | { - type: \"a76\", + type: \\"a76\\", a8: number } | { - type: \"a77\", + type: \\"a77\\", a8: number } | { - type: \"a78\", + type: \\"a78\\", a8: number } | { - type: \"a79\", + type: \\"a79\\", a8: number } | { - type: \"a80\", + type: \\"a80\\", a8: number } | { - type: \"a81\", + type: \\"a81\\", a9: number } | { - type: \"a82\", + type: \\"a82\\", a9: number } | { - type: \"a83\", + type: \\"a83\\", a9: number } | { - type: \"a84\", + type: \\"a84\\", a9: number } | { - type: \"a85\", + type: \\"a85\\", a9: number } | { - type: \"a86\", + type: \\"a86\\", a9: number } | { - type: \"a87\", + type: \\"a87\\", a9: number } | { - type: \"a88\", + type: \\"a88\\", a9: number } | { - type: \"a89\", + type: \\"a89\\", a9: number } | { - type: \"a90\", + type: \\"a90\\", a9: number } | { - type: \"a91\", + type: \\"a91\\", a10: number } | { - type: \"a92\", + type: \\"a92\\", a10: number } | { - type: \"a93\", + type: \\"a93\\", a10: number } | { - type: \"a94\", + type: \\"a94\\", a10: number } | { - type: \"a95\", + type: \\"a95\\", a10: number } | { - type: \"a96\", + type: \\"a96\\", a10: number } | { - type: \"a97\", + type: \\"a97\\", a10: number } | { - type: \"a98\", + type: \\"a98\\", a10: number } | { - type: \"a99\", + type: \\"a99\\", a10: number } | { - type: \"a100\", + type: \\"a100\\", a10: number } | { - type: \"a101\", + type: \\"a101\\", a11: number } | { - type: \"a102\", + type: \\"a102\\", a11: number } | { - type: \"a103\", + type: \\"a103\\", a11: number } | { - type: \"a104\", + type: \\"a104\\", a11: number } | { - type: \"a105\", + type: \\"a105\\", a11: number } | { - type: \"a106\", + type: \\"a106\\", a11: number } | { - type: \"a107\", + type: \\"a107\\", a11: number } | { - type: \"a108\", + type: \\"a108\\", a11: number } | { - type: \"a109\", + type: \\"a109\\", a11: number } | { - type: \"a110\", + type: \\"a110\\", a11: number } | { - type: \"a111\", + type: \\"a111\\", a12: number } | { - type: \"a112\", + type: \\"a112\\", a12: number } | { - type: \"a113\", + type: \\"a113\\", a12: number } | { - type: \"a114\", + type: \\"a114\\", a12: number } | { - type: \"a115\", + type: \\"a115\\", a12: number } | { - type: \"a116\", + type: \\"a116\\", a12: number } | { - type: \"a117\", + type: \\"a117\\", a12: number } | { - type: \"a118\", + type: \\"a118\\", a12: number } | { - type: \"a119\", + type: \\"a119\\", a12: number } | { - type: \"a120\", + type: \\"a120\\", a12: number } | { - type: \"a121\", + type: \\"a121\\", a13: number } | { - type: \"a122\", + type: \\"a122\\", a13: number } | { - type: \"a123\", + type: \\"a123\\", a13: number } | { - type: \"a124\", + type: \\"a124\\", a13: number } | { - type: \"a125\", + type: \\"a125\\", a13: number } | { - type: \"a126\", + type: \\"a126\\", a13: number } | { - type: \"a127\", + type: \\"a127\\", a13: number } | { - type: \"a128\", + type: \\"a128\\", a13: number } | { - type: \"a129\", + type: \\"a129\\", a13: number } | { - type: \"a130\", + type: \\"a130\\", a13: number } | { - type: \"a131\", + type: \\"a131\\", a14: number } | { - type: \"a132\", + type: \\"a132\\", a14: number } | { - type: \"a133\", + type: \\"a133\\", a14: number } | { - type: \"a134\", + type: \\"a134\\", a14: number } | { - type: \"a135\", + type: \\"a135\\", a14: number } | { - type: \"a136\", + type: \\"a136\\", a14: number } | { - type: \"a137\", + type: \\"a137\\", a14: number } | { - type: \"a138\", + type: \\"a138\\", a14: number } | { - type: \"a139\", + type: \\"a139\\", a14: number } | { - type: \"a140\", + type: \\"a140\\", a14: number } | { - type: \"a141\", + type: \\"a141\\", a15: number } | { - type: \"a142\", + type: \\"a142\\", a15: number } | { - type: \"a143\", + type: \\"a143\\", a15: number } | { - type: \"a144\", + type: \\"a144\\", a15: number } | { - type: \"a145\", + type: \\"a145\\", a15: number } | { - type: \"a146\", + type: \\"a146\\", a15: number } | { - type: \"a147\", + type: \\"a147\\", a15: number } | { - type: \"a148\", + type: \\"a148\\", a15: number } | { - type: \"a149\", + type: \\"a149\\", a15: number } | { - type: \"a150\", + type: \\"a150\\", a15: number } | { - type: \"a151\", + type: \\"a151\\", a16: number } | { - type: \"a152\", + type: \\"a152\\", a16: number } | { - type: \"a153\", + type: \\"a153\\", a16: number } | { - type: \"a154\", + type: \\"a154\\", a16: number } | { - type: \"a155\", + type: \\"a155\\", a16: number } | { - type: \"a156\", + type: \\"a156\\", a16: number } | { - type: \"a157\", + type: \\"a157\\", a16: number } | { - type: \"a158\", + type: \\"a158\\", a16: number } | { - type: \"a159\", + type: \\"a159\\", a16: number } | { - type: \"a160\", + type: \\"a160\\", a16: number } | { - type: \"a161\", + type: \\"a161\\", a17: number } | { - type: \"a162\", + type: \\"a162\\", a17: number } | { - type: \"a163\", + type: \\"a163\\", a17: number } | { - type: \"a164\", + type: \\"a164\\", a17: number } | { - type: \"a165\", + type: \\"a165\\", a17: number } | { - type: \"a166\", + type: \\"a166\\", a17: number } | { - type: \"a167\", + type: \\"a167\\", a17: number } | { - type: \"a168\", + type: \\"a168\\", a17: number } | { - type: \"a169\", + type: \\"a169\\", a17: number } | { - type: \"a170\", + type: \\"a170\\", a17: number } | { - type: \"a171\", + type: \\"a171\\", a18: number } | { - type: \"a172\", + type: \\"a172\\", a18: number } | { - type: \"a173\", + type: \\"a173\\", a18: number } | { - type: \"a174\", + type: \\"a174\\", a18: number } | { - type: \"a175\", + type: \\"a175\\", a18: number } | { - type: \"a176\", + type: \\"a176\\", a18: number } | { - type: \"a177\", + type: \\"a177\\", a18: number } | { - type: \"a178\", + type: \\"a178\\", a18: number } | { - type: \"a179\", + type: \\"a179\\", a18: number } | { - type: \"a180\", + type: \\"a180\\", a18: number } | { - type: \"a181\", + type: \\"a181\\", a19: number } | { - type: \"a182\", + type: \\"a182\\", a19: number } | { - type: \"a183\", + type: \\"a183\\", a19: number } | { - type: \"a184\", + type: \\"a184\\", a19: number } | { - type: \"a185\", + type: \\"a185\\", a19: number } | { - type: \"a186\", + type: \\"a186\\", a19: number } | { - type: \"a187\", + type: \\"a187\\", a19: number } | { - type: \"a188\", + type: \\"a188\\", a19: number } | { - type: \"a189\", + type: \\"a189\\", a19: number } | { - type: \"a190\", + type: \\"a190\\", a19: number } | { - type: \"a191\", + type: \\"a191\\", a20: number } | { - type: \"a192\", + type: \\"a192\\", a20: number } | { - type: \"a193\", + type: \\"a193\\", a20: number } | { - type: \"a194\", + type: \\"a194\\", a20: number } | { - type: \"a195\", + type: \\"a195\\", a20: number } | { - type: \"a196\", + type: \\"a196\\", a20: number } | { - type: \"a197\", + type: \\"a197\\", a20: number } | { - type: \"a198\", + type: \\"a198\\", a20: number } | { - type: \"a199\", + type: \\"a199\\", a20: number } | { - type: \"a200\", + type: \\"a200\\", a20: number } | { - type: \"a201\", + type: \\"a201\\", a21: number } | { - type: \"a202\", + type: \\"a202\\", a21: number } | { - type: \"a203\", + type: \\"a203\\", a21: number } | { - type: \"a204\", + type: \\"a204\\", a21: number } | { - type: \"a205\", + type: \\"a205\\", a21: number } | { - type: \"a206\", + type: \\"a206\\", a21: number } | { - type: \"a207\", + type: \\"a207\\", a21: number } | { - type: \"a208\", + type: \\"a208\\", a21: number } | { - type: \"a209\", + type: \\"a209\\", a21: number } | { - type: \"a210\", + type: \\"a210\\", a21: number } | { - type: \"a211\", + type: \\"a211\\", a22: number } | { - type: \"a212\", + type: \\"a212\\", a22: number } | { - type: \"a213\", + type: \\"a213\\", a22: number } | { - type: \"a214\", + type: \\"a214\\", a22: number } | { - type: \"a215\", + type: \\"a215\\", a22: number } | { - type: \"a216\", + type: \\"a216\\", a22: number } | { - type: \"a217\", + type: \\"a217\\", a22: number } | { - type: \"a218\", + type: \\"a218\\", a22: number } | { - type: \"a219\", + type: \\"a219\\", a22: number } | { - type: \"a220\", + type: \\"a220\\", a22: number } | { - type: \"a221\", + type: \\"a221\\", a23: number } | { - type: \"a222\", + type: \\"a222\\", a23: number } | { - type: \"a223\", + type: \\"a223\\", a23: number } | { - type: \"a224\", + type: \\"a224\\", a23: number } | { - type: \"a225\", + type: \\"a225\\", a23: number } | { - type: \"a226\", + type: \\"a226\\", a23: number } | { - type: \"a227\", + type: \\"a227\\", a23: number } | { - type: \"a228\", + type: \\"a228\\", a23: number } | { - type: \"a229\", + type: \\"a229\\", a23: number } | { - type: \"a230\", + type: \\"a230\\", a23: number } | { - type: \"a231\", + type: \\"a231\\", a24: number } | { - type: \"a232\", + type: \\"a232\\", a24: number } | { - type: \"a233\", + type: \\"a233\\", a24: number } | { - type: \"a234\", + type: \\"a234\\", a24: number } | { - type: \"a235\", + type: \\"a235\\", a24: number } | { - type: \"a236\", + type: \\"a236\\", a24: number } | { - type: \"a237\", + type: \\"a237\\", a24: number } | { - type: \"a238\", + type: \\"a238\\", a24: number } | { - type: \"a239\", + type: \\"a239\\", a24: number } | { - type: \"a240\", + type: \\"a240\\", a24: number } | { - type: \"a241\", + type: \\"a241\\", a25: number } | { - type: \"a242\", + type: \\"a242\\", a25: number } | { - type: \"a243\", + type: \\"a243\\", a25: number } | { - type: \"a244\", + type: \\"a244\\", a25: number } | { - type: \"a245\", + type: \\"a245\\", a25: number } | { - type: \"a246\", + type: \\"a246\\", a25: number } | { - type: \"a247\", + type: \\"a247\\", a25: number } | { - type: \"a248\", + type: \\"a248\\", a25: number } | { - type: \"a249\", + type: \\"a249\\", a25: number } | { - type: \"a250\", + type: \\"a250\\", a25: number } | { - type: \"a251\", + type: \\"a251\\", a26: number } | { - type: \"a252\", + type: \\"a252\\", a26: number } | { - type: \"a253\", + type: \\"a253\\", a26: number } | { - type: \"a254\", + type: \\"a254\\", a26: number } | { - type: \"a255\", + type: \\"a255\\", a26: number } | { - type: \"a256\", + type: \\"a256\\", a26: number } | { - type: \"a257\", + type: \\"a257\\", a26: number } | { - type: \"a258\", + type: \\"a258\\", a26: number } | { - type: \"a259\", + type: \\"a259\\", a26: number } | { - type: \"a260\", + type: \\"a260\\", a26: number } | { - type: \"a261\", + type: \\"a261\\", a27: number } | { - type: \"a262\", + type: \\"a262\\", a27: number } | { - type: \"a263\", + type: \\"a263\\", a27: number } | { - type: \"a264\", + type: \\"a264\\", a27: number } | { - type: \"a265\", + type: \\"a265\\", a27: number } | { - type: \"a266\", + type: \\"a266\\", a27: number } | { - type: \"a267\", + type: \\"a267\\", a27: number } | { - type: \"a268\", + type: \\"a268\\", a27: number } | { - type: \"a269\", + type: \\"a269\\", a27: number } | { - type: \"a270\", + type: \\"a270\\", a27: number } | { - type: \"a271\", + type: \\"a271\\", a28: number } | { - type: \"a272\", + type: \\"a272\\", a28: number } | { - type: \"a273\", + type: \\"a273\\", a28: number } | { - type: \"a274\", + type: \\"a274\\", a28: number } | { - type: \"a275\", + type: \\"a275\\", a28: number } | { - type: \"a276\", + type: \\"a276\\", a28: number } | { - type: \"a277\", + type: \\"a277\\", a28: number } | { - type: \"a278\", + type: \\"a278\\", a28: number } | { - type: \"a279\", + type: \\"a279\\", a28: number } | { - type: \"a280\", + type: \\"a280\\", a28: number } | { - type: \"a281\", + type: \\"a281\\", a29: number } | { - type: \"a282\", + type: \\"a282\\", a29: number } | { - type: \"a283\", + type: \\"a283\\", a29: number } | { - type: \"a284\", + type: \\"a284\\", a29: number } | { - type: \"a285\", + type: \\"a285\\", a29: number } | { - type: \"a286\", + type: \\"a286\\", a29: number } | { - type: \"a287\", + type: \\"a287\\", a29: number } | { - type: \"a288\", + type: \\"a288\\", a29: number } | { - type: \"a289\", + type: \\"a289\\", a29: number } | { - type: \"a290\", + type: \\"a290\\", a29: number } | { - type: \"a291\", + type: \\"a291\\", a30: number } | { - type: \"a292\", + type: \\"a292\\", a30: number } | { - type: \"a293\", + type: \\"a293\\", a30: number } | { - type: \"a294\", + type: \\"a294\\", a30: number } | { - type: \"a295\", + type: \\"a295\\", a30: number } | { - type: \"a296\", + type: \\"a296\\", a30: number } | { - type: \"a297\", + type: \\"a297\\", a30: number } | { - type: \"a298\", + type: \\"a298\\", a30: number } | { - type: \"a299\", + type: \\"a299\\", a30: number } | { - type: \"a300\", + type: \\"a300\\", a30: number } | { - type: \"a301\", + type: \\"a301\\", a31: number } | { - type: \"a302\", + type: \\"a302\\", a31: number } | { - type: \"a303\", + type: \\"a303\\", a31: number } | { - type: \"a304\", + type: \\"a304\\", a31: number } | { - type: \"a305\", + type: \\"a305\\", a31: number } | { - type: \"a306\", + type: \\"a306\\", a31: number } | { - type: \"a307\", + type: \\"a307\\", a31: number } | { - type: \"a308\", + type: \\"a308\\", a31: number } | { - type: \"a309\", + type: \\"a309\\", a31: number } | { - type: \"a310\", + type: \\"a310\\", a31: number } | { - type: \"a311\", + type: \\"a311\\", a32: number } | { - type: \"a312\", + type: \\"a312\\", a32: number } | { - type: \"a313\", + type: \\"a313\\", a32: number } | { - type: \"a314\", + type: \\"a314\\", a32: number } | { - type: \"a315\", + type: \\"a315\\", a32: number } | { - type: \"a316\", + type: \\"a316\\", a32: number } | { - type: \"a317\", + type: \\"a317\\", a32: number } | { - type: \"a318\", + type: \\"a318\\", a32: number } | { - type: \"a319\", + type: \\"a319\\", a32: number } | { - type: \"a320\", + type: \\"a320\\", a32: number } | { - type: \"a321\", + type: \\"a321\\", a33: number } | { - type: \"a322\", + type: \\"a322\\", a33: number } | { - type: \"a323\", + type: \\"a323\\", a33: number } | { - type: \"a324\", + type: \\"a324\\", a33: number } | { - type: \"a325\", + type: \\"a325\\", a33: number } | { - type: \"a326\", + type: \\"a326\\", a33: number } | { - type: \"a327\", + type: \\"a327\\", a33: number } | { - type: \"a328\", + type: \\"a328\\", a33: number } | { - type: \"a329\", + type: \\"a329\\", a33: number } | { - type: \"a330\", + type: \\"a330\\", a33: number } | { - type: \"a331\", + type: \\"a331\\", a34: number } | { - type: \"a332\", + type: \\"a332\\", a34: number } | { - type: \"a333\", + type: \\"a333\\", a34: number } | { - type: \"a334\", + type: \\"a334\\", a34: number } | { - type: \"a335\", + type: \\"a335\\", a34: number } | { - type: \"a336\", + type: \\"a336\\", a34: number } | { - type: \"a337\", + type: \\"a337\\", a34: number } | { - type: \"a338\", + type: \\"a338\\", a34: number } | { - type: \"a339\", + type: \\"a339\\", a34: number } | { - type: \"a340\", + type: \\"a340\\", a34: number } | { - type: \"a341\", + type: \\"a341\\", a35: number } | { - type: \"a342\", + type: \\"a342\\", a35: number } | { - type: \"a343\", + type: \\"a343\\", a35: number } | { - type: \"a344\", + type: \\"a344\\", a35: number } | { - type: \"a345\", + type: \\"a345\\", a35: number } | { - type: \"a346\", + type: \\"a346\\", a35: number } | { - type: \"a347\", + type: \\"a347\\", a35: number } | { - type: \"a348\", + type: \\"a348\\", a35: number } | { - type: \"a349\", + type: \\"a349\\", a35: number } | { - type: \"a350\", + type: \\"a350\\", a35: number } | { - type: \"a351\", + type: \\"a351\\", a36: number } | { - type: \"a352\", + type: \\"a352\\", a36: number } | { - type: \"a353\", + type: \\"a353\\", a36: number } | { - type: \"a354\", + type: \\"a354\\", a36: number } | { - type: \"a355\", + type: \\"a355\\", a36: number } | { - type: \"a356\", + type: \\"a356\\", a36: number } | { - type: \"a357\", + type: \\"a357\\", a36: number } | { - type: \"a358\", + type: \\"a358\\", a36: number } | { - type: \"a359\", + type: \\"a359\\", a36: number } | { - type: \"a360\", + type: \\"a360\\", a36: number } | { - type: \"a361\", + type: \\"a361\\", a37: number } | { - type: \"a362\", + type: \\"a362\\", a37: number } | { - type: \"a363\", + type: \\"a363\\", a37: number } | { - type: \"a364\", + type: \\"a364\\", a37: number } | { - type: \"a365\", + type: \\"a365\\", a37: number } | { - type: \"a366\", + type: \\"a366\\", a37: number } | { - type: \"a367\", + type: \\"a367\\", a37: number } | { - type: \"a368\", + type: \\"a368\\", a37: number } | { - type: \"a369\", + type: \\"a369\\", a37: number } | { - type: \"a370\", + type: \\"a370\\", a37: number } | { - type: \"a371\", + type: \\"a371\\", a38: number } | { - type: \"a372\", + type: \\"a372\\", a38: number } | { - type: \"a373\", + type: \\"a373\\", a38: number } | { - type: \"a374\", + type: \\"a374\\", a38: number } | { - type: \"a375\", + type: \\"a375\\", a38: number } | { - type: \"a376\", + type: \\"a376\\", a38: number } | { - type: \"a377\", + type: \\"a377\\", a38: number } | { - type: \"a378\", + type: \\"a378\\", a38: number } | { - type: \"a379\", + type: \\"a379\\", a38: number } | { - type: \"a380\", + type: \\"a380\\", a38: number } | { - type: \"a381\", + type: \\"a381\\", a39: number } | { - type: \"a382\", + type: \\"a382\\", a39: number } | { - type: \"a383\", + type: \\"a383\\", a39: number } | { - type: \"a384\", + type: \\"a384\\", a39: number } | { - type: \"a385\", + type: \\"a385\\", a39: number } | { - type: \"a386\", + type: \\"a386\\", a39: number } | { - type: \"a387\", + type: \\"a387\\", a39: number } | { - type: \"a388\", + type: \\"a388\\", a39: number } | { - type: \"a389\", + type: \\"a389\\", a39: number } | { - type: \"a390\", + type: \\"a390\\", a39: number } | { - type: \"a391\", + type: \\"a391\\", a40: number } | { - type: \"a392\", + type: \\"a392\\", a40: number } | { - type: \"a393\", + type: \\"a393\\", a40: number } | { - type: \"a394\", + type: \\"a394\\", a40: number } | { - type: \"a395\", + type: \\"a395\\", a40: number } | { - type: \"a396\", + type: \\"a396\\", a40: number } | { - type: \"a397\", + type: \\"a397\\", a40: number } | { - type: \"a398\", + type: \\"a398\\", a40: number } | { - type: \"a399\", + type: \\"a399\\", a40: number } | { - type: \"a400\", + type: \\"a400\\", a40: number } | { - type: \"a401\", + type: \\"a401\\", a41: number } | { - type: \"a402\", + type: \\"a402\\", a41: number } | { - type: \"a403\", + type: \\"a403\\", a41: number } | { - type: \"a404\", + type: \\"a404\\", a41: number } | { - type: \"a405\", + type: \\"a405\\", a41: number } | { - type: \"a406\", + type: \\"a406\\", a41: number } | { - type: \"a407\", + type: \\"a407\\", a41: number } | { - type: \"a408\", + type: \\"a408\\", a41: number } | { - type: \"a409\", + type: \\"a409\\", a41: number } | { - type: \"a410\", + type: \\"a410\\", a41: number } | { - type: \"a411\", + type: \\"a411\\", a42: number } | { - type: \"a412\", + type: \\"a412\\", a42: number } | { - type: \"a413\", + type: \\"a413\\", a42: number } | { - type: \"a414\", + type: \\"a414\\", a42: number } | { - type: \"a415\", + type: \\"a415\\", a42: number } | { - type: \"a416\", + type: \\"a416\\", a42: number } | { - type: \"a417\", + type: \\"a417\\", a42: number } | { - type: \"a418\", + type: \\"a418\\", a42: number } | { - type: \"a419\", + type: \\"a419\\", a42: number } | { - type: \"a420\", + type: \\"a420\\", a42: number } | { - type: \"a421\", + type: \\"a421\\", a43: number } | { - type: \"a422\", + type: \\"a422\\", a43: number } | { - type: \"a423\", + type: \\"a423\\", a43: number } | { - type: \"a424\", + type: \\"a424\\", a43: number } | { - type: \"a425\", + type: \\"a425\\", a43: number } | { - type: \"a426\", + type: \\"a426\\", a43: number } | { - type: \"a427\", + type: \\"a427\\", a43: number } | { - type: \"a428\", + type: \\"a428\\", a43: number } | { - type: \"a429\", + type: \\"a429\\", a43: number } | { - type: \"a430\", + type: \\"a430\\", a43: number } | { - type: \"a431\", + type: \\"a431\\", a44: number } | { - type: \"a432\", + type: \\"a432\\", a44: number } | { - type: \"a433\", + type: \\"a433\\", a44: number } | { - type: \"a434\", + type: \\"a434\\", a44: number } | { - type: \"a435\", + type: \\"a435\\", a44: number } | { - type: \"a436\", + type: \\"a436\\", a44: number } | { - type: \"a437\", + type: \\"a437\\", a44: number } | { - type: \"a438\", + type: \\"a438\\", a44: number } | { - type: \"a439\", + type: \\"a439\\", a44: number } | { - type: \"a440\", + type: \\"a440\\", a44: number } | { - type: \"a441\", + type: \\"a441\\", a45: number } | { - type: \"a442\", + type: \\"a442\\", a45: number } | { - type: \"a443\", + type: \\"a443\\", a45: number } | { - type: \"a444\", + type: \\"a444\\", a45: number } | { - type: \"a445\", + type: \\"a445\\", a45: number } | { - type: \"a446\", + type: \\"a446\\", a45: number } | { - type: \"a447\", + type: \\"a447\\", a45: number } | { - type: \"a448\", + type: \\"a448\\", a45: number } | { - type: \"a449\", + type: \\"a449\\", a45: number } | { - type: \"a450\", + type: \\"a450\\", a45: number } | { - type: \"a451\", + type: \\"a451\\", a46: number } | { - type: \"a452\", + type: \\"a452\\", a46: number } | { - type: \"a453\", + type: \\"a453\\", a46: number } | { - type: \"a454\", + type: \\"a454\\", a46: number } | { - type: \"a455\", + type: \\"a455\\", a46: number } | { - type: \"a456\", + type: \\"a456\\", a46: number } | { - type: \"a457\", + type: \\"a457\\", a46: number } | { - type: \"a458\", + type: \\"a458\\", a46: number } | { - type: \"a459\", + type: \\"a459\\", a46: number } | { - type: \"a460\", + type: \\"a460\\", a46: number } | { - type: \"a461\", + type: \\"a461\\", a47: number } | { - type: \"a462\", + type: \\"a462\\", a47: number } | { - type: \"a463\", + type: \\"a463\\", a47: number } | { - type: \"a464\", + type: \\"a464\\", a47: number } | { - type: \"a465\", + type: \\"a465\\", a47: number } | { - type: \"a466\", + type: \\"a466\\", a47: number } | { - type: \"a467\", + type: \\"a467\\", a47: number } | { - type: \"a468\", + type: \\"a468\\", a47: number } | { - type: \"a469\", + type: \\"a469\\", a47: number } | { - type: \"a470\", + type: \\"a470\\", a47: number } | { - type: \"a471\", + type: \\"a471\\", a48: number } | { - type: \"a472\", + type: \\"a472\\", a48: number } | { - type: \"a473\", + type: \\"a473\\", a48: number } | { - type: \"a474\", + type: \\"a474\\", a48: number } | { - type: \"a475\", + type: \\"a475\\", a48: number } | { - type: \"a476\", + type: \\"a476\\", a48: number } | { - type: \"a477\", + type: \\"a477\\", a48: number } | { - type: \"a478\", + type: \\"a478\\", a48: number } | { - type: \"a479\", + type: \\"a479\\", a48: number } | { - type: \"a480\", + type: \\"a480\\", a48: number } | { - type: \"a481\", + type: \\"a481\\", a49: number } | { - type: \"a482\", + type: \\"a482\\", a49: number } | { - type: \"a483\", + type: \\"a483\\", a49: number } | { - type: \"a484\", + type: \\"a484\\", a49: number } | { - type: \"a485\", + type: \\"a485\\", a49: number } | { - type: \"a486\", + type: \\"a486\\", a49: number } | { - type: \"a487\", + type: \\"a487\\", a49: number } | { - type: \"a488\", + type: \\"a488\\", a49: number } | { - type: \"a489\", + type: \\"a489\\", a49: number } | { - type: \"a490\", + type: \\"a490\\", a49: number } | { - type: \"a491\", + type: \\"a491\\", a50: number } | { - type: \"a492\", + type: \\"a492\\", a50: number } | { - type: \"a493\", + type: \\"a493\\", a50: number } | { - type: \"a494\", + type: \\"a494\\", a50: number } | { - type: \"a495\", + type: \\"a495\\", a50: number } | { - type: \"a496\", + type: \\"a496\\", a50: number } | { - type: \"a497\", + type: \\"a497\\", a50: number } | { - type: \"a498\", + type: \\"a498\\", a50: number } | { - type: \"a499\", + type: \\"a499\\", a50: number } | { - type: \"a500\", + type: \\"a500\\", a50: number } | { - type: \"a501\", + type: \\"a501\\", a51: number } | { - type: \"a502\", + type: \\"a502\\", a51: number } | { - type: \"a503\", + type: \\"a503\\", a51: number } | { - type: \"a504\", + type: \\"a504\\", a51: number } | { - type: \"a505\", + type: \\"a505\\", a51: number } | { - type: \"a506\", + type: \\"a506\\", a51: number } | { - type: \"a507\", + type: \\"a507\\", a51: number } | { - type: \"a508\", + type: \\"a508\\", a51: number } | { - type: \"a509\", + type: \\"a509\\", a51: number } | { - type: \"a510\", + type: \\"a510\\", a51: number } | { - type: \"a511\", + type: \\"a511\\", a52: number } | { - type: \"a512\", + type: \\"a512\\", a52: number } | { - type: \"a513\", + type: \\"a513\\", a52: number } | { - type: \"a514\", + type: \\"a514\\", a52: number } | { - type: \"a515\", + type: \\"a515\\", a52: number } | { - type: \"a516\", + type: \\"a516\\", a52: number } | { - type: \"a517\", + type: \\"a517\\", a52: number } | { - type: \"a518\", + type: \\"a518\\", a52: number } | { - type: \"a519\", + type: \\"a519\\", a52: number } | { - type: \"a520\", + type: \\"a520\\", a52: number } | { - type: \"a521\", + type: \\"a521\\", a53: number } | { - type: \"a522\", + type: \\"a522\\", a53: number } | { - type: \"a523\", + type: \\"a523\\", a53: number } | { - type: \"a524\", + type: \\"a524\\", a53: number } | { - type: \"a525\", + type: \\"a525\\", a53: number } | { - type: \"a526\", + type: \\"a526\\", a53: number } | { - type: \"a527\", + type: \\"a527\\", a53: number } | { - type: \"a528\", + type: \\"a528\\", a53: number } | { - type: \"a529\", + type: \\"a529\\", a53: number } | { - type: \"a530\", + type: \\"a530\\", a53: number } | { - type: \"a531\", + type: \\"a531\\", a54: number } | { - type: \"a532\", + type: \\"a532\\", a54: number } | { - type: \"a533\", + type: \\"a533\\", a54: number } | { - type: \"a534\", + type: \\"a534\\", a54: number } | { - type: \"a535\", + type: \\"a535\\", a54: number } | { - type: \"a536\", + type: \\"a536\\", a54: number } | { - type: \"a537\", + type: \\"a537\\", a54: number } | { - type: \"a538\", + type: \\"a538\\", a54: number } | { - type: \"a539\", + type: \\"a539\\", a54: number } | { - type: \"a540\", + type: \\"a540\\", a54: number } | { - type: \"a541\", + type: \\"a541\\", a55: number } | { - type: \"a542\", + type: \\"a542\\", a55: number } | { - type: \"a543\", + type: \\"a543\\", a55: number } | { - type: \"a544\", + type: \\"a544\\", a55: number } | { - type: \"a545\", + type: \\"a545\\", a55: number } | { - type: \"a546\", + type: \\"a546\\", a55: number } | { - type: \"a547\", + type: \\"a547\\", a55: number } | { - type: \"a548\", + type: \\"a548\\", a55: number } | { - type: \"a549\", + type: \\"a549\\", a55: number } | { - type: \"a550\", + type: \\"a550\\", a55: number } | { - type: \"a551\", + type: \\"a551\\", a56: number } | { - type: \"a552\", + type: \\"a552\\", a56: number } | { - type: \"a553\", + type: \\"a553\\", a56: number } | { - type: \"a554\", + type: \\"a554\\", a56: number } | { - type: \"a555\", + type: \\"a555\\", a56: number } | { - type: \"a556\", + type: \\"a556\\", a56: number } | { - type: \"a557\", + type: \\"a557\\", a56: number } | { - type: \"a558\", + type: \\"a558\\", a56: number } | { - type: \"a559\", + type: \\"a559\\", a56: number } | { - type: \"a560\", + type: \\"a560\\", a56: number } | { - type: \"a561\", + type: \\"a561\\", a57: number } | { - type: \"a562\", + type: \\"a562\\", a57: number } | { - type: \"a563\", + type: \\"a563\\", a57: number } | { - type: \"a564\", + type: \\"a564\\", a57: number } | { - type: \"a565\", + type: \\"a565\\", a57: number } | { - type: \"a566\", + type: \\"a566\\", a57: number } | { - type: \"a567\", + type: \\"a567\\", a57: number } | { - type: \"a568\", + type: \\"a568\\", a57: number } | { - type: \"a569\", + type: \\"a569\\", a57: number } | { - type: \"a570\", + type: \\"a570\\", a57: number } | { - type: \"a571\", + type: \\"a571\\", a58: number } | { - type: \"a572\", + type: \\"a572\\", a58: number } | { - type: \"a573\", + type: \\"a573\\", a58: number } | { - type: \"a574\", + type: \\"a574\\", a58: number } | { - type: \"a575\", + type: \\"a575\\", a58: number } | { - type: \"a576\", + type: \\"a576\\", a58: number } | { - type: \"a577\", + type: \\"a577\\", a58: number } | { - type: \"a578\", + type: \\"a578\\", a58: number } | { - type: \"a579\", + type: \\"a579\\", a58: number } | { - type: \"a580\", + type: \\"a580\\", a58: number } | { - type: \"a581\", + type: \\"a581\\", a59: number } | { - type: \"a582\", + type: \\"a582\\", a59: number } | { - type: \"a583\", + type: \\"a583\\", a59: number } | { - type: \"a584\", + type: \\"a584\\", a59: number } | { - type: \"a585\", + type: \\"a585\\", a59: number } | { - type: \"a586\", + type: \\"a586\\", a59: number } | { - type: \"a587\", + type: \\"a587\\", a59: number } | { - type: \"a588\", + type: \\"a588\\", a59: number } | { - type: \"a589\", + type: \\"a589\\", a59: number } | { - type: \"a590\", + type: \\"a590\\", a59: number } | { - type: \"a591\", + type: \\"a591\\", a60: number } | { - type: \"a592\", + type: \\"a592\\", a60: number } | { - type: \"a593\", + type: \\"a593\\", a60: number } | { - type: \"a594\", + type: \\"a594\\", a60: number } | { - type: \"a595\", + type: \\"a595\\", a60: number } | { - type: \"a596\", + type: \\"a596\\", a60: number } | { - type: \"a597\", + type: \\"a597\\", a60: number } | { - type: \"a598\", + type: \\"a598\\", a60: number } | { - type: \"a599\", + type: \\"a599\\", a60: number } | { - type: \"a600\", + type: \\"a600\\", a60: number } | { - type: \"a601\", + type: \\"a601\\", a61: number } | { - type: \"a602\", + type: \\"a602\\", a61: number } | { - type: \"a603\", + type: \\"a603\\", a61: number } | { - type: \"a604\", + type: \\"a604\\", a61: number } | { - type: \"a605\", + type: \\"a605\\", a61: number } | { - type: \"a606\", + type: \\"a606\\", a61: number } | { - type: \"a607\", + type: \\"a607\\", a61: number } | { - type: \"a608\", + type: \\"a608\\", a61: number } | { - type: \"a609\", + type: \\"a609\\", a61: number } | { - type: \"a610\", + type: \\"a610\\", a61: number } | { - type: \"a611\", + type: \\"a611\\", a62: number } | { - type: \"a612\", + type: \\"a612\\", a62: number } | { - type: \"a613\", + type: \\"a613\\", a62: number } | { - type: \"a614\", + type: \\"a614\\", a62: number } | { - type: \"a615\", + type: \\"a615\\", a62: number } | { - type: \"a616\", + type: \\"a616\\", a62: number } | { - type: \"a617\", + type: \\"a617\\", a62: number } | { - type: \"a618\", + type: \\"a618\\", a62: number } | { - type: \"a619\", + type: \\"a619\\", a62: number } | { - type: \"a620\", + type: \\"a620\\", a62: number } | { - type: \"a621\", + type: \\"a621\\", a63: number } | { - type: \"a622\", + type: \\"a622\\", a63: number } | { - type: \"a623\", + type: \\"a623\\", a63: number } | { - type: \"a624\", + type: \\"a624\\", a63: number } | { - type: \"a625\", + type: \\"a625\\", a63: number } | { - type: \"a626\", + type: \\"a626\\", a63: number } | { - type: \"a627\", + type: \\"a627\\", a63: number } | { - type: \"a628\", + type: \\"a628\\", a63: number } | { - type: \"a629\", + type: \\"a629\\", a63: number } | { - type: \"a630\", + type: \\"a630\\", a63: number } | { - type: \"a631\", + type: \\"a631\\", a64: number } | { - type: \"a632\", + type: \\"a632\\", a64: number } | { - type: \"a633\", + type: \\"a633\\", a64: number } | { - type: \"a634\", + type: \\"a634\\", a64: number } | { - type: \"a635\", + type: \\"a635\\", a64: number } | { - type: \"a636\", + type: \\"a636\\", a64: number } | { - type: \"a637\", + type: \\"a637\\", a64: number } | { - type: \"a638\", + type: \\"a638\\", a64: number } | { - type: \"a639\", + type: \\"a639\\", a64: number } | { - type: \"a640\", + type: \\"a640\\", a64: number } | { - type: \"a641\", + type: \\"a641\\", a65: number } | { - type: \"a642\", + type: \\"a642\\", a65: number } | { - type: \"a643\", + type: \\"a643\\", a65: number } | { - type: \"a644\", + type: \\"a644\\", a65: number } | { - type: \"a645\", + type: \\"a645\\", a65: number } | { - type: \"a646\", + type: \\"a646\\", a65: number } | { - type: \"a647\", + type: \\"a647\\", a65: number } | { - type: \"a648\", + type: \\"a648\\", a65: number } | { - type: \"a649\", + type: \\"a649\\", a65: number } | { - type: \"a650\", + type: \\"a650\\", a65: number } | { - type: \"a651\", + type: \\"a651\\", a66: number } | { - type: \"a652\", + type: \\"a652\\", a66: number } | { - type: \"a653\", + type: \\"a653\\", a66: number } | { - type: \"a654\", + type: \\"a654\\", a66: number } | { - type: \"a655\", + type: \\"a655\\", a66: number } | { - type: \"a656\", + type: \\"a656\\", a66: number } | { - type: \"a657\", + type: \\"a657\\", a66: number } | { - type: \"a658\", + type: \\"a658\\", a66: number } | { - type: \"a659\", + type: \\"a659\\", a66: number } | { - type: \"a660\", + type: \\"a660\\", a66: number } | { - type: \"a661\", + type: \\"a661\\", a67: number } | { - type: \"a662\", + type: \\"a662\\", a67: number } | { - type: \"a663\", + type: \\"a663\\", a67: number } | { - type: \"a664\", + type: \\"a664\\", a67: number } | { - type: \"a665\", + type: \\"a665\\", a67: number } | { - type: \"a666\", + type: \\"a666\\", a67: number } | { - type: \"a667\", + type: \\"a667\\", a67: number } | { - type: \"a668\", + type: \\"a668\\", a67: number } | { - type: \"a669\", + type: \\"a669\\", a67: number } | { - type: \"a670\", + type: \\"a670\\", a67: number } | { - type: \"a671\", + type: \\"a671\\", a68: number } | { - type: \"a672\", + type: \\"a672\\", a68: number } | { - type: \"a673\", + type: \\"a673\\", a68: number } | { - type: \"a674\", + type: \\"a674\\", a68: number } | { - type: \"a675\", + type: \\"a675\\", a68: number } | { - type: \"a676\", + type: \\"a676\\", a68: number } | { - type: \"a677\", + type: \\"a677\\", a68: number } | { - type: \"a678\", + type: \\"a678\\", a68: number } | { - type: \"a679\", + type: \\"a679\\", a68: number } | { - type: \"a680\", + type: \\"a680\\", a68: number } | { - type: \"a681\", + type: \\"a681\\", a69: number } | { - type: \"a682\", + type: \\"a682\\", a69: number } | { - type: \"a683\", + type: \\"a683\\", a69: number } | { - type: \"a684\", + type: \\"a684\\", a69: number } | { - type: \"a685\", + type: \\"a685\\", a69: number } | { - type: \"a686\", + type: \\"a686\\", a69: number } | { - type: \"a687\", + type: \\"a687\\", a69: number } | { - type: \"a688\", + type: \\"a688\\", a69: number } | { - type: \"a689\", + type: \\"a689\\", a69: number } | { - type: \"a690\", + type: \\"a690\\", a69: number } | { - type: \"a691\", + type: \\"a691\\", a70: number } | { - type: \"a692\", + type: \\"a692\\", a70: number } | { - type: \"a693\", + type: \\"a693\\", a70: number } | { - type: \"a694\", + type: \\"a694\\", a70: number } | { - type: \"a695\", + type: \\"a695\\", a70: number } | { - type: \"a696\", + type: \\"a696\\", a70: number } | { - type: \"a697\", + type: \\"a697\\", a70: number } | { - type: \"a698\", + type: \\"a698\\", a70: number } | { - type: \"a699\", + type: \\"a699\\", a70: number } | { - type: \"a700\", + type: \\"a700\\", a70: number } | { - type: \"a701\", + type: \\"a701\\", a71: number } | { - type: \"a702\", + type: \\"a702\\", a71: number } | { - type: \"a703\", + type: \\"a703\\", a71: number } | { - type: \"a704\", + type: \\"a704\\", a71: number } | { - type: \"a705\", + type: \\"a705\\", a71: number } | { - type: \"a706\", + type: \\"a706\\", a71: number } | { - type: \"a707\", + type: \\"a707\\", a71: number } | { - type: \"a708\", + type: \\"a708\\", a71: number } | { - type: \"a709\", + type: \\"a709\\", a71: number } | { - type: \"a710\", + type: \\"a710\\", a71: number } | { - type: \"a711\", + type: \\"a711\\", a72: number } | { - type: \"a712\", + type: \\"a712\\", a72: number } | { - type: \"a713\", + type: \\"a713\\", a72: number } | { - type: \"a714\", + type: \\"a714\\", a72: number } | { - type: \"a715\", + type: \\"a715\\", a72: number } | { - type: \"a716\", + type: \\"a716\\", a72: number } | { - type: \"a717\", + type: \\"a717\\", a72: number } | { - type: \"a718\", + type: \\"a718\\", a72: number } | { - type: \"a719\", + type: \\"a719\\", a72: number } | { - type: \"a720\", + type: \\"a720\\", a72: number } | { - type: \"a721\", + type: \\"a721\\", a73: number } | { - type: \"a722\", + type: \\"a722\\", a73: number } | { - type: \"a723\", + type: \\"a723\\", a73: number } | { - type: \"a724\", + type: \\"a724\\", a73: number } | { - type: \"a725\", + type: \\"a725\\", a73: number } | { - type: \"a726\", + type: \\"a726\\", a73: number } | { - type: \"a727\", + type: \\"a727\\", a73: number } | { - type: \"a728\", + type: \\"a728\\", a73: number } | { - type: \"a729\", + type: \\"a729\\", a73: number } | { - type: \"a730\", + type: \\"a730\\", a73: number } | { - type: \"a731\", + type: \\"a731\\", a74: number } | { - type: \"a732\", + type: \\"a732\\", a74: number } | { - type: \"a733\", + type: \\"a733\\", a74: number } | { - type: \"a734\", + type: \\"a734\\", a74: number } | { - type: \"a735\", + type: \\"a735\\", a74: number } | { - type: \"a736\", + type: \\"a736\\", a74: number } | { - type: \"a737\", + type: \\"a737\\", a74: number } | { - type: \"a738\", + type: \\"a738\\", a74: number } | { - type: \"a739\", + type: \\"a739\\", a74: number } | { - type: \"a740\", + type: \\"a740\\", a74: number } | { - type: \"a741\", + type: \\"a741\\", a75: number } | { - type: \"a742\", + type: \\"a742\\", a75: number } | { - type: \"a743\", + type: \\"a743\\", a75: number } | { - type: \"a744\", + type: \\"a744\\", a75: number } | { - type: \"a745\", + type: \\"a745\\", a75: number } | { - type: \"a746\", + type: \\"a746\\", a75: number } | { - type: \"a747\", + type: \\"a747\\", a75: number } | { - type: \"a748\", + type: \\"a748\\", a75: number } | { - type: \"a749\", + type: \\"a749\\", a75: number } | { - type: \"a750\", + type: \\"a750\\", a75: number } | { - type: \"a751\", + type: \\"a751\\", a76: number } | { - type: \"a752\", + type: \\"a752\\", a76: number } | { - type: \"a753\", + type: \\"a753\\", a76: number } | { - type: \"a754\", + type: \\"a754\\", a76: number } | { - type: \"a755\", + type: \\"a755\\", a76: number } | { - type: \"a756\", + type: \\"a756\\", a76: number } | { - type: \"a757\", + type: \\"a757\\", a76: number } | { - type: \"a758\", + type: \\"a758\\", a76: number } | { - type: \"a759\", + type: \\"a759\\", a76: number } | { - type: \"a760\", + type: \\"a760\\", a76: number } | { - type: \"a761\", + type: \\"a761\\", a77: number } | { - type: \"a762\", + type: \\"a762\\", a77: number } | { - type: \"a763\", + type: \\"a763\\", a77: number } | { - type: \"a764\", + type: \\"a764\\", a77: number } | { - type: \"a765\", + type: \\"a765\\", a77: number } | { - type: \"a766\", + type: \\"a766\\", a77: number } | { - type: \"a767\", + type: \\"a767\\", a77: number } | { - type: \"a768\", + type: \\"a768\\", a77: number } | { - type: \"a769\", + type: \\"a769\\", a77: number } | { - type: \"a770\", + type: \\"a770\\", a77: number } | { - type: \"a771\", + type: \\"a771\\", a78: number } | { - type: \"a772\", + type: \\"a772\\", a78: number } | { - type: \"a773\", + type: \\"a773\\", a78: number } | { - type: \"a774\", + type: \\"a774\\", a78: number } | { - type: \"a775\", + type: \\"a775\\", a78: number } | { - type: \"a776\", + type: \\"a776\\", a78: number } | { - type: \"a777\", + type: \\"a777\\", a78: number } | { - type: \"a778\", + type: \\"a778\\", a78: number } | { - type: \"a779\", + type: \\"a779\\", a78: number } | { - type: \"a780\", + type: \\"a780\\", a78: number } | { - type: \"a781\", + type: \\"a781\\", a79: number } | { - type: \"a782\", + type: \\"a782\\", a79: number } | { - type: \"a783\", + type: \\"a783\\", a79: number } | { - type: \"a784\", + type: \\"a784\\", a79: number } | { - type: \"a785\", + type: \\"a785\\", a79: number } | { - type: \"a786\", + type: \\"a786\\", a79: number } | { - type: \"a787\", + type: \\"a787\\", a79: number } | { - type: \"a788\", + type: \\"a788\\", a79: number } | { - type: \"a789\", + type: \\"a789\\", a79: number } | { - type: \"a790\", + type: \\"a790\\", a79: number } | { - type: \"a791\", + type: \\"a791\\", a80: number } | { - type: \"a792\", + type: \\"a792\\", a80: number } | { - type: \"a793\", + type: \\"a793\\", a80: number } | { - type: \"a794\", + type: \\"a794\\", a80: number } | { - type: \"a795\", + type: \\"a795\\", a80: number } | { - type: \"a796\", + type: \\"a796\\", a80: number } | { - type: \"a797\", + type: \\"a797\\", a80: number } | { - type: \"a798\", + type: \\"a798\\", a80: number } | { - type: \"a799\", + type: \\"a799\\", a80: number } | { - type: \"a800\", + type: \\"a800\\", a80: number } | { - type: \"a801\", + type: \\"a801\\", a81: number } | { - type: \"a802\", + type: \\"a802\\", a81: number } | { - type: \"a803\", + type: \\"a803\\", a81: number } | { - type: \"a804\", + type: \\"a804\\", a81: number } | { - type: \"a805\", + type: \\"a805\\", a81: number } | { - type: \"a806\", + type: \\"a806\\", a81: number } | { - type: \"a807\", + type: \\"a807\\", a81: number } | { - type: \"a808\", + type: \\"a808\\", a81: number } | { - type: \"a809\", + type: \\"a809\\", a81: number } | { - type: \"a810\", + type: \\"a810\\", a81: number } | { - type: \"a811\", + type: \\"a811\\", a82: number } | { - type: \"a812\", + type: \\"a812\\", a82: number } | { - type: \"a813\", + type: \\"a813\\", a82: number } | { - type: \"a814\", + type: \\"a814\\", a82: number } | { - type: \"a815\", + type: \\"a815\\", a82: number } | { - type: \"a816\", + type: \\"a816\\", a82: number } | { - type: \"a817\", + type: \\"a817\\", a82: number } | { - type: \"a818\", + type: \\"a818\\", a82: number } | { - type: \"a819\", + type: \\"a819\\", a82: number } | { - type: \"a820\", + type: \\"a820\\", a82: number } | { - type: \"a821\", + type: \\"a821\\", a83: number } | { - type: \"a822\", + type: \\"a822\\", a83: number } | { - type: \"a823\", + type: \\"a823\\", a83: number } | { - type: \"a824\", + type: \\"a824\\", a83: number } | { - type: \"a825\", + type: \\"a825\\", a83: number } | { - type: \"a826\", + type: \\"a826\\", a83: number } | { - type: \"a827\", + type: \\"a827\\", a83: number } | { - type: \"a828\", + type: \\"a828\\", a83: number } | { - type: \"a829\", + type: \\"a829\\", a83: number } | { - type: \"a830\", + type: \\"a830\\", a83: number } | { - type: \"a831\", + type: \\"a831\\", a84: number } | { - type: \"a832\", + type: \\"a832\\", a84: number } | { - type: \"a833\", + type: \\"a833\\", a84: number } | { - type: \"a834\", + type: \\"a834\\", a84: number } | { - type: \"a835\", + type: \\"a835\\", a84: number } | { - type: \"a836\", + type: \\"a836\\", a84: number } | { - type: \"a837\", + type: \\"a837\\", a84: number } | { - type: \"a838\", + type: \\"a838\\", a84: number } | { - type: \"a839\", + type: \\"a839\\", a84: number } | { - type: \"a840\", + type: \\"a840\\", a84: number } | { - type: \"a841\", + type: \\"a841\\", a85: number } | { - type: \"a842\", + type: \\"a842\\", a85: number } | { - type: \"a843\", + type: \\"a843\\", a85: number } | { - type: \"a844\", + type: \\"a844\\", a85: number } | { - type: \"a845\", + type: \\"a845\\", a85: number } | { - type: \"a846\", + type: \\"a846\\", a85: number } | { - type: \"a847\", + type: \\"a847\\", a85: number } | { - type: \"a848\", + type: \\"a848\\", a85: number } | { - type: \"a849\", + type: \\"a849\\", a85: number } | { - type: \"a850\", + type: \\"a850\\", a85: number } | { - type: \"a851\", + type: \\"a851\\", a86: number } | { - type: \"a852\", + type: \\"a852\\", a86: number } | { - type: \"a853\", + type: \\"a853\\", a86: number } | { - type: \"a854\", + type: \\"a854\\", a86: number } | { - type: \"a855\", + type: \\"a855\\", a86: number } | { - type: \"a856\", + type: \\"a856\\", a86: number } | { - type: \"a857\", + type: \\"a857\\", a86: number } | { - type: \"a858\", + type: \\"a858\\", a86: number } | { - type: \"a859\", + type: \\"a859\\", a86: number } | { - type: \"a860\", + type: \\"a860\\", a86: number } | { - type: \"a861\", + type: \\"a861\\", a87: number } | { - type: \"a862\", + type: \\"a862\\", a87: number } | { - type: \"a863\", + type: \\"a863\\", a87: number } | { - type: \"a864\", + type: \\"a864\\", a87: number } | { - type: \"a865\", + type: \\"a865\\", a87: number } | { - type: \"a866\", + type: \\"a866\\", a87: number } | { - type: \"a867\", + type: \\"a867\\", a87: number } | { - type: \"a868\", + type: \\"a868\\", a87: number } | { - type: \"a869\", + type: \\"a869\\", a87: number } | { - type: \"a870\", + type: \\"a870\\", a87: number } | { - type: \"a871\", + type: \\"a871\\", a88: number } | { - type: \"a872\", + type: \\"a872\\", a88: number } | { - type: \"a873\", + type: \\"a873\\", a88: number } | { - type: \"a874\", + type: \\"a874\\", a88: number } | { - type: \"a875\", + type: \\"a875\\", a88: number } | { - type: \"a876\", + type: \\"a876\\", a88: number } | { - type: \"a877\", + type: \\"a877\\", a88: number } | { - type: \"a878\", + type: \\"a878\\", a88: number } | { - type: \"a879\", + type: \\"a879\\", a88: number } | { - type: \"a880\", + type: \\"a880\\", a88: number } | { - type: \"a881\", + type: \\"a881\\", a89: number } | { - type: \"a882\", + type: \\"a882\\", a89: number } | { - type: \"a883\", + type: \\"a883\\", a89: number } | { - type: \"a884\", + type: \\"a884\\", a89: number } | { - type: \"a885\", + type: \\"a885\\", a89: number } | { - type: \"a886\", + type: \\"a886\\", a89: number } | { - type: \"a887\", + type: \\"a887\\", a89: number } | { - type: \"a888\", + type: \\"a888\\", a89: number } | { - type: \"a889\", + type: \\"a889\\", a89: number } | { - type: \"a890\", + type: \\"a890\\", a89: number } | { - type: \"a891\", + type: \\"a891\\", a90: number } | { - type: \"a892\", + type: \\"a892\\", a90: number } | { - type: \"a893\", + type: \\"a893\\", a90: number } | { - type: \"a894\", + type: \\"a894\\", a90: number } | { - type: \"a895\", + type: \\"a895\\", a90: number } | { - type: \"a896\", + type: \\"a896\\", a90: number } | { - type: \"a897\", + type: \\"a897\\", a90: number } | { - type: \"a898\", + type: \\"a898\\", a90: number } | { - type: \"a899\", + type: \\"a899\\", a90: number } | { - type: \"a900\", + type: \\"a900\\", a90: number } | { - type: \"a901\", + type: \\"a901\\", a91: number } | { - type: \"a902\", + type: \\"a902\\", a91: number } | { - type: \"a903\", + type: \\"a903\\", a91: number } | { - type: \"a904\", + type: \\"a904\\", a91: number } | { - type: \"a905\", + type: \\"a905\\", a91: number } | { - type: \"a906\", + type: \\"a906\\", a91: number } | { - type: \"a907\", + type: \\"a907\\", a91: number } | { - type: \"a908\", + type: \\"a908\\", a91: number } | { - type: \"a909\", + type: \\"a909\\", a91: number } | { - type: \"a910\", + type: \\"a910\\", a91: number } | { - type: \"a911\", + type: \\"a911\\", a92: number } | { - type: \"a912\", + type: \\"a912\\", a92: number } | { - type: \"a913\", + type: \\"a913\\", a92: number } | { - type: \"a914\", + type: \\"a914\\", a92: number } | { - type: \"a915\", + type: \\"a915\\", a92: number } | { - type: \"a916\", + type: \\"a916\\", a92: number } | { - type: \"a917\", + type: \\"a917\\", a92: number } | { - type: \"a918\", + type: \\"a918\\", a92: number } | { - type: \"a919\", + type: \\"a919\\", a92: number } | { - type: \"a920\", + type: \\"a920\\", a92: number } | { - type: \"a921\", + type: \\"a921\\", a93: number } | { - type: \"a922\", + type: \\"a922\\", a93: number } | { - type: \"a923\", + type: \\"a923\\", a93: number } | { - type: \"a924\", + type: \\"a924\\", a93: number } | { - type: \"a925\", + type: \\"a925\\", a93: number } | { - type: \"a926\", + type: \\"a926\\", a93: number } | { - type: \"a927\", + type: \\"a927\\", a93: number } | { - type: \"a928\", + type: \\"a928\\", a93: number } | { - type: \"a929\", + type: \\"a929\\", a93: number } | { - type: \"a930\", + type: \\"a930\\", a93: number } | { - type: \"a931\", + type: \\"a931\\", a94: number } | { - type: \"a932\", + type: \\"a932\\", a94: number } | { - type: \"a933\", + type: \\"a933\\", a94: number } | { - type: \"a934\", + type: \\"a934\\", a94: number } | { - type: \"a935\", + type: \\"a935\\", a94: number } | { - type: \"a936\", + type: \\"a936\\", a94: number } | { - type: \"a937\", + type: \\"a937\\", a94: number } | { - type: \"a938\", + type: \\"a938\\", a94: number } | { - type: \"a939\", + type: \\"a939\\", a94: number } | { - type: \"a940\", + type: \\"a940\\", a94: number } | { - type: \"a941\", + type: \\"a941\\", a95: number } | { - type: \"a942\", + type: \\"a942\\", a95: number } | { - type: \"a943\", + type: \\"a943\\", a95: number } | { - type: \"a944\", + type: \\"a944\\", a95: number } | { - type: \"a945\", + type: \\"a945\\", a95: number } | { - type: \"a946\", + type: \\"a946\\", a95: number } | { - type: \"a947\", + type: \\"a947\\", a95: number } | { - type: \"a948\", + type: \\"a948\\", a95: number } | { - type: \"a949\", + type: \\"a949\\", a95: number } | { - type: \"a950\", + type: \\"a950\\", a95: number } | { - type: \"a951\", + type: \\"a951\\", a96: number } | { - type: \"a952\", + type: \\"a952\\", a96: number } | { - type: \"a953\", + type: \\"a953\\", a96: number } | { - type: \"a954\", + type: \\"a954\\", a96: number } | { - type: \"a955\", + type: \\"a955\\", a96: number } | { - type: \"a956\", + type: \\"a956\\", a96: number } | { - type: \"a957\", + type: \\"a957\\", a96: number } | { - type: \"a958\", + type: \\"a958\\", a96: number } | { - type: \"a959\", + type: \\"a959\\", a96: number } | { - type: \"a960\", + type: \\"a960\\", a96: number } | { - type: \"a961\", + type: \\"a961\\", a97: number } | { - type: \"a962\", + type: \\"a962\\", a97: number } | { - type: \"a963\", + type: \\"a963\\", a97: number } | { - type: \"a964\", + type: \\"a964\\", a97: number } | { - type: \"a965\", + type: \\"a965\\", a97: number } | { - type: \"a966\", + type: \\"a966\\", a97: number } | { - type: \"a967\", + type: \\"a967\\", a97: number } | { - type: \"a968\", + type: \\"a968\\", a97: number } | { - type: \"a969\", + type: \\"a969\\", a97: number } | { - type: \"a970\", + type: \\"a970\\", a97: number } | { - type: \"a971\", + type: \\"a971\\", a98: number } | { - type: \"a972\", + type: \\"a972\\", a98: number } | { - type: \"a973\", + type: \\"a973\\", a98: number } | { - type: \"a974\", + type: \\"a974\\", a98: number } | { - type: \"a975\", + type: \\"a975\\", a98: number } | { - type: \"a976\", + type: \\"a976\\", a98: number } | { - type: \"a977\", + type: \\"a977\\", a98: number } | { - type: \"a978\", + type: \\"a978\\", a98: number } | { - type: \"a979\", + type: \\"a979\\", a98: number } | { - type: \"a980\", + type: \\"a980\\", a98: number } | { - type: \"a981\", + type: \\"a981\\", a99: number } | { - type: \"a982\", + type: \\"a982\\", a99: number } | { - type: \"a983\", + type: \\"a983\\", a99: number } | { - type: \"a984\", + type: \\"a984\\", a99: number } | { - type: \"a985\", + type: \\"a985\\", a99: number } | { - type: \"a986\", + type: \\"a986\\", a99: number } | { - type: \"a987\", + type: \\"a987\\", a99: number } | { - type: \"a988\", + type: \\"a988\\", a99: number } | { - type: \"a989\", + type: \\"a989\\", a99: number } | { - type: \"a990\", + type: \\"a990\\", a99: number } | { - type: \"a991\", + type: \\"a991\\", a100: number } | { - type: \"a992\", + type: \\"a992\\", a100: number } | { - type: \"a993\", + type: \\"a993\\", a100: number } | { - type: \"a994\", + type: \\"a994\\", a100: number } | { - type: \"a995\", + type: \\"a995\\", a100: number } | { - type: \"a996\", + type: \\"a996\\", a100: number } | { - type: \"a997\", + type: \\"a997\\", a100: number } | { - type: \"a998\", + type: \\"a998\\", a100: number } | { - type: \"a999\", + type: \\"a999\\", a100: number } | { - type: \"a1000\", + type: \\"a1000\\", a100: number }; function foo(x: TAction): TAction { @@ -8011,7 +8013,7 @@ function foo(x: TAction): TAction { " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "type A = {a: number}; type B = {b: number}; type C = {c: number}; diff --git a/tests/flow/union/__snapshots__/jsfmt.spec.js.snap b/tests/flow/union/__snapshots__/jsfmt.spec.js.snap index 57ea72911..a3621719a 100644 --- a/tests/flow/union/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/union/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test fields.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`fields.js 1`] = ` "class C { x: ?number|string; constructor() { @@ -15,7 +17,7 @@ class C { " `; -exports[`test fields2.js 1`] = ` +exports[`fields2.js 1`] = ` "class C { } class D { @@ -38,42 +40,42 @@ class D { " `; -exports[`test issue-17.js 1`] = ` +exports[`issue-17.js 1`] = ` "/* @flow */ type T = - {type: \"a\"; a: number} | - {type: \"b\"; b: string}; + {type: \\"a\\"; a: number} | + {type: \\"b\\"; b: string}; var l: Array = [ - {type: \"a\", a: 1}, - {type: \"a\", a: 2}, - {type: \"a\", a: 3}, - {type: \"a\", a: 4}, - {type: \"b\", b: \"monkey\"}, - {type: \"b\", b: \"gorilla\"}, - {type: \"b\", b: \"giraffe\"}, - {type: \"b\", b: \"penguin\"}, + {type: \\"a\\", a: 1}, + {type: \\"a\\", a: 2}, + {type: \\"a\\", a: 3}, + {type: \\"a\\", a: 4}, + {type: \\"b\\", b: \\"monkey\\"}, + {type: \\"b\\", b: \\"gorilla\\"}, + {type: \\"b\\", b: \\"giraffe\\"}, + {type: \\"b\\", b: \\"penguin\\"}, ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -type T = { type: \"a\", a: number } | { type: \"b\", b: string }; +type T = { type: \\"a\\", a: number } | { type: \\"b\\", b: string }; var l: Array = [ - { type: \"a\", a: 1 }, - { type: \"a\", a: 2 }, - { type: \"a\", a: 3 }, - { type: \"a\", a: 4 }, - { type: \"b\", b: \"monkey\" }, - { type: \"b\", b: \"gorilla\" }, - { type: \"b\", b: \"giraffe\" }, - { type: \"b\", b: \"penguin\" } + { type: \\"a\\", a: 1 }, + { type: \\"a\\", a: 2 }, + { type: \\"a\\", a: 3 }, + { type: \\"a\\", a: 4 }, + { type: \\"b\\", b: \\"monkey\\" }, + { type: \\"b\\", b: \\"gorilla\\" }, + { type: \\"b\\", b: \\"giraffe\\" }, + { type: \\"b\\", b: \\"penguin\\" } ]; " `; -exports[`test issue-198.js 1`] = ` +exports[`issue-198.js 1`] = ` "var p = new Promise(function(resolve, reject) { resolve(5); }) @@ -98,37 +100,37 @@ var p = new Promise(function(resolve, reject) { " `; -exports[`test issue-256.js 1`] = ` +exports[`issue-256.js 1`] = ` "declare class Myclass { myfun(myarray: Array): any; } declare var myclass: Myclass; -myclass.myfun([\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", function (ar) {}]) -myclass.myfun([\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", function (ar) {}]) +myclass.myfun([\\"1\\", \\"2\\", \\"3\\", \\"4\\", \\"5\\", \\"6\\", function (ar) {}]) +myclass.myfun([\\"1\\", \\"2\\", \\"3\\", \\"4\\", \\"5\\", \\"6\\", \\"7\\", function (ar) {}]) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare class Myclass { myfun(myarray: Array): any } declare var myclass: Myclass; -myclass.myfun([\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", function(ar) {}]); -myclass.myfun([\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", function(ar) {}]); +myclass.myfun([\\"1\\", \\"2\\", \\"3\\", \\"4\\", \\"5\\", \\"6\\", function(ar) {}]); +myclass.myfun([\\"1\\", \\"2\\", \\"3\\", \\"4\\", \\"5\\", \\"6\\", \\"7\\", function(ar) {}]); " `; -exports[`test issue-323.js 1`] = ` -"var Foo = require(\"./issue-323-lib\"); +exports[`issue-323.js 1`] = ` +"var Foo = require(\\"./issue-323-lib\\"); var foo = new Foo(); var foostr: Foo | string = foo; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var Foo = require(\"./issue-323-lib\"); +var Foo = require(\\"./issue-323-lib\\"); var foo = new Foo(); var foostr: Foo | string = foo; " `; -exports[`test issue-323-lib.js 1`] = ` +exports[`issue-323-lib.js 1`] = ` "/* @flow */ class Foo {} module.exports = Foo; @@ -139,7 +141,7 @@ module.exports = Foo; " `; -exports[`test issue-324.js 1`] = ` +exports[`issue-324.js 1`] = ` "/* @flow */ class Foo{}; class Bar{}; @@ -160,7 +162,7 @@ foostr = barstr; " `; -exports[`test issue-325.js 1`] = ` +exports[`issue-325.js 1`] = ` "class Tag { constructor() { var a1: Array = []; @@ -193,34 +195,34 @@ class Tag_ { " `; -exports[`test issue-326.js 1`] = ` +exports[`issue-326.js 1`] = ` "var numberAndStringArr:Array = [1,2]; -var stringArr:Array = [\'a\',\'b\']; +var stringArr:Array = ['a','b']; var result = numberAndStringArr.concat(stringArr); // no error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var numberAndStringArr: Array = [1, 2]; -var stringArr: Array = [\"a\", \"b\"]; +var stringArr: Array = [\\"a\\", \\"b\\"]; var result = numberAndStringArr.concat(stringArr); // no error " `; -exports[`test issue-582.js 1`] = ` +exports[`issue-582.js 1`] = ` "/*** * nested unions * @flow */ // inline -var nested1: (\'foo\' | \'bar\') | \'baz\' = \'baz\'; +var nested1: ('foo' | 'bar') | 'baz' = 'baz'; // through tvars -type FooBar = \'foo\' | \'bar\'; -type Baz = \'baz\'; +type FooBar = 'foo' | 'bar'; +type Baz = 'baz'; type FooBarBaz = FooBar | Baz; -var nested2: FooBarBaz = \'baz\'; +var nested2: FooBarBaz = 'baz'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /*** * nested unions @@ -228,18 +230,18 @@ var nested2: FooBarBaz = \'baz\'; */ // inline -var nested1: (\"foo\" | \"bar\") | \"baz\" = \"baz\"; +var nested1: (\\"foo\\" | \\"bar\\") | \\"baz\\" = \\"baz\\"; // through tvars -type FooBar = \"foo\" | \"bar\"; -type Baz = \"baz\"; +type FooBar = \\"foo\\" | \\"bar\\"; +type Baz = \\"baz\\"; type FooBarBaz = FooBar | Baz; -var nested2: FooBarBaz = \"baz\"; +var nested2: FooBarBaz = \\"baz\\"; " `; -exports[`test issue-963.js 1`] = ` +exports[`issue-963.js 1`] = ` "/*** * unions with embedded intersections * @flow @@ -312,8 +314,8 @@ const u3: union2 = { " `; -exports[`test test.js 1`] = ` -"var C = require(\'test-lib\'); +exports[`test.js 1`] = ` +"var C = require('test-lib'); // TODO: spurious error! (replacing C with number makes the error go away) // type Foo = Array | Array; @@ -328,11 +330,11 @@ foo(y); // type Bar = (() => C) | (() => string); type Bar = () => (C | string); // workaround -function f() { return \"\"; } +function f() { return \\"\\"; } function bar(x:Bar) { } bar(f); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -var C = require(\"test-lib\"); +var C = require(\\"test-lib\\"); // TODO: spurious error! (replacing C with number makes the error go away) // type Foo = Array | Array; @@ -348,14 +350,14 @@ foo(y); type Bar = () => C | string; // workaround function f() { - return \"\"; + return \\"\\"; } function bar(x: Bar) {} bar(f); " `; -exports[`test test-lib.js 1`] = ` +exports[`test-lib.js 1`] = ` "/* @providesModule test-lib */ class C { } @@ -368,7 +370,7 @@ module.exports = C; " `; -exports[`test type-app.js 1`] = ` +exports[`type-app.js 1`] = ` "/** * @flow */ @@ -401,7 +403,7 @@ var b: Iterator | number = 123; " `; -exports[`test union.js 1`] = ` +exports[`union.js 1`] = ` "function bar(x: Document | string): void { } bar(0); @@ -420,7 +422,7 @@ declare class F { foo(x: string):void; } function corge(b) { - var x = b ? \"\" : 0; + var x = b ? \\"\\" : 0; new F().foo(x); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -442,26 +444,26 @@ declare class F { foo(x: string): void } function corge(b) { - var x = b ? \"\" : 0; + var x = b ? \\"\\" : 0; new F().foo(x); } " `; -exports[`test yuge.js 1`] = ` +exports[`yuge.js 1`] = ` "/** * great big union used as type annotation will be flowed into itself. - * List.mem check avoids pathology, as long as singletons aren\'t converted. + * List.mem check avoids pathology, as long as singletons aren't converted. * This is a band-aid, though: see second case. * @flow */ -\'use strict\'; +'use strict'; class SecurityCheckupTypedLogger { _data: Data; setError(value: ErrorCode) { - this._data[\'error\'] = value; + this._data['error'] = value; } // Bug: right now, any incompatible type coming into a huge @@ -469,9 +471,9 @@ class SecurityCheckupTypedLogger { // TODO real solution is to specialize union reps for obvious cases, // e.g. (base type, list in decl order, set). Of course we could do // something quick to get the union size off the Ocaml call stack, - // but not sure it\'s worth doing that before the real solution. + // but not sure it's worth doing that before the real solution. ohThatsNotSoGood() { - (\"\": ErrorCode); // also, error pos omits this line completely + (\\"\\": ErrorCode); // also, error pos omits this line completely } } @@ -5483,17 +5485,17 @@ type Data = { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** * great big union used as type annotation will be flowed into itself. - * List.mem check avoids pathology, as long as singletons aren\'t converted. + * List.mem check avoids pathology, as long as singletons aren't converted. * This is a band-aid, though: see second case. * @flow */ -\"use strict\"; +\\"use strict\\"; class SecurityCheckupTypedLogger { _data: Data; setError(value: ErrorCode) { - this._data[\"error\"] = value; + this._data[\\"error\\"] = value; } // Bug: right now, any incompatible type coming into a huge @@ -5501,9 +5503,9 @@ class SecurityCheckupTypedLogger { // TODO real solution is to specialize union reps for obvious cases, // e.g. (base type, list in decl order, set). Of course we could do // something quick to get the union size off the Ocaml call stack, - // but not sure it\'s worth doing that before the real solution. + // but not sure it's worth doing that before the real solution. ohThatsNotSoGood() { - (\"\": ErrorCode); // also, error pos omits this line completely + (\\"\\": ErrorCode); // also, error pos omits this line completely } } diff --git a/tests/flow/union_new/__snapshots__/jsfmt.spec.js.snap b/tests/flow/union_new/__snapshots__/jsfmt.spec.js.snap index d08fb0a16..72de80d5a 100644 --- a/tests/flow/union_new/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/union_new/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test issue-815.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`issue-815.js 1`] = ` "/* @flow */ type T = A|B; class U {}; @@ -43,8 +45,8 @@ class VirtualNode { " `; -exports[`test issue-824.js 1`] = ` -"import { B, C } from \"./issue-824-helper\"; +exports[`issue-824.js 1`] = ` +"import { B, C } from \\"./issue-824-helper\\"; type K = B | C; @@ -61,7 +63,7 @@ export default class A { } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import { B, C } from \"./issue-824-helper\"; +import { B, C } from \\"./issue-824-helper\\"; type K = B | C; @@ -80,8 +82,8 @@ export default class A { " `; -exports[`test issue-824-helper.js 1`] = ` -"import A from \"./issue-824\"; +exports[`issue-824-helper.js 1`] = ` +"import A from \\"./issue-824\\"; export class B extends A { which(): number { @@ -94,7 +96,7 @@ export class C extends A { } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import A from \"./issue-824\"; +import A from \\"./issue-824\\"; export class B extends A { which(): number { @@ -109,7 +111,7 @@ export class C extends A { " `; -exports[`test issue-1349.js 1`] = ` +exports[`issue-1349.js 1`] = ` "/* @flow */ var bar: Array<{b: ?boolean, c: number} | {b: boolean}> = [ @@ -126,29 +128,29 @@ var bar: Array<{ b: ?boolean, c: number } | { b: boolean }> = [ " `; -exports[`test issue-1371.js 1`] = ` -"function create(a: any): { type: \'B\', data: number } | { type: \'A\', data: string } +exports[`issue-1371.js 1`] = ` +"function create(a: any): { type: 'B', data: number } | { type: 'A', data: string } { return { - type: \'A\', + type: 'A', data: a } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function create( a: any -): { type: \"B\", data: number } | { type: \"A\", data: string } { +): { type: \\"B\\", data: number } | { type: \\"A\\", data: string } { return { - type: \"A\", + type: \\"A\\", data: a }; } " `; -exports[`test issue-1455.js 1`] = ` +exports[`issue-1455.js 1`] = ` "/* @flow */ -import type {Foobar} from \"./issue-1455-helper\" +import type {Foobar} from \\"./issue-1455-helper\\" function create(content: ?Foobar | String | Array) { } @@ -158,7 +160,7 @@ function node(content: ?Foobar | String | Array) { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ -import type { Foobar } from \"./issue-1455-helper\"; +import type { Foobar } from \\"./issue-1455-helper\\"; function create(content: ?Foobar | String | Array) {} @@ -168,7 +170,7 @@ function node(content: ?Foobar | String | Array) { " `; -exports[`test issue-1455-helper.js 1`] = ` +exports[`issue-1455-helper.js 1`] = ` "/* @flow */ export class Foobar { } @@ -179,17 +181,17 @@ export class Foobar {} " `; -exports[`test issue-1462-i.js 1`] = ` +exports[`issue-1462-i.js 1`] = ` "type Common = { }; type A = Common & { - type: \'A\', + type: 'A', foo: number }; type B = Common & { - type: \'B\', + type: 'B', foo: Array } @@ -206,12 +208,12 @@ function printAll(val: MyType) { type Common = {}; type A = Common & { - type: \"A\", + type: \\"A\\", foo: number }; type B = Common & { - type: \"B\", + type: \\"B\\", foo: Array }; @@ -227,17 +229,17 @@ function printAll(val: MyType) { " `; -exports[`test issue-1462-ii.js 1`] = ` +exports[`issue-1462-ii.js 1`] = ` "type Common = { }; type A = { - type: \'A\', + type: 'A', foo: number } & Common; type B = { - type: \'B\', + type: 'B', foo: Array } & Common; @@ -249,7 +251,7 @@ function print(x: number) { } function printAll(val: MyType) { - if (val.type === \'A\') { + if (val.type === 'A') { print(val.foo); } else { val.foo.forEach(print); @@ -260,14 +262,14 @@ type Common = {}; type A = & { - type: \"A\", + type: \\"A\\", foo: number } & Common; type B = & { - type: \"B\", + type: \\"B\\", foo: Array } & Common; @@ -279,7 +281,7 @@ function print(x: number) { } function printAll(val: MyType) { - if (val.type === \"A\") { + if (val.type === \\"A\\") { print(val.foo); } else { val.foo.forEach(print); @@ -288,7 +290,7 @@ function printAll(val: MyType) { " `; -exports[`test issue-1664.js 1`] = ` +exports[`issue-1664.js 1`] = ` "/* @flow */ type DataBase = { @@ -297,22 +299,22 @@ type DataBase = { }; type UserData = DataBase & { - kind: \"user\", + kind: \\"user\\", }; type SystemData = DataBase & { - kind: \"system\", + kind: \\"system\\", } type Data = UserData | SystemData; const data: Data = { - id: \"\", - name: \"\", - kind: \"system\", + id: \\"\\", + name: \\"\\", + kind: \\"system\\", } -if (data.kind === \"system\") { +if (data.kind === \\"system\\") { (data: SystemData); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -324,28 +326,28 @@ type DataBase = { }; type UserData = DataBase & { - kind: \"user\" + kind: \\"user\\" }; type SystemData = DataBase & { - kind: \"system\" + kind: \\"system\\" }; type Data = UserData | SystemData; const data: Data = { - id: \"\", - name: \"\", - kind: \"system\" + id: \\"\\", + name: \\"\\", + kind: \\"system\\" }; -if (data.kind === \"system\") { +if (data.kind === \\"system\\") { (data: SystemData); } " `; -exports[`test issue-1759.js 1`] = ` +exports[`issue-1759.js 1`] = ` "// @flow type X = ({a:true} & {b:string}) | ({a:false} & {c:string}); @@ -367,7 +369,7 @@ function hello(x: X): string { " `; -exports[`test issue-2232.js 1`] = ` +exports[`issue-2232.js 1`] = ` "/* @flow */ declare type Entity = { @@ -419,7 +421,7 @@ function test(f: Foo | EmptyFoo) { " `; -exports[`test test1.js 1`] = ` +exports[`test1.js 1`] = ` "// @noflow /** @@ -434,7 +436,7 @@ function obj(a: A1 | A2) { return a.x; } -const obj_result = obj({ x: \"\" }); // currently an error! (expect it to be OK) +const obj_result = obj({ x: \\"\\" }); // currently an error! (expect it to be OK) // Type definitions used above are defined below, but in an order that // deliberately makes their full resolution as lazy as possible. The call above @@ -458,7 +460,7 @@ function fun(a: A3 | A4) { return a(); } -const fun_result = fun(() => \"\"); +const fun_result = fun(() => \\"\\"); type A3 = () => B3; type A4 = () => B4; @@ -495,7 +497,7 @@ function obj(a: A1 | A2) { return a.x; } -const obj_result = obj({ x: \"\" }); // currently an error! (expect it to be OK) +const obj_result = obj({ x: \\"\\" }); // currently an error! (expect it to be OK) // Type definitions used above are defined below, but in an order that // deliberately makes their full resolution as lazy as possible. The call above @@ -519,7 +521,7 @@ function fun(a: A3 | A4) { return a(); } -const fun_result = fun(() => \"\"); +const fun_result = fun(() => \\"\\"); type A3 = () => B3; type A4 = () => B4; @@ -544,7 +546,7 @@ type A6 = B6[]; " `; -exports[`test test2.js 1`] = ` +exports[`test2.js 1`] = ` "// @noflow /** @@ -557,7 +559,7 @@ exports[`test test2.js 1`] = ` function obj(a: { x: number } | { x: string }) { } -obj(({ x: \"\" }: A1)); +obj(({ x: \\"\\" }: A1)); type A1 = { x: B1 }; @@ -569,7 +571,7 @@ type B1 = string; function fun(a: (() => number) | (() => string)) { } -fun(((() => \"\"): A2)); +fun(((() => \\"\\"): A2)); type A2 = () => B2; @@ -618,7 +620,7 @@ type B5 = string; function tup(a: [number,boolean] | [string,boolean]) { } -tup(([\"\",false]: A6)); +tup(([\\"\\",false]: A6)); type A6 = [B6,boolean]; type B6 = string; @@ -635,7 +637,7 @@ type B6 = string; function obj(a: { x: number } | { x: string }) {} -obj(({ x: \"\" }: A1)); +obj(({ x: \\"\\" }: A1)); type A1 = { x: B1 }; @@ -647,7 +649,7 @@ type B1 = string; function fun(a: (() => number) | (() => string)) {} -fun((() => \"\": A2)); +fun((() => \\"\\": A2)); type A2 = () => B2; @@ -696,14 +698,14 @@ type B5 = string; function tup(a: [number, boolean] | [string, boolean]) {} -tup(([\"\", false]: A6)); +tup(([\\"\\", false]: A6)); type A6 = [B6, boolean]; type B6 = string; " `; -exports[`test test3.js 1`] = ` +exports[`test3.js 1`] = ` "// @noflow /** @@ -766,7 +768,7 @@ type B2 = string; " `; -exports[`test test4.js 1`] = ` +exports[`test4.js 1`] = ` "// @noflow /** @@ -849,7 +851,7 @@ type B2 = string; " `; -exports[`test test5.js 1`] = ` +exports[`test5.js 1`] = ` "// @noflow /** @@ -914,7 +916,7 @@ function arr_set(x: string, i: number) { " `; -exports[`test test6.js 1`] = ` +exports[`test6.js 1`] = ` "// @noflow /** @@ -971,7 +973,7 @@ class C {} " `; -exports[`test test7.js 1`] = ` +exports[`test7.js 1`] = ` "// @noflow /** @@ -1034,7 +1036,7 @@ type PG = { x: X, y?: PG }; " `; -exports[`test test8.js 1`] = ` +exports[`test8.js 1`] = ` "// @noflow /** @@ -1085,7 +1087,7 @@ type H2_ = number; " `; -exports[`test test9.js 1`] = ` +exports[`test9.js 1`] = ` "// @noflow /** @@ -1122,7 +1124,7 @@ foo((x): number => square(x)); " `; -exports[`test test10.js 1`] = ` +exports[`test10.js 1`] = ` "// @noflow function id(x: X): X { return x; } @@ -1134,10 +1136,10 @@ function id(x: X): X { return x; } function check_prim(_: number | string) { } // ok -check_prim(\"\"); +check_prim(\\"\\"); -// ...even when they \"flow\" in -check_prim(id(\"\")); +// ...even when they \\"flow\\" in +check_prim(id(\\"\\")); ////////////////////////////// // class instance annotations @@ -1150,7 +1152,7 @@ function check_inst(_: C | D) { } // ok check_inst(new D); -// ...even when they \"flow\" in +// ...even when they \\"flow\\" in check_inst(id(new C)); //////////////////////// @@ -1169,10 +1171,10 @@ check_fun((x) => x); function check_obj(_: { x: number } | { x: string }) { } // ok -check_obj({ x: \"\" }); +check_obj({ x: \\"\\" }); // help! -check_obj({ x: id(\"\") }); +check_obj({ x: id(\\"\\") }); ///////////////////// // array annotations @@ -1181,10 +1183,10 @@ check_obj({ x: id(\"\") }); function check_arr(_: number[] | string[]) { } // ok -check_arr([\"\"]); +check_arr([\\"\\"]); // help! -check_arr([id(\"\")]); +check_arr([id(\\"\\")]); ////////////////////////////////////// // generic class instance annotations @@ -1209,10 +1211,10 @@ function id(x: X): X { function check_prim(_: number | string) {} // ok -check_prim(\"\"); +check_prim(\\"\\"); -// ...even when they \"flow\" in -check_prim(id(\"\")); +// ...even when they \\"flow\\" in +check_prim(id(\\"\\")); ////////////////////////////// // class instance annotations @@ -1225,7 +1227,7 @@ function check_inst(_: C | D) {} // ok check_inst(new D()); -// ...even when they \"flow\" in +// ...even when they \\"flow\\" in check_inst(id(new C())); //////////////////////// @@ -1244,10 +1246,10 @@ check_fun(x => x); function check_obj(_: { x: number } | { x: string }) {} // ok -check_obj({ x: \"\" }); +check_obj({ x: \\"\\" }); // help! -check_obj({ x: id(\"\") }); +check_obj({ x: id(\\"\\") }); ///////////////////// // array annotations @@ -1256,10 +1258,10 @@ check_obj({ x: id(\"\") }); function check_arr(_: number[] | string[]) {} // ok -check_arr([\"\"]); +check_arr([\\"\\"]); // help! -check_arr([id(\"\")]); +check_arr([id(\\"\\")]); ////////////////////////////////////// // generic class instance annotations @@ -1273,47 +1275,47 @@ check_poly_inst(new P()); " `; -exports[`test test11.js 1`] = ` +exports[`test11.js 1`] = ` "// @noflow // disjoint unions function length(list: List) { - if (list.kind === \"cons\") return length(list.next) + 1; + if (list.kind === \\"cons\\") return length(list.next) + 1; else return 0; } -length({ kind: \"nil\" }); -length({ kind: \"cons\" }); // missing \`next\` -length({ kind: \"cons\", next: { kind: \"nil\" } }); -length({ kind: \"empty\" }); // \`kind\` not found +length({ kind: \\"nil\\" }); +length({ kind: \\"cons\\" }); // missing \`next\` +length({ kind: \\"cons\\", next: { kind: \\"nil\\" } }); +length({ kind: \\"empty\\" }); // \`kind\` not found type List = Nil | Cons; -type Nil = { kind: \"nil\" }; -type Cons = { kind: \"cons\", next: List }; +type Nil = { kind: \\"nil\\" }; +type Cons = { kind: \\"cons\\", next: List }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @noflow // disjoint unions function length(list: List) { - if (list.kind === \"cons\") return length(list.next) + 1; + if (list.kind === \\"cons\\") return length(list.next) + 1; else return 0; } -length({ kind: \"nil\" }); -length({ kind: \"cons\" }); // missing \`next\` -length({ kind: \"cons\", next: { kind: \"nil\" } }); -length({ kind: \"empty\" }); // \`kind\` not found +length({ kind: \\"nil\\" }); +length({ kind: \\"cons\\" }); // missing \`next\` +length({ kind: \\"cons\\", next: { kind: \\"nil\\" } }); +length({ kind: \\"empty\\" }); // \`kind\` not found type List = Nil | Cons; -type Nil = { kind: \"nil\" }; -type Cons = { kind: \"cons\", next: List }; +type Nil = { kind: \\"nil\\" }; +type Cons = { kind: \\"cons\\", next: List }; " `; -exports[`test test12.js 1`] = ` +exports[`test12.js 1`] = ` "// @noflow // polymorphic recursive types @@ -1338,16 +1340,16 @@ function rec(x: F): G | H { " `; -exports[`test test13.js 1`] = ` +exports[`test13.js 1`] = ` "// @noflow /* ensure there are no unintended side effects when trying branches */ -({type: \'B\', id: \'hi\'}: { - type: \'A\'; +({type: 'B', id: 'hi'}: { + type: 'A'; id: ?string; } | { - type: \'B\'; + type: 'B'; id: string; }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1355,19 +1357,19 @@ exports[`test test13.js 1`] = ` /* ensure there are no unintended side effects when trying branches */ -({ type: \"B\", id: \"hi\" }: +({ type: \\"B\\", id: \\"hi\\" }: | { - type: \"A\", + type: \\"A\\", id: ?string } | { - type: \"B\", + type: \\"B\\", id: string }); " `; -exports[`test test14.js 1`] = ` +exports[`test14.js 1`] = ` "// @noflow // annotations @@ -1398,17 +1400,17 @@ function foo(c: C) { " `; -exports[`test test15.js 1`] = ` +exports[`test15.js 1`] = ` "// @noflow // functions as objects function foo(target: EventTarget) { - target.addEventListener(\'click\', (e) => {}); + target.addEventListener('click', (e) => {}); } declare class EventTarget { - addEventListener(type: \'foo\', listener: KeyboardEventHandler): void; + addEventListener(type: 'foo', listener: KeyboardEventHandler): void; addEventListener(type: string, listener: EventHandler): void; } @@ -1429,11 +1431,11 @@ bar(() => { }); // functions as objects function foo(target: EventTarget) { - target.addEventListener(\"click\", e => {}); + target.addEventListener(\\"click\\", e => {}); } declare class EventTarget { - addEventListener(type: \"foo\", listener: KeyboardEventHandler): void, + addEventListener(type: \\"foo\\", listener: KeyboardEventHandler): void, addEventListener(type: string, listener: EventHandler): void } @@ -1451,7 +1453,7 @@ bar(() => {}); " `; -exports[`test test16.js 1`] = ` +exports[`test16.js 1`] = ` "// @noflow // annotations @@ -1469,7 +1471,7 @@ bar(() => qux()); var x = false; function qux() { return x; } -x = \"\"; +x = \\"\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @noflow @@ -1490,11 +1492,11 @@ var x = false; function qux() { return x; } -x = \"\"; +x = \\"\\"; " `; -exports[`test test17.js 1`] = ` +exports[`test17.js 1`] = ` "// @noflow // Array#concat @@ -1513,7 +1515,7 @@ exports[`test test17.js 1`] = ` " `; -exports[`test test18.js 1`] = ` +exports[`test18.js 1`] = ` "// @noflow // method overloads @@ -1544,7 +1546,7 @@ new C().m(f()); " `; -exports[`test test19.js 1`] = ` +exports[`test19.js 1`] = ` "// @noflow // constructor overloads @@ -1573,21 +1575,21 @@ declare class D { " `; -exports[`test test20.js 1`] = ` +exports[`test20.js 1`] = ` "// @noflow // Array#reduce [0,1].reduce((x,y,i) => y); -[\"a\", \"b\"].reduce( +[\\"a\\", \\"b\\"].reduce( (regex, representation, index) => { - return regex + (index ? \'|\' : \'\') + \'(\' + representation + \')\'; + return regex + (index ? '|' : '') + '(' + representation + ')'; }, - \'\', + '', ); -[\"\"].reduce((acc,str) => acc * str.length); +[\\"\\"].reduce((acc,str) => acc * str.length); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @noflow @@ -1595,63 +1597,63 @@ exports[`test test20.js 1`] = ` [0, 1].reduce((x, y, i) => y); -[\"a\", \"b\"].reduce( +[\\"a\\", \\"b\\"].reduce( (regex, representation, index) => { - return regex + (index ? \"|\" : \"\") + \"(\" + representation + \")\"; + return regex + (index ? \\"|\\" : \\"\\") + \\"(\\" + representation + \\")\\"; }, - \"\" + \\"\\" ); -[\"\"].reduce((acc, str) => acc * str.length); +[\\"\\"].reduce((acc, str) => acc * str.length); " `; -exports[`test test21.js 1`] = ` +exports[`test21.js 1`] = ` "// @noflow // annotations for disjoint unions type T = - | { type: \"FOO\", x: number } - | { type: \"BAR\", x: string } + | { type: \\"FOO\\", x: number } + | { type: \\"BAR\\", x: string } -({ type: (bar(): \"BAR\"), x: str() }: T); +({ type: (bar(): \\"BAR\\"), x: str() }: T); ({ type: bar(), x: str() }: T); ({ type: bar(), x: (str(): string) }: T); function bar() { - return \"BAR\"; + return \\"BAR\\"; } function str() { - return \"hello\"; + return \\"hello\\"; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @noflow // annotations for disjoint unions -type T = { type: \"FOO\", x: number } | { type: \"BAR\", x: string }; +type T = { type: \\"FOO\\", x: number } | { type: \\"BAR\\", x: string }; -({ type: (bar(): \"BAR\"), x: str() }: T); +({ type: (bar(): \\"BAR\\"), x: str() }: T); ({ type: bar(), x: str() }: T); ({ type: bar(), x: (str(): string) }: T); function bar() { - return \"BAR\"; + return \\"BAR\\"; } function str() { - return \"hello\"; + return \\"hello\\"; } " `; -exports[`test test22.js 1`] = ` +exports[`test22.js 1`] = ` "// @noflow // refinement of disjoint unions @@ -1659,18 +1661,18 @@ exports[`test test22.js 1`] = ` type Empty = { } type Success = { - type: \'SUCCESS\'; + type: 'SUCCESS'; result: string; }; type Error = { - type: \'ERROR\'; + type: 'ERROR'; } & Empty; export type T = Success | Error; function foo(x: T) { - if (x.type === \'SUCCESS\') return x.result; + if (x.type === 'SUCCESS') return x.result; else return x.result; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1681,26 +1683,26 @@ function foo(x: T) { type Empty = {}; type Success = { - type: \"SUCCESS\", + type: \\"SUCCESS\\", result: string }; type Error = & { - type: \"ERROR\" + type: \\"ERROR\\" } & Empty; export type T = Success | Error; function foo(x: T) { - if (x.type === \"SUCCESS\") return x.result; + if (x.type === \\"SUCCESS\\") return x.result; else return x.result; } " `; -exports[`test test23.js 1`] = ` +exports[`test23.js 1`] = ` "// @noflow // nested intersections (see also lib/test23_lib.js) @@ -1711,7 +1713,7 @@ type Obj = NestedObj & { x: string }; function foo(obj: Obj) { obj.x; // should be OK - obj.x; // should also be OK (the check above shouldn\'t affect anything) + obj.x; // should also be OK (the check above shouldn't affect anything) } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @noflow @@ -1724,12 +1726,12 @@ type Obj = NestedObj & { x: string }; function foo(obj: Obj) { obj.x; // should be OK - obj.x; // should also be OK (the check above shouldn\'t affect anything) + obj.x; // should also be OK (the check above shouldn't affect anything) } " `; -exports[`test test24.js 1`] = ` +exports[`test24.js 1`] = ` "// @noflow // scaling test for full type resolution @@ -1799,7 +1801,7 @@ declare class D extends C { " `; -exports[`test test25.js 1`] = ` +exports[`test25.js 1`] = ` "// @noflow // termination test (see also lib/test25_lib.js) @@ -1827,7 +1829,7 @@ function foo(rows: Rows, set: Set) { " `; -exports[`test test26.js 1`] = ` +exports[`test26.js 1`] = ` "// @noflow declare function foo(x: number): number; @@ -1843,11 +1845,11 @@ declare var y: T; (foo(y): T); declare class Record { - set(x: \'foo\', y: number): void; - set(x: \'bar\', y: string): void; + set(x: 'foo', y: number): void; + set(x: 'bar', y: string): void; } -new Record().set(\'foo\', \"42\"); +new Record().set('foo', \\"42\\"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @noflow @@ -1864,15 +1866,15 @@ declare var y: T; (foo(y): T); declare class Record { - set(x: \"foo\", y: number): void, - set(x: \"bar\", y: string): void + set(x: \\"foo\\", y: number): void, + set(x: \\"bar\\", y: string): void } -new Record().set(\"foo\", \"42\"); +new Record().set(\\"foo\\", \\"42\\"); " `; -exports[`test test27.js 1`] = ` +exports[`test27.js 1`] = ` "// @noflow type X = ({a:true} & {b:string}) | ({a:false} & {c:string}); @@ -1927,10 +1929,10 @@ function hello4(x: X): string { " `; -exports[`test test29.js 1`] = ` +exports[`test29.js 1`] = ` "// @noflow -// Make sure caching doesn\'t cause a spurious successful match (e.g., when a +// Make sure caching doesn't cause a spurious successful match (e.g., when a // failed match is tried again). This may happen, e.g., when checking // polymorphic definitions, where the same code may be checked multiple times // with different instantiations. @@ -1962,7 +1964,7 @@ class C { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @noflow -// Make sure caching doesn\'t cause a spurious successful match (e.g., when a +// Make sure caching doesn't cause a spurious successful match (e.g., when a // failed match is tried again). This may happen, e.g., when checking // polymorphic definitions, where the same code may be checked multiple times // with different instantiations. @@ -1988,45 +1990,45 @@ class C { " `; -exports[`test test30.js 1`] = ` +exports[`test30.js 1`] = ` "// @noflow -const Constants = require(\'./test30-helper\'); +const Constants = require('./test30-helper'); type ActionType = - | { type: \'foo\', x: number } - | { type: \'bar\', x: number } + | { type: 'foo', x: number } + | { type: 'bar', x: number } ({ type: Constants.BAR, x: 0 }: ActionType); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @noflow -const Constants = require(\"./test30-helper\"); +const Constants = require(\\"./test30-helper\\"); -type ActionType = { type: \"foo\", x: number } | { type: \"bar\", x: number }; +type ActionType = { type: \\"foo\\", x: number } | { type: \\"bar\\", x: number }; ({ type: Constants.BAR, x: 0 }: ActionType); " `; -exports[`test test30-helper.js 1`] = ` +exports[`test30-helper.js 1`] = ` "// @noflow module.exports = { - FOO: \'foo\', - BAR: \'bar\', + FOO: 'foo', + BAR: 'bar', } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @noflow module.exports = { - FOO: \"foo\", - BAR: \"bar\" + FOO: \\"foo\\", + BAR: \\"bar\\" }; " `; -exports[`test test31.js 1`] = ` +exports[`test31.js 1`] = ` "// @noflow // make sure tuples are type arguments (as used e.g. when viewing maps as @@ -2049,7 +2051,7 @@ declare function convert(iter: SomeIterable<[K,V]>): ImmutableMap; function foo(): ImmutableMap { const countersGlobalMap = new SomeMap(); - countersGlobalMap.set(\"\", false); + countersGlobalMap.set(\\"\\", false); return convert(countersGlobalMap); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2075,30 +2077,30 @@ declare function convert(iter: SomeIterable<[K, V]>): ImmutableMap; function foo(): ImmutableMap { const countersGlobalMap = new SomeMap(); - countersGlobalMap.set(\"\", false); + countersGlobalMap.set(\\"\\", false); return convert(countersGlobalMap); } " `; -exports[`test test32.js 1`] = ` +exports[`test32.js 1`] = ` "// @flow -// make sure that full resolution jobs don\'t cache improperly to signal success +// make sure that full resolution jobs don't cache improperly to signal success // when they have failed earlier function foo(value: Indirect | number): Indirect | number { - const castedValue: number = typeof value === \'number\' ? value : 0; + const castedValue: number = typeof value === 'number' ? value : 0; return castedValue; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @flow -// make sure that full resolution jobs don\'t cache improperly to signal success +// make sure that full resolution jobs don't cache improperly to signal success // when they have failed earlier function foo(value: Indirect | number): Indirect | number { - const castedValue: number = typeof value === \"number\" ? value : 0; + const castedValue: number = typeof value === \\"number\\" ? value : 0; return castedValue; } " diff --git a/tests/flow/union_new/lib/__snapshots__/jsfmt.spec.js.snap b/tests/flow/union_new/lib/__snapshots__/jsfmt.spec.js.snap index 01e0161f4..678c14443 100644 --- a/tests/flow/union_new/lib/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/union_new/lib/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test test23_lib.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test23_lib.js 1`] = ` "declare class SomeLibClass { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ declare class SomeLibClass {} " `; -exports[`test test25_lib.js 1`] = ` +exports[`test25_lib.js 1`] = ` "declare class Set { add(): Set; } @@ -52,7 +54,7 @@ declare class Rows { " `; -exports[`test test32_lib.js 1`] = ` +exports[`test32_lib.js 1`] = ` "type Indirect = Array; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ type Indirect = Array; diff --git a/tests/flow/unreachable/__snapshots__/jsfmt.spec.js.snap b/tests/flow/unreachable/__snapshots__/jsfmt.spec.js.snap index 84eeca73c..58cac920d 100644 --- a/tests/flow/unreachable/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/unreachable/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test typecheck.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typecheck.js 1`] = ` "/* @flow */ function test1(): string { @@ -49,11 +51,11 @@ function test2() { " `; -exports[`test unreachable.js 1`] = ` +exports[`unreachable.js 1`] = ` "/* @flow */ function foo(x, y) { - \"use strict\"; + \\"use strict\\"; return bar(x) + baz(y); // function declaration is hoisted, should not generate warning @@ -81,7 +83,7 @@ foo(1, 2); /* @flow */ function foo(x, y) { - \"use strict\"; + \\"use strict\\"; return bar(x) + baz(y); // function declaration is hoisted, should not generate warning diff --git a/tests/flow/value/__snapshots__/jsfmt.spec.js.snap b/tests/flow/value/__snapshots__/jsfmt.spec.js.snap index 2e15632e0..da9c2fb8a 100644 --- a/tests/flow/value/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/value/__snapshots__/jsfmt.spec.js.snap @@ -1,16 +1,18 @@ -exports[`test value.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`value.js 1`] = ` "var o = {}; -o[\"x\"] = 4; -var y:string = o[\"x\"]; +o[\\"x\\"] = 4; +var y:string = o[\\"x\\"]; var table: { [_: string]: number } = {}; -table[\"x\"] = \"hello\"; +table[\\"x\\"] = \\"hello\\"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var o = {}; -o[\"x\"] = 4; -var y: string = o[\"x\"]; +o[\\"x\\"] = 4; +var y: string = o[\\"x\\"]; var table: { [_: string]: number } = {}; -table[\"x\"] = \"hello\"; +table[\\"x\\"] = \\"hello\\"; " `; diff --git a/tests/flow/vim_emacs_errors/__snapshots__/jsfmt.spec.js.snap b/tests/flow/vim_emacs_errors/__snapshots__/jsfmt.spec.js.snap index 5491394ff..bb5e476dc 100644 --- a/tests/flow/vim_emacs_errors/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/vim_emacs_errors/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "// @flow (123: string); diff --git a/tests/flow/weakmode/__snapshots__/jsfmt.spec.js.snap b/tests/flow/weakmode/__snapshots__/jsfmt.spec.js.snap index 7dc1389d8..3558c5a73 100644 --- a/tests/flow/weakmode/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/weakmode/__snapshots__/jsfmt.spec.js.snap @@ -1,9 +1,11 @@ -exports[`test should_fail_without_weak.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should_fail_without_weak.js 1`] = ` "/* @flow */ // This should fail without weak mode, because of the glaring type error. function returns_a_string() { - return \"Hello\"; + return \\"Hello\\"; } function expects_an_int() { @@ -14,7 +16,7 @@ function expects_an_int() { // This should fail without weak mode, because of the glaring type error. function returns_a_string() { - return \"Hello\"; + return \\"Hello\\"; } function expects_an_int() { @@ -23,12 +25,12 @@ function expects_an_int() { " `; -exports[`test should_pass_with_weak.js 1`] = ` +exports[`should_pass_with_weak.js 1`] = ` "/* @flow weak */ // This should fail without weak mode, because of the glaring type error. function returns_a_string() { - return \"Hello\"; + return \\"Hello\\"; } function expects_an_int() { @@ -39,7 +41,7 @@ function expects_an_int() { // This should fail without weak mode, because of the glaring type error. function returns_a_string() { - return \"Hello\"; + return \\"Hello\\"; } function expects_an_int() { diff --git a/tests/flow/while/__snapshots__/jsfmt.spec.js.snap b/tests/flow/while/__snapshots__/jsfmt.spec.js.snap index c2d260910..0ccb2cd51 100644 --- a/tests/flow/while/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/while/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test abnormal.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`abnormal.js 1`] = ` "/* @flow */ function foo(x: boolean) { @@ -9,7 +11,7 @@ function foo(x: boolean) { } return; } - //console.log(\'this is still reachable\'); + //console.log('this is still reachable'); } function bar(x: boolean) { @@ -17,7 +19,7 @@ function bar(x: boolean) { while (ii > 0) { return; } - //console.log(\'this is still reachable\'); + //console.log('this is still reachable'); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /* @flow */ @@ -30,7 +32,7 @@ function foo(x: boolean) { } return; } - //console.log(\'this is still reachable\'); + //console.log('this is still reachable'); } function bar(x: boolean) { @@ -38,12 +40,12 @@ function bar(x: boolean) { while (ii > 0) { return; } - //console.log(\'this is still reachable\'); + //console.log('this is still reachable'); } " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "class C { m() { return new C; } } diff --git a/tests/flow/window/__snapshots__/jsfmt.spec.js.snap b/tests/flow/window/__snapshots__/jsfmt.spec.js.snap index 419a4d804..50de50c1a 100644 --- a/tests/flow/window/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/window/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test window1.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`window1.js 1`] = ` "/* @providesModule Window1 */ @@ -11,7 +13,7 @@ module.exports = window.history; " `; -exports[`test window2.js 1`] = ` +exports[`window2.js 1`] = ` "/* @providesModule Window2 */ module.exports = window.parent; diff --git a/tests/flow/x/__snapshots__/jsfmt.spec.js.snap b/tests/flow/x/__snapshots__/jsfmt.spec.js.snap index 09da1f3f8..0ed8994a3 100644 --- a/tests/flow/x/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/x/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test XControllerURIBuilder.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`XControllerURIBuilder.js 1`] = ` "/** * @generated SignedSource<<13ca42bbc7fe91f15057861e18a77d88>> * @@ -23,7 +25,7 @@ class XControllerURIBuilder { // ... getURI() { // ... - var tokenRegex = new RegExp(/^\\{(\\?)?(.+?)\\}$/); + var tokenRegex = new RegExp(/^\\\\{(\\\\?)?(.+?)\\\\}$/); // ... } } @@ -53,7 +55,7 @@ class XControllerURIBuilder { // ... getURI() { // ... - var tokenRegex = new RegExp(/^\\{(\\?)?(.+?)\\}$/); + var tokenRegex = new RegExp(/^\\\\{(\\\\?)?(.+?)\\\\}$/); // ... } } diff --git a/tests/flow_comments/__snapshots__/jsfmt.spec.js.snap b/tests/flow_comments/__snapshots__/jsfmt.spec.js.snap index bdc17200d..b4225c2bb 100644 --- a/tests/flow_comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow_comments/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test arrow.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`arrow.js 1`] = ` "// Error const beep = (data/*: Object*/) => {} @@ -13,7 +15,7 @@ const beep = (data: Object, secondData: Object) => {}; " `; -exports[`test arrow.js 2`] = ` +exports[`arrow.js 2`] = ` "// Error const beep = (data/*: Object*/) => {} diff --git a/tests/flow_method/__snapshots__/jsfmt.spec.js.snap b/tests/flow_method/__snapshots__/jsfmt.spec.js.snap index 59d94ddce..04c20c297 100644 --- a/tests/flow_method/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow_method/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test method.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`method.js 1`] = ` "type T = { method: () => void }; type T = { method(): void }; declare class X { method(): void } diff --git a/tests/for/__snapshots__/jsfmt.spec.js.snap b/tests/for/__snapshots__/jsfmt.spec.js.snap index a6f873b0b..50d9ae1a9 100644 --- a/tests/for/__snapshots__/jsfmt.spec.js.snap +++ b/tests/for/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test for.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`for.js 1`] = ` "for (;;) {} for (var i = 0; i < 10; ++i) {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -9,7 +11,7 @@ for (var i = 0; i < 10; ++i) { " `; -exports[`test in.js 1`] = ` +exports[`in.js 1`] = ` "for ((x in a);;) {} for (a=(a in b);;) {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -20,7 +22,7 @@ for (a = (a in b); ; ) { " `; -exports[`test var.js 1`] = ` +exports[`var.js 1`] = ` "for (a in b) var c = {}; []; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (a in b) diff --git a/tests/function/__snapshots__/jsfmt.spec.js.snap b/tests/function/__snapshots__/jsfmt.spec.js.snap index e029e509f..36e6e5ded 100644 --- a/tests/function/__snapshots__/jsfmt.spec.js.snap +++ b/tests/function/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test function_expression.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`function_expression.js 1`] = ` "(function() {}).length typeof (function() {}); export default (function() {})(); diff --git a/tests/if_comments/__snapshots__/jsfmt.spec.js.snap b/tests/if_comments/__snapshots__/jsfmt.spec.js.snap index 569510378..96e8c1407 100644 --- a/tests/if_comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/if_comments/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test if_comments.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`if_comments.js 1`] = ` "async function f() { if (untrackedChoice === 0) /* Cancel */ { return null; diff --git a/tests/ignore/__snapshots__/jsfmt.spec.js.snap b/tests/ignore/__snapshots__/jsfmt.spec.js.snap index 86da34b2f..8c530fdae 100644 --- a/tests/ignore/__snapshots__/jsfmt.spec.js.snap +++ b/tests/ignore/__snapshots__/jsfmt.spec.js.snap @@ -1,13 +1,15 @@ -exports[`test ignore.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ignore.js 1`] = ` "function a() { // prettier-ignore var fnString = - \'\"\' + this.USE + \' \' + this.STRICT + \'\";\\n\' + + '\\"' + this.USE + ' ' + this.STRICT + '\\";\\\\n' + this.filterPrefix() + - \'var fn=\' + this.generateFunction(\'fn\', \'s,l,a,i\') + + 'var fn=' + this.generateFunction('fn', 's,l,a,i') + extra + this.watchFns() + - \'return fn;\'; + 'return fn;'; // prettier-ignore const identity = Matrix.create( @@ -18,24 +20,24 @@ exports[`test ignore.js 1`] = ` // prettier-ignore console.error( - \'In order to use \' + prompt + \', you need to configure a \' + - \'few environment variables to be able to commit to the \' + - \'repository. Follow those steps to get you setup:\\n\' + - \'\\n\' + - \'Go to https://github.com/settings/tokens/new\\n\' + - \' - Fill \"Token description\" with \"\' + prompt + \' for \' + - repoSlug + \'\"\\n\' + - \' - Check \"public_repo\"\\n\' + - \' - Press \"Generate Token\"\\n\' + - \'\\n\' + - \'In a different tab, go to https://travis-ci.org/\' + - repoSlug + \'/settings\\n\' + - \' - Make sure \"Build only if .travis.yml is present\" is ON\\n\' + - \' - Fill \"Name\" with \"GITHUB_USER\" and \"Value\" with the name of the \' + - \'account you generated the token with. Press \"Add\"\\n\' + - \'\\n\' + - \'Once this is done, commit anything to the repository to restart \' + - \'Travis and it should work :)\' + 'In order to use ' + prompt + ', you need to configure a ' + + 'few environment variables to be able to commit to the ' + + 'repository. Follow those steps to get you setup:\\\\n' + + '\\\\n' + + 'Go to https://github.com/settings/tokens/new\\\\n' + + ' - Fill \\"Token description\\" with \\"' + prompt + ' for ' + + repoSlug + '\\"\\\\n' + + ' - Check \\"public_repo\\"\\\\n' + + ' - Press \\"Generate Token\\"\\\\n' + + '\\\\n' + + 'In a different tab, go to https://travis-ci.org/' + + repoSlug + '/settings\\\\n' + + ' - Make sure \\"Build only if .travis.yml is present\\" is ON\\\\n' + + ' - Fill \\"Name\\" with \\"GITHUB_USER\\" and \\"Value\\" with the name of the ' + + 'account you generated the token with. Press \\"Add\\"\\\\n' + + '\\\\n' + + 'Once this is done, commit anything to the repository to restart ' + + 'Travis and it should work :)' ); // Incorrectly indented on purpose @@ -53,12 +55,12 @@ exports[`test ignore.js 1`] = ` function a() { // prettier-ignore var fnString = - \'\"\' + this.USE + \' \' + this.STRICT + \'\";\\n\' + + '\\"' + this.USE + ' ' + this.STRICT + '\\";\\\\n' + this.filterPrefix() + - \'var fn=\' + this.generateFunction(\'fn\', \'s,l,a,i\') + + 'var fn=' + this.generateFunction('fn', 's,l,a,i') + extra + this.watchFns() + - \'return fn;\'; + 'return fn;'; // prettier-ignore const identity = Matrix.create( @@ -69,24 +71,24 @@ function a() { // prettier-ignore console.error( - \'In order to use \' + prompt + \', you need to configure a \' + - \'few environment variables to be able to commit to the \' + - \'repository. Follow those steps to get you setup:\\n\' + - \'\\n\' + - \'Go to https://github.com/settings/tokens/new\\n\' + - \' - Fill \"Token description\" with \"\' + prompt + \' for \' + - repoSlug + \'\"\\n\' + - \' - Check \"public_repo\"\\n\' + - \' - Press \"Generate Token\"\\n\' + - \'\\n\' + - \'In a different tab, go to https://travis-ci.org/\' + - repoSlug + \'/settings\\n\' + - \' - Make sure \"Build only if .travis.yml is present\" is ON\\n\' + - \' - Fill \"Name\" with \"GITHUB_USER\" and \"Value\" with the name of the \' + - \'account you generated the token with. Press \"Add\"\\n\' + - \'\\n\' + - \'Once this is done, commit anything to the repository to restart \' + - \'Travis and it should work :)\' + 'In order to use ' + prompt + ', you need to configure a ' + + 'few environment variables to be able to commit to the ' + + 'repository. Follow those steps to get you setup:\\\\n' + + '\\\\n' + + 'Go to https://github.com/settings/tokens/new\\\\n' + + ' - Fill \\"Token description\\" with \\"' + prompt + ' for ' + + repoSlug + '\\"\\\\n' + + ' - Check \\"public_repo\\"\\\\n' + + ' - Press \\"Generate Token\\"\\\\n' + + '\\\\n' + + 'In a different tab, go to https://travis-ci.org/' + + repoSlug + '/settings\\\\n' + + ' - Make sure \\"Build only if .travis.yml is present\\" is ON\\\\n' + + ' - Fill \\"Name\\" with \\"GITHUB_USER\\" and \\"Value\\" with the name of the ' + + 'account you generated the token with. Press \\"Add\\"\\\\n' + + '\\\\n' + + 'Once this is done, commit anything to the repository to restart ' + + 'Travis and it should work :)' ); // Incorrectly indented on purpose diff --git a/tests/import/__snapshots__/jsfmt.spec.js.snap b/tests/import/__snapshots__/jsfmt.spec.js.snap index 921f31470..193a29089 100644 --- a/tests/import/__snapshots__/jsfmt.spec.js.snap +++ b/tests/import/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test brackets.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`brackets.js 1`] = ` "import { runTaskForChanged, description, @@ -8,8 +10,8 @@ exports[`test brackets.js 1`] = ` multiLine, andMore, soWeCanGetItTo80Columns -} from \'.\'; -import {fitsIn, oneLine} from \'.\'; +} from '.'; +import {fitsIn, oneLine} from '.'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import { runTaskForChanged, @@ -20,12 +22,12 @@ import { multiLine, andMore, soWeCanGetItTo80Columns -} from \".\"; -import { fitsIn, oneLine } from \".\"; +} from \\".\\"; +import { fitsIn, oneLine } from \\".\\"; " `; -exports[`test brackets.js 2`] = ` +exports[`brackets.js 2`] = ` "import { runTaskForChanged, description, @@ -35,8 +37,8 @@ exports[`test brackets.js 2`] = ` multiLine, andMore, soWeCanGetItTo80Columns -} from \'.\'; -import {fitsIn, oneLine} from \'.\'; +} from '.'; +import {fitsIn, oneLine} from '.'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import { runTaskForChanged, @@ -47,37 +49,37 @@ import { multiLine, andMore, soWeCanGetItTo80Columns -} from \".\"; -import {fitsIn, oneLine} from \".\"; +} from \\".\\"; +import {fitsIn, oneLine} from \\".\\"; " `; -exports[`test long-line.js 1`] = ` -"import someCoolUtilWithARatherLongName from \'../../../../utils/someCoolUtilWithARatherLongName\'; +exports[`long-line.js 1`] = ` +"import someCoolUtilWithARatherLongName from '../../../../utils/someCoolUtilWithARatherLongName'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import someCoolUtilWithARatherLongName - from \"../../../../utils/someCoolUtilWithARatherLongName\"; + from \\"../../../../utils/someCoolUtilWithARatherLongName\\"; " `; -exports[`test long-line.js 2`] = ` -"import someCoolUtilWithARatherLongName from \'../../../../utils/someCoolUtilWithARatherLongName\'; +exports[`long-line.js 2`] = ` +"import someCoolUtilWithARatherLongName from '../../../../utils/someCoolUtilWithARatherLongName'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import someCoolUtilWithARatherLongName - from \"../../../../utils/someCoolUtilWithARatherLongName\"; + from \\"../../../../utils/someCoolUtilWithARatherLongName\\"; " `; -exports[`test multiple_standalones.js 1`] = ` -"import a, * as b from \'a\'; +exports[`multiple_standalones.js 1`] = ` +"import a, * as b from 'a'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import a, * as b from \"a\"; +import a, * as b from \\"a\\"; " `; -exports[`test multiple_standalones.js 2`] = ` -"import a, * as b from \'a\'; +exports[`multiple_standalones.js 2`] = ` +"import a, * as b from 'a'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -import a, * as b from \"a\"; +import a, * as b from \\"a\\"; " `; diff --git a/tests/interface/__snapshots__/jsfmt.spec.js.snap b/tests/interface/__snapshots__/jsfmt.spec.js.snap index a08e29fc9..bcdda38e9 100644 --- a/tests/interface/__snapshots__/jsfmt.spec.js.snap +++ b/tests/interface/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test module.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`module.js 1`] = ` "declare module X { declare interface Y { x: number; } } diff --git a/tests/jsx-multiline-assign/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-multiline-assign/__snapshots__/jsfmt.spec.js.snap index ec0ade12c..081bf0d14 100644 --- a/tests/jsx-multiline-assign/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx-multiline-assign/__snapshots__/jsfmt.spec.js.snap @@ -1,48 +1,50 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "const comp1 = ( -
+
Keep the wrapping parens.
); -const comp2 =
+const comp2 =
Create wrapping parens.
; -comp2A =
+comp2A =
Create wrapping parens.
; -const comp3 =
Bump to next line without parens
; +const comp3 =
Bump to next line without parens
; -const comp4 =
Create wrapping parens and indent all the things.
; +const comp4 =
Create wrapping parens and indent all the things.
; const comp5 =
Keep it on one line.
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const comp1 = ( -
+
Keep the wrapping parens.
); const comp2 = ( -
+
Create wrapping parens.
); comp2A = ( -
+
Create wrapping parens.
); const comp3 = ( -
Bump to next line without parens
+
Bump to next line without parens
); const comp4 = ( -
+
Create wrapping parens and indent all the things.
); diff --git a/tests/jsx-newlines/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-newlines/__snapshots__/jsfmt.spec.js.snap index f89e70fd4..2638cada8 100644 --- a/tests/jsx-newlines/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx-newlines/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "keep =

Welcome to the Universal React Starter-kyt. This starter kyt should serve as the base for an advanced, @@ -76,7 +78,7 @@ newlines_elems = regression_extra_newline = (

New Messages
@@ -87,8 +89,8 @@ regression_extra_newline_2 = (
( )
@@ -168,7 +170,7 @@ newlines_elems = ( regression_extra_newline = (
- + New Messages
); @@ -177,8 +179,8 @@ regression_extra_newline_2 = (
( )
diff --git a/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap index e48419f18..095e31063 100644 --- a/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx-significant-space/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "after = foo bar @@ -50,19 +52,19 @@ nest_plz =
regression_not_transformed_1 = - ; + ; regression_not_transformed_2 = - ; + ; similar_1 = - ; + ; similar_2 = - ; + ; similar_3 = - ; + ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ after = ( @@ -79,7 +81,7 @@ before = ( before_break1 = ( - {\" \"}foo + {\\" \\"}foo ); @@ -88,13 +90,13 @@ before_break2 = ( - {\" \"}foo + {\\" \\"}foo ); after_break = ( - foo{\" \"} + foo{\\" \\"} ); @@ -131,33 +133,33 @@ nest_plz = ( regression_not_transformed_1 = ( - {\" \"} + {\\" \\"} ); regression_not_transformed_2 = ( - {\" \"} + {\\" \\"} ); similar_1 = ( - {\" \"} - + {\\" \\"} + ); similar_2 = ( - - {\" \"} + + {\\" \\"} ); similar_3 = ( - + ); " diff --git a/tests/jsx-split-attrs/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-split-attrs/__snapshots__/jsfmt.spec.js.snap index 8c8760524..efb23b71d 100644 --- a/tests/jsx-split-attrs/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx-split-attrs/__snapshots__/jsfmt.spec.js.snap @@ -1,70 +1,72 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "long_closed = - + long_open = - + hello long_open_long_children = - - + + Hello world
hey hiya how are ya
-
+
-
+
- d - + d + short_closed = - + short_open = - + hello make_self_closing =
- + - +
leave_opening = - + long_string = -
hello world
+
hello world
long_string_with_extra_param = -
hello world
+
hello world
long_obj = -
hello world
+
hello world
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ long_closed = ( ); long_open = ( hello @@ -72,18 +74,18 @@ long_open = ( long_open_long_children = ( Hello world @@ -92,59 +94,59 @@ long_open_long_children = (
-
+
d ); -short_closed = ; +short_closed = ; short_open = ( - + hello ); @@ -152,44 +154,44 @@ short_open = ( make_self_closing = (
); leave_opening = ( - {\" \"} + {\\" \\"} ); long_string = ( -
+
hello world
); long_string_with_extra_param = (
hello world
@@ -198,10 +200,10 @@ long_string_with_extra_param = ( long_obj = (
diff --git a/tests/jsx-stateless-arrow-fn/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-stateless-arrow-fn/__snapshots__/jsfmt.spec.js.snap index e43d78705..33046e274 100644 --- a/tests/jsx-stateless-arrow-fn/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx-stateless-arrow-fn/__snapshots__/jsfmt.spec.js.snap @@ -1,26 +1,28 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "const render1 = ({ styles }) => ( -
+
Keep the wrapping parens. Put each key on its own line.
); -const render2 = ({ styles }) =>
+const render2 = ({ styles }) =>
Create wrapping parens.
; -const render3 = ({ styles }) =>
Bump to next line without parens
; +const render3 = ({ styles }) =>
Bump to next line without parens
; -const render4 = ({ styles }) =>
Create wrapping parens and indent all the things.
; +const render4 = ({ styles }) =>
Create wrapping parens and indent all the things.
; const render5 = ({ styles }) =>
Keep it on one line.
; const render6 = ({ styles }) => ( -
-
ddd d dd d d dddd dddd hello
-
ddd d dd d d dddd dddd hello
-
-
ddd d dd d d dddd dddd hello
hello
+
+
ddd d dd d d dddd dddd hello
+
ddd d dd d d dddd dddd hello
+
+
ddd d dd d d dddd dddd hello
hello
) @@ -51,46 +53,46 @@ const render10 = (props) =>
{props.even_loooooooooooooooooooooooooooooooooo const notJSX = (aaaaaaaaaaaaaaaaa, bbbbbbbbbbb) => this.someLongCallWithParams(aaaaaa, bbbbbbb).anotherLongCallWithParams(cccccccccccc, dddddddddddddddddddddd) React.render( - - , document.querySelector(\'#react-root\') + + , document.querySelector('#react-root') ) const renderTernary = (props) => - + {props.showTheThing ? - Hello world - : \"hello \" + \"howdy! \"} + Hello world + : \\"hello \\" + \\"howdy! \\"} {props.showTheThing ? - Hello world + Hello world : null } {props.showTheThing ? null : - Hello world + Hello world } - {props.showTheOtherThing ?
I am here
:
} + {props.showTheOtherThing ?
I am here
:
} {props.showTheOtherThing ?
I am here!!
: null} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const render1 = ({ styles }) => ( -
+
Keep the wrapping parens. Put each key on its own line.
); const render2 = ({ styles }) => ( -
+
Create wrapping parens.
); const render3 = ({ styles }) => ( -
Bump to next line without parens
+
Bump to next line without parens
); const render4 = ({ styles }) => ( -
+
Create wrapping parens and indent all the things.
); @@ -98,38 +100,38 @@ const render4 = ({ styles }) => ( const render5 = ({ styles }) =>
Keep it on one line.
; const render6 = ({ styles }) => ( -
+
ddd d dd d d dddd dddd hello
ddd d dd d d dddd dddd hello
ddd d dd d d dddd dddd hello
- {\" \"} + {\\" \\"} hello
@@ -173,41 +175,41 @@ const notJSX = (aaaaaaaaaaaaaaaaa, bbbbbbbbbbb) => React.render( , - document.querySelector(\"#react-root\") + document.querySelector(\\"#react-root\\") ); const renderTernary = props => ( {props.showTheThing ? Hello world - : \"hello \" + \"howdy! \"} + : \\"hello \\" + \\"howdy! \\"} {props.showTheThing ? Hello world @@ -215,15 +217,15 @@ const renderTernary = props => ( {props.showTheThing ? null : Hello world } - {props.showTheOtherThing ?
I am here
:
} + {props.showTheOtherThing ?
I am here
:
} {props.showTheOtherThing ?
I am here!!
: null} ); diff --git a/tests/jsx/__snapshots__/jsfmt.spec.js.snap b/tests/jsx/__snapshots__/jsfmt.spec.js.snap index 130a922b9..9854a71fb 100644 --- a/tests/jsx/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx/__snapshots__/jsfmt.spec.js.snap @@ -1,11 +1,13 @@ -exports[`test expression.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`expression.js 1`] = ` "; @@ -14,10 +16,10 @@ exports[`test expression.js 1`] = ` style={ [ { - someVeryLongStyle1: \"true\", - someVeryLongStyle2: \"true\", - someVeryLongStyle3: \"true\", - someVeryLongStyle4: \"true\" + someVeryLongStyle1: \\"true\\", + someVeryLongStyle2: \\"true\\", + someVeryLongStyle3: \\"true\\", + someVeryLongStyle4: \\"true\\" } ] } @@ -62,20 +64,20 @@ exports[`test expression.js 1`] = ` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; @@ -123,7 +125,7 @@ exports[`test expression.js 1`] = ` " `; -exports[`test hug.js 1`] = ` +exports[`hug.js 1`] = ` "
{__DEV__ ? this.renderDevApp() @@ -132,7 +134,7 @@ exports[`test hug.js 1`] = ` ))} @@ -145,7 +147,7 @@ exports[`test hug.js 1`] = ` ))} @@ -160,7 +162,7 @@ exports[`test hug.js 1`] = ` ))} @@ -174,7 +176,7 @@ exports[`test hug.js 1`] = ` ))} @@ -183,24 +185,13 @@ exports[`test hug.js 1`] = ` " `; -exports[`test quotes.js 1`] = ` -"
&quot;\" />; -
&quot;\' />; -
&quot;\'} />; -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
&quot;\" />; -
&quot;\" />; -
&quot;\"} />; -" -`; - -exports[`test object-property.js 1`] = ` +exports[`object-property.js 1`] = ` "const tabs = [ { - title: \"General Info\", + title: \\"General Info\\", content: ( &quot;\\" />; +
; +
&quot;'} />; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +
&quot;\\" />; +
&quot;\\" />; +
&quot;\\"} />; +" +`; diff --git a/tests/jsx_escape/__snapshots__/jsfmt.spec.js.snap b/tests/jsx_escape/__snapshots__/jsfmt.spec.js.snap index dc6d640f0..2f56656cb 100644 --- a/tests/jsx_escape/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx_escape/__snapshots__/jsfmt.spec.js.snap @@ -1,18 +1,20 @@ -exports[`test escape.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`escape.js 1`] = ` "
<
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<
; " `; -exports[`test escape.js 2`] = ` +exports[`escape.js 2`] = ` "
<
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<
; " `; -exports[`test nbsp.js 1`] = ` +exports[`nbsp.js 1`] = ` "many_nbsp =
   
single_nbsp =
 
many_raw_nbsp =
   
@@ -29,7 +31,7 @@ raw_amp = foo & bar; " `; -exports[`test nbsp.js 2`] = ` +exports[`nbsp.js 2`] = ` "many_nbsp =
   
single_nbsp =
 
many_raw_nbsp =
   
diff --git a/tests/jsx_last_line/__snapshots__/jsfmt.spec.js.snap b/tests/jsx_last_line/__snapshots__/jsfmt.spec.js.snap index 0d19c4878..706d39b71 100644 --- a/tests/jsx_last_line/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx_last_line/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test last_line.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`last_line.js 1`] = ` " action.payload.query) @@ -35,15 +37,15 @@ export default function searchUsers(action$) { " `; -exports[`test break-parent.js 1`] = ` +exports[`break-parent.js 1`] = ` "({ processors: [ - require(\"autoprefixer\", { - browsers: [\"> 1%\", \"last 2 versions\", \"ie >= 11\", \"Firefox ESR\"] + require(\\"autoprefixer\\", { + browsers: [\\"> 1%\\", \\"last 2 versions\\", \\"ie >= 11\\", \\"Firefox ESR\\"] }), - require(\"postcss-url\")({ + require(\\"postcss-url\\")({ url: url => - url.startsWith(\"/\") || /^[a-z]+:/.test(url) ? url : \`/static/\${url}\` + url.startsWith(\\"/\\") || /^[a-z]+:/.test(url) ? url : \`/static/\${url}\` }) ] }); @@ -64,12 +66,12 @@ true ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ({ processors: [ - require(\"autoprefixer\", { - browsers: [\"> 1%\", \"last 2 versions\", \"ie >= 11\", \"Firefox ESR\"] + require(\\"autoprefixer\\", { + browsers: [\\"> 1%\\", \\"last 2 versions\\", \\"ie >= 11\\", \\"Firefox ESR\\"] }), - require(\"postcss-url\")({ + require(\\"postcss-url\\")({ url: url => - url.startsWith(\"/\") || /^[a-z]+:/.test(url) ? url : \`/static/\${url}\` + url.startsWith(\\"/\\") || /^[a-z]+:/.test(url) ? url : \`/static/\${url}\` }) ] }); @@ -90,40 +92,40 @@ true " `; -exports[`test jsx.js 1`] = ` +exports[`jsx.js 1`] = ` "const els = items.map(item => ( -
+
{children}
)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const els = items.map(item => ( -
+
{children}
)); " `; -exports[`test object.js 1`] = ` +exports[`object.js 1`] = ` "const formatData = pipe( zip, map(([ ref, data ]) => ({ nodeId: ref.nodeId.toString(), ...attributeFromDataValue(ref.attributeId, data) })), - groupBy(prop(\'nodeId\')), + groupBy(prop('nodeId')), map(mergeAll), values ); export const setProp = y => ({ ...y, - a: \'very, very, very long very, very long text\' + a: 'very, very, very long very, very long text' }); export const log = y => { - console.log(\'very, very, very long very, very long text\') + console.log('very, very, very long very, very long text') }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const formatData = pipe( @@ -132,18 +134,18 @@ const formatData = pipe( nodeId: ref.nodeId.toString(), ...attributeFromDataValue(ref.attributeId, data) })), - groupBy(prop(\"nodeId\")), + groupBy(prop(\\"nodeId\\")), map(mergeAll), values ); export const setProp = y => ({ ...y, - a: \"very, very, very long very, very long text\" + a: \\"very, very, very long very, very long text\\" }); export const log = y => { - console.log(\"very, very, very long very, very long text\"); + console.log(\\"very, very, very long very, very long text\\"); }; " `; diff --git a/tests/line/__snapshots__/jsfmt.spec.js.snap b/tests/line/__snapshots__/jsfmt.spec.js.snap index b88e44e4c..2869d3af8 100644 --- a/tests/line/__snapshots__/jsfmt.spec.js.snap +++ b/tests/line/__snapshots__/jsfmt.spec.js.snap @@ -1,12 +1,14 @@ -exports[`test windows.js 1`] = ` -"const vscode = require(\"vscode\"); -const {getDir, getActiveFile, uint8arrayToString} = require(\"./utils\"); +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`windows.js 1`] = ` +"const vscode = require(\\"vscode\\"); +const {getDir, getActiveFile, uint8arrayToString} = require(\\"./utils\\"); let outChannel; let _commands; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -const vscode = require(\"vscode\"); -const { getDir, getActiveFile, uint8arrayToString } = require(\"./utils\"); +const vscode = require(\\"vscode\\"); +const { getDir, getActiveFile, uint8arrayToString } = require(\\"./utils\\"); let outChannel; let _commands; diff --git a/tests/literal/__snapshots__/jsfmt.spec.js.snap b/tests/literal/__snapshots__/jsfmt.spec.js.snap index 9e26c22ac..4a0a507a7 100644 --- a/tests/literal/__snapshots__/jsfmt.spec.js.snap +++ b/tests/literal/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test number.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`number.js 1`] = ` "// parentheses around numeric literal should be preserved function test5(): string { return (100).toString(); diff --git a/tests/member/__snapshots__/jsfmt.spec.js.snap b/tests/member/__snapshots__/jsfmt.spec.js.snap index c5533f8a0..bdf546b4c 100644 --- a/tests/member/__snapshots__/jsfmt.spec.js.snap +++ b/tests/member/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test expand.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`expand.js 1`] = ` "const veryVeryVeryVeryVeryVeryVeryLong = doc.expandedStates[doc.expandedStates.length - 1]; const small = doc.expandedStates[doc.expandedStates.length - 1];~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const veryVeryVeryVeryVeryVeryVeryLong = doc.expandedStates[ diff --git a/tests/method-chain/__snapshots__/jsfmt.spec.js.snap b/tests/method-chain/__snapshots__/jsfmt.spec.js.snap index 72838e2d1..7f9bb10c6 100644 --- a/tests/method-chain/__snapshots__/jsfmt.spec.js.snap +++ b/tests/method-chain/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test break-last-call.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`break-last-call.js 1`] = ` "export default store => { return callApi(endpoint, schema).then( response => next(actionWith({ @@ -7,30 +9,30 @@ exports[`test break-last-call.js 1`] = ` })), error => next(actionWith({ type: failureType, - error: error.message || \'Something bad happened\' + error: error.message || 'Something bad happened' })) ) } -it(\'should group messages with same created time\', () => { +it('should group messages with same created time', () => { expect( groupMessages(messages).toJS(), ).toEqual({ - \'11/01/2017 13:36\': [ - {message: \'test\', messageType: \'SMS\', status: \'Unknown\', created: \'11/01/2017 13:36\'}, - {message: \'test\', messageType: \'Email\', status: \'Unknown\', created: \'11/01/2017 13:36\'}, + '11/01/2017 13:36': [ + {message: 'test', messageType: 'SMS', status: 'Unknown', created: '11/01/2017 13:36'}, + {message: 'test', messageType: 'Email', status: 'Unknown', created: '11/01/2017 13:36'}, ], - \'09/01/2017 17:25\': [ - {message: \'te\', messageType: \'SMS\', status: \'Unknown\', created: \'09/01/2017 17:25\'}, - {message: \'te\', messageType: \'Email\', status: \'Unknown\', created: \'09/01/2017 17:25\'}, + '09/01/2017 17:25': [ + {message: 'te', messageType: 'SMS', status: 'Unknown', created: '09/01/2017 17:25'}, + {message: 'te', messageType: 'Email', status: 'Unknown', created: '09/01/2017 17:25'}, ], - \'11/01/2017 13:33\': [ - {message: \'test\', messageType: \'SMS\', status: \'Unknown\', created: \'11/01/2017 13:33\'}, - {message: \'test\', messageType: \'Email\', status: \'Unknown\', created: \'11/01/2017 13:33\'}, + '11/01/2017 13:33': [ + {message: 'test', messageType: 'SMS', status: 'Unknown', created: '11/01/2017 13:33'}, + {message: 'test', messageType: 'Email', status: 'Unknown', created: '11/01/2017 13:33'}, ], - \'11/01/2017 13:37\': [ - {message: \'test\', messageType: \'SMS\', status: \'Unknown\', created: \'11/01/2017 13:37\'}, - {message: \'test\', messageType: \'Email\', status: \'Unknown\', created: \'11/01/2017 13:37\'}, + '11/01/2017 13:37': [ + {message: 'test', messageType: 'SMS', status: 'Unknown', created: '11/01/2017 13:37'}, + {message: 'test', messageType: 'Email', status: 'Unknown', created: '11/01/2017 13:37'}, ], }); }); @@ -46,68 +48,68 @@ export default store => { error => next( actionWith({ type: failureType, - error: error.message || \"Something bad happened\" + error: error.message || \\"Something bad happened\\" }) ) ); }; -it(\"should group messages with same created time\", () => { +it(\\"should group messages with same created time\\", () => { expect(groupMessages(messages).toJS()).toEqual({ - \"11/01/2017 13:36\": [ + \\"11/01/2017 13:36\\": [ { - message: \"test\", - messageType: \"SMS\", - status: \"Unknown\", - created: \"11/01/2017 13:36\" + message: \\"test\\", + messageType: \\"SMS\\", + status: \\"Unknown\\", + created: \\"11/01/2017 13:36\\" }, { - message: \"test\", - messageType: \"Email\", - status: \"Unknown\", - created: \"11/01/2017 13:36\" + message: \\"test\\", + messageType: \\"Email\\", + status: \\"Unknown\\", + created: \\"11/01/2017 13:36\\" } ], - \"09/01/2017 17:25\": [ + \\"09/01/2017 17:25\\": [ { - message: \"te\", - messageType: \"SMS\", - status: \"Unknown\", - created: \"09/01/2017 17:25\" + message: \\"te\\", + messageType: \\"SMS\\", + status: \\"Unknown\\", + created: \\"09/01/2017 17:25\\" }, { - message: \"te\", - messageType: \"Email\", - status: \"Unknown\", - created: \"09/01/2017 17:25\" + message: \\"te\\", + messageType: \\"Email\\", + status: \\"Unknown\\", + created: \\"09/01/2017 17:25\\" } ], - \"11/01/2017 13:33\": [ + \\"11/01/2017 13:33\\": [ { - message: \"test\", - messageType: \"SMS\", - status: \"Unknown\", - created: \"11/01/2017 13:33\" + message: \\"test\\", + messageType: \\"SMS\\", + status: \\"Unknown\\", + created: \\"11/01/2017 13:33\\" }, { - message: \"test\", - messageType: \"Email\", - status: \"Unknown\", - created: \"11/01/2017 13:33\" + message: \\"test\\", + messageType: \\"Email\\", + status: \\"Unknown\\", + created: \\"11/01/2017 13:33\\" } ], - \"11/01/2017 13:37\": [ + \\"11/01/2017 13:37\\": [ { - message: \"test\", - messageType: \"SMS\", - status: \"Unknown\", - created: \"11/01/2017 13:37\" + message: \\"test\\", + messageType: \\"SMS\\", + status: \\"Unknown\\", + created: \\"11/01/2017 13:37\\" }, { - message: \"test\", - messageType: \"Email\", - status: \"Unknown\", - created: \"11/01/2017 13:37\" + message: \\"test\\", + messageType: \\"Email\\", + status: \\"Unknown\\", + created: \\"11/01/2017 13:37\\" } ] }); @@ -115,7 +117,7 @@ it(\"should group messages with same created time\", () => { " `; -exports[`test comment.js 1`] = ` +exports[`comment.js 1`] = ` "function f() { return observableFromSubscribeFunction() // Debounce manually rather than using editor.onDidStopChanging so that the debounce time is @@ -132,7 +134,7 @@ function f() { " `; -exports[`test first_long.js 1`] = ` +exports[`first_long.js 1`] = ` "export default function theFunction(action$, store) { return action$.ofType(THE_ACTION).switchMap(action => Observable .webSocket({ @@ -167,35 +169,35 @@ export default function theFunction(action$, store) { " `; -exports[`test multiple-members.js 1`] = ` -"if (testConfig.ENABLE_ONLINE_TESTS === \"true\") { - describe(\"POST /users/me/pet\", function() { - it(\"saves pet\", function() { +exports[`multiple-members.js 1`] = ` +"if (testConfig.ENABLE_ONLINE_TESTS === \\"true\\") { + describe(\\"POST /users/me/pet\\", function() { + it(\\"saves pet\\", function() { function assert(pet) { - expect(pet).to.have.property(\"OwnerAddress\").that.deep.equals({ - AddressLine1: \"Alexanderstrasse\", - AddressLine2: \"\", - PostalCode: \"10999\", - Region: \"Berlin\", - City: \"Berlin\", - Country: \"DE\" + expect(pet).to.have.property(\\"OwnerAddress\\").that.deep.equals({ + AddressLine1: \\"Alexanderstrasse\\", + AddressLine2: \\"\\", + PostalCode: \\"10999\\", + Region: \\"Berlin\\", + City: \\"Berlin\\", + Country: \\"DE\\" }); } }); }); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -if (testConfig.ENABLE_ONLINE_TESTS === \"true\") { - describe(\"POST /users/me/pet\", function() { - it(\"saves pet\", function() { +if (testConfig.ENABLE_ONLINE_TESTS === \\"true\\") { + describe(\\"POST /users/me/pet\\", function() { + it(\\"saves pet\\", function() { function assert(pet) { - expect(pet).to.have.property(\"OwnerAddress\").that.deep.equals({ - AddressLine1: \"Alexanderstrasse\", - AddressLine2: \"\", - PostalCode: \"10999\", - Region: \"Berlin\", - City: \"Berlin\", - Country: \"DE\" + expect(pet).to.have.property(\\"OwnerAddress\\").that.deep.equals({ + AddressLine1: \\"Alexanderstrasse\\", + AddressLine2: \\"\\", + PostalCode: \\"10999\\", + Region: \\"Berlin\\", + City: \\"Berlin\\", + Country: \\"DE\\" }); } }); @@ -204,22 +206,22 @@ if (testConfig.ENABLE_ONLINE_TESTS === \"true\") { " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "method().then(x => x) - [\"abc\"](x => x) + [\\"abc\\"](x => x) [abc](x => x); ({}.a().b()); ({}).a().b(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -method().then(x => x)[\"abc\"](x => x)[abc](x => x); +method().then(x => x)[\\"abc\\"](x => x)[abc](x => x); ({}).a().b(); ({}).a().b(); " `; -exports[`test this.js 1`] = ` +exports[`this.js 1`] = ` "const sel = this.connections .concat(this.activities.concat(this.operators)) .filter(x => x.selected); diff --git a/tests/new_expression/__snapshots__/jsfmt.spec.js.snap b/tests/new_expression/__snapshots__/jsfmt.spec.js.snap index b59887491..8d096e8b6 100644 --- a/tests/new_expression/__snapshots__/jsfmt.spec.js.snap +++ b/tests/new_expression/__snapshots__/jsfmt.spec.js.snap @@ -1,8 +1,10 @@ -exports[`test new_expression.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`new_expression.js 1`] = ` "new (memoize.Cache || MapCache) -new (typeof this == \"function\" ? this : Dict()) +new (typeof this == \\"function\\" ? this : Dict()) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ new (memoize.Cache || MapCache)(); -new (typeof this == \"function\" ? this : Dict())(); +new (typeof this == \\"function\\" ? this : Dict())(); " `; diff --git a/tests/object-prop-break-in/__snapshots__/jsfmt.spec.js.snap b/tests/object-prop-break-in/__snapshots__/jsfmt.spec.js.snap index 7bb3a515e..051df4d55 100644 --- a/tests/object-prop-break-in/__snapshots__/jsfmt.spec.js.snap +++ b/tests/object-prop-break-in/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test comment.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`comment.js 1`] = ` "function foo() { return { // this comment causes the problem @@ -15,62 +17,62 @@ function foo() { " `; -exports[`test test.js 1`] = ` +exports[`test.js 1`] = ` "const a = classnames({ - \"some-prop\": this.state.longLongLongLongLongLongLongLongLongTooLongProp + \\"some-prop\\": this.state.longLongLongLongLongLongLongLongLongTooLongProp }); const b = classnames({ - \"some-prop\": this.state.longLongLongLongLongLongLongLongLongTooLongProp === true + \\"some-prop\\": this.state.longLongLongLongLongLongLongLongLongTooLongProp === true }); const c = classnames({ - \"some-prop\": [ \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\" ] + \\"some-prop\\": [ \\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\" ] }); const d = classnames({ - \"some-prop\": () => {} + \\"some-prop\\": () => {} }); const e = classnames({ - \"some-prop\": function bar() {} + \\"some-prop\\": function bar() {} }); const f = classnames({ - \"some-prop\": { foo: \"bar\", bar: \"foo\", foo: \"bar\", bar: \"foo\", foo: \"bar\" } + \\"some-prop\\": { foo: \\"bar\\", bar: \\"foo\\", foo: \\"bar\\", bar: \\"foo\\", foo: \\"bar\\" } }); const g = classnames({ - \"some-prop\": longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar || 1337 + \\"some-prop\\": longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar || 1337 }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const a = classnames({ - \"some-prop\": this.state.longLongLongLongLongLongLongLongLongTooLongProp + \\"some-prop\\": this.state.longLongLongLongLongLongLongLongLongTooLongProp }); const b = classnames({ - \"some-prop\": this.state.longLongLongLongLongLongLongLongLongTooLongProp === + \\"some-prop\\": this.state.longLongLongLongLongLongLongLongLongTooLongProp === true }); const c = classnames({ - \"some-prop\": [\"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\"] + \\"some-prop\\": [\\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\", \\"bar\\", \\"foo\\"] }); const d = classnames({ - \"some-prop\": () => {} + \\"some-prop\\": () => {} }); const e = classnames({ - \"some-prop\": function bar() {} + \\"some-prop\\": function bar() {} }); const f = classnames({ - \"some-prop\": { foo: \"bar\", bar: \"foo\", foo: \"bar\", bar: \"foo\", foo: \"bar\" } + \\"some-prop\\": { foo: \\"bar\\", bar: \\"foo\\", foo: \\"bar\\", bar: \\"foo\\", foo: \\"bar\\" } }); const g = classnames({ - \"some-prop\": longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar || + \\"some-prop\\": longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar || 1337 }); " diff --git a/tests/object_colon_bug/__snapshots__/jsfmt.spec.js.snap b/tests/object_colon_bug/__snapshots__/jsfmt.spec.js.snap index 6e02fe691..aefdc358d 100644 --- a/tests/object_colon_bug/__snapshots__/jsfmt.spec.js.snap +++ b/tests/object_colon_bug/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test bug.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`bug.js 1`] = ` "const foo = { bar: props.bar ? props.bar : noop, baz: props.baz diff --git a/tests/objects/__snapshots__/jsfmt.spec.js.snap b/tests/objects/__snapshots__/jsfmt.spec.js.snap index 4e6e61258..5d0dc92a7 100644 --- a/tests/objects/__snapshots__/jsfmt.spec.js.snap +++ b/tests/objects/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test expression.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`expression.js 1`] = ` "() => ({}\`\`); ({})\`\`; a = () => ({}).x; @@ -9,38 +11,38 @@ a = () => ({}).x; " `; -exports[`test method.js 1`] = ` +exports[`method.js 1`] = ` "a = { f() {} } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a = { f() {} }; " `; -exports[`test range.js 1`] = ` +exports[`range.js 1`] = ` "group( concat([ - \"(\", + \\"(\\", indent( options.tabWidth, - concat([line, join(concat([\",\", line]), printed)]) + concat([line, join(concat([\\",\\", line]), printed)]) ), - options.trailingComma ? \",\" : \"\", + options.trailingComma ? \\",\\" : \\"\\", line, - \")\" + \\")\\" ]), {shouldBreak: true} ) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ group( concat([ - \"(\", + \\"(\\", indent( options.tabWidth, - concat([line, join(concat([\",\", line]), printed)]) + concat([line, join(concat([\\",\\", line]), printed)]) ), - options.trailingComma ? \",\" : \"\", + options.trailingComma ? \\",\\" : \\"\\", line, - \")\" + \\")\\" ]), { shouldBreak: true } ); diff --git a/tests/optional-type-name/__snapshots__/jsfmt.spec.js.snap b/tests/optional-type-name/__snapshots__/jsfmt.spec.js.snap index da002101d..fee18f34c 100644 --- a/tests/optional-type-name/__snapshots__/jsfmt.spec.js.snap +++ b/tests/optional-type-name/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "type Foo = (any) => string type Bar = { [string]: number } diff --git a/tests/preserve_line/__snapshots__/jsfmt.spec.js.snap b/tests/preserve_line/__snapshots__/jsfmt.spec.js.snap index b078f4f7c..acb62f28f 100644 --- a/tests/preserve_line/__snapshots__/jsfmt.spec.js.snap +++ b/tests/preserve_line/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test comments.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`comments.js 1`] = ` "function a() { const a = 5; // comment diff --git a/tests/quotes/__snapshots__/jsfmt.spec.js.snap b/tests/quotes/__snapshots__/jsfmt.spec.js.snap index 9a5d60230..e055dd5ee 100644 --- a/tests/quotes/__snapshots__/jsfmt.spec.js.snap +++ b/tests/quotes/__snapshots__/jsfmt.spec.js.snap @@ -1,36 +1,38 @@ -exports[`test functions.js 1`] = ` -"const a = () => \"Foo bar\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions.js 1`] = ` +"const a = () => \\"Foo bar\\"; function b(object, key) { - return object[\'key\']; + return object['key']; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -const a = () => \"Foo bar\"; +const a = () => \\"Foo bar\\"; function b(object, key) { - return object[\"key\"]; + return object[\\"key\\"]; } " `; -exports[`test functions.js 2`] = ` -"const a = () => \"Foo bar\"; +exports[`functions.js 2`] = ` +"const a = () => \\"Foo bar\\"; function b(object, key) { - return object[\'key\']; + return object['key']; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -const a = () => \'Foo bar\'; +const a = () => 'Foo bar'; function b(object, key) { - return object[\'key\']; + return object['key']; } " `; -exports[`test strings.js 1`] = ` +exports[`strings.js 1`] = ` "// Every string will be changed to double quotes, unless we end up with fewer -// escaped quotes by using single quotes. (Vice versa if the \"singleQuote\" +// escaped quotes by using single quotes. (Vice versa if the \\"singleQuote\\" // option is true). // // Note that even if a string already has the correct enclosing quotes, it is @@ -38,69 +40,69 @@ exports[`test strings.js 1`] = ` // for consistency. // Simple strings. -\"abc\" -\'abc\' +\\"abc\\" +'abc' // Escape. -\'\\0\' +'\\\\0' // Emoji. -\'🐶\' +'🐶' // Empty string. -\"\" -\'\' +\\"\\" +'' // Single double quote. -\"\\\"\" -\'\"\' +\\"\\\\\\"\\" +'\\"' // Single single quote. -\"\'\" -\'\\\'\' +\\"'\\" +'\\\\'' // Unnecessary escapes. -\"\\\'\" -\'\\\"\' +\\"\\\\'\\" +'\\\\\\"' // One of each. -\"\\\"\'\" -\'\"\\\'\' +\\"\\\\\\"'\\" +'\\"\\\\'' // One of each with unnecessary escapes. -\"\\\"\\\'\" -\'\\\"\\\'\' +\\"\\\\\\"\\\\'\\" +'\\\\\\"\\\\'' // More double quotes than single quotes. -\"\\\"\'\\\"\" -\'\"\\\'\"\' +\\"\\\\\\"'\\\\\\"\\" +'\\"\\\\'\\"' // More single quotes than double quotes. -\"\\\"\'\'\" -\'\"\\\'\\\'\' +\\"\\\\\\"''\\" +'\\"\\\\'\\\\'' // Two of each. -\"\\\"\\\"\'\'\" -\'\"\"\\\'\\\'\' +\\"\\\\\\"\\\\\\"''\\" +'\\"\\"\\\\'\\\\'' // Single backslash. -\'\\\\\' -\"\\\\\" +'\\\\\\\\' +\\"\\\\\\\\\\" // Backslases. -\"\\\"\\\\\\\"\\\\\\\\\\\" \'\\\'\\\\\'\\\\\\\'\\\\\\\\\'\" -\'\\\'\\\\\\\'\\\\\\\\\\\' \"\\\"\\\\\"\\\\\\\"\\\\\\\\\"\' +\\"\\\\\\"\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\" '\\\\'\\\\\\\\'\\\\\\\\\\\\'\\\\\\\\\\\\\\\\'\\" +'\\\\'\\\\\\\\\\\\'\\\\\\\\\\\\\\\\\\\\' \\"\\\\\\"\\\\\\\\\\"\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\"' // Somewhat more real-word example. -\"He\'s sayin\': \\\"How\'s it goin\'?\\\" Don\'t ask me why.\" -\'He\\\'s sayin\\\': \"How\\\'s it goin\\\'?\" Don\\\'t ask me why.\' +\\"He's sayin': \\\\\\"How's it goin'?\\\\\\" Don't ask me why.\\" +'He\\\\'s sayin\\\\': \\"How\\\\'s it goin\\\\'?\\" Don\\\\'t ask me why.' // Somewhat more real-word example 2. -\"var backslash = \\\"\\\\\\\", doubleQuote = \'\\\"\';\" -\'var backslash = \"\\\\\", doubleQuote = \\\'\"\\\';\' +\\"var backslash = \\\\\\"\\\\\\\\\\\\\\", doubleQuote = '\\\\\\"';\\" +'var backslash = \\"\\\\\\\\\\", doubleQuote = \\\\'\\"\\\\';' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Every string will be changed to double quotes, unless we end up with fewer -// escaped quotes by using single quotes. (Vice versa if the \"singleQuote\" +// escaped quotes by using single quotes. (Vice versa if the \\"singleQuote\\" // option is true). // // Note that even if a string already has the correct enclosing quotes, it is @@ -108,46 +110,46 @@ exports[`test strings.js 1`] = ` // for consistency. // Simple strings. -\"abc\"; -\"abc\"; +\\"abc\\"; +\\"abc\\"; // Escape. -\"\\0\"; +\\"\\\\0\\"; // Emoji. -\"🐶\"; // Empty string. -\"\"; -\"\"; // Single double quote. -\'\"\'; -\'\"\'; // Single single quote. -\"\'\"; -\"\'\"; // Unnecessary escapes. -\"\'\"; -\'\"\'; // One of each. -\"\\\"\'\"; -\"\\\"\'\"; // One of each with unnecessary escapes. -\"\\\"\'\"; -\"\\\"\'\"; // More double quotes than single quotes. -\'\"\\\'\"\'; -\'\"\\\'\"\'; // More single quotes than double quotes. -\"\\\"\'\'\"; -\"\\\"\'\'\"; // Two of each. -\"\\\"\\\"\'\'\"; -\"\\\"\\\"\'\'\"; // Single backslash. -\"\\\\\"; -\"\\\\\"; // Backslases. -\"\\\"\\\\\\\"\\\\\\\\\\\" \'\'\\\\\'\\\\\'\\\\\\\\\'\"; -\'\\\'\\\\\\\'\\\\\\\\\\\' \"\"\\\\\"\\\\\"\\\\\\\\\"\'; // Somewhat more real-word example. -\"He\'s sayin\': \\\"How\'s it goin\'?\\\" Don\'t ask me why.\"; -\"He\'s sayin\': \\\"How\'s it goin\'?\\\" Don\'t ask me why.\"; // Somewhat more real-word example 2. -\'var backslash = \"\\\\\", doubleQuote = \\\'\"\\\';\'; -\'var backslash = \"\\\\\", doubleQuote = \\\'\"\\\';\'; +\\"🐶\\"; // Empty string. +\\"\\"; +\\"\\"; // Single double quote. +'\\"'; +'\\"'; // Single single quote. +\\"'\\"; +\\"'\\"; // Unnecessary escapes. +\\"'\\"; +'\\"'; // One of each. +\\"\\\\\\"'\\"; +\\"\\\\\\"'\\"; // One of each with unnecessary escapes. +\\"\\\\\\"'\\"; +\\"\\\\\\"'\\"; // More double quotes than single quotes. +'\\"\\\\'\\"'; +'\\"\\\\'\\"'; // More single quotes than double quotes. +\\"\\\\\\"''\\"; +\\"\\\\\\"''\\"; // Two of each. +\\"\\\\\\"\\\\\\"''\\"; +\\"\\\\\\"\\\\\\"''\\"; // Single backslash. +\\"\\\\\\\\\\"; +\\"\\\\\\\\\\"; // Backslases. +\\"\\\\\\"\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\" ''\\\\\\\\'\\\\\\\\'\\\\\\\\\\\\\\\\'\\"; +'\\\\'\\\\\\\\\\\\'\\\\\\\\\\\\\\\\\\\\' \\"\\"\\\\\\\\\\"\\\\\\\\\\"\\\\\\\\\\\\\\\\\\"'; // Somewhat more real-word example. +\\"He's sayin': \\\\\\"How's it goin'?\\\\\\" Don't ask me why.\\"; +\\"He's sayin': \\\\\\"How's it goin'?\\\\\\" Don't ask me why.\\"; // Somewhat more real-word example 2. +'var backslash = \\"\\\\\\\\\\", doubleQuote = \\\\'\\"\\\\';'; +'var backslash = \\"\\\\\\\\\\", doubleQuote = \\\\'\\"\\\\';'; " `; -exports[`test strings.js 2`] = ` +exports[`strings.js 2`] = ` "// Every string will be changed to double quotes, unless we end up with fewer -// escaped quotes by using single quotes. (Vice versa if the \"singleQuote\" +// escaped quotes by using single quotes. (Vice versa if the \\"singleQuote\\" // option is true). // // Note that even if a string already has the correct enclosing quotes, it is @@ -155,69 +157,69 @@ exports[`test strings.js 2`] = ` // for consistency. // Simple strings. -\"abc\" -\'abc\' +\\"abc\\" +'abc' // Escape. -\'\\0\' +'\\\\0' // Emoji. -\'🐶\' +'🐶' // Empty string. -\"\" -\'\' +\\"\\" +'' // Single double quote. -\"\\\"\" -\'\"\' +\\"\\\\\\"\\" +'\\"' // Single single quote. -\"\'\" -\'\\\'\' +\\"'\\" +'\\\\'' // Unnecessary escapes. -\"\\\'\" -\'\\\"\' +\\"\\\\'\\" +'\\\\\\"' // One of each. -\"\\\"\'\" -\'\"\\\'\' +\\"\\\\\\"'\\" +'\\"\\\\'' // One of each with unnecessary escapes. -\"\\\"\\\'\" -\'\\\"\\\'\' +\\"\\\\\\"\\\\'\\" +'\\\\\\"\\\\'' // More double quotes than single quotes. -\"\\\"\'\\\"\" -\'\"\\\'\"\' +\\"\\\\\\"'\\\\\\"\\" +'\\"\\\\'\\"' // More single quotes than double quotes. -\"\\\"\'\'\" -\'\"\\\'\\\'\' +\\"\\\\\\"''\\" +'\\"\\\\'\\\\'' // Two of each. -\"\\\"\\\"\'\'\" -\'\"\"\\\'\\\'\' +\\"\\\\\\"\\\\\\"''\\" +'\\"\\"\\\\'\\\\'' // Single backslash. -\'\\\\\' -\"\\\\\" +'\\\\\\\\' +\\"\\\\\\\\\\" // Backslases. -\"\\\"\\\\\\\"\\\\\\\\\\\" \'\\\'\\\\\'\\\\\\\'\\\\\\\\\'\" -\'\\\'\\\\\\\'\\\\\\\\\\\' \"\\\"\\\\\"\\\\\\\"\\\\\\\\\"\' +\\"\\\\\\"\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\" '\\\\'\\\\\\\\'\\\\\\\\\\\\'\\\\\\\\\\\\\\\\'\\" +'\\\\'\\\\\\\\\\\\'\\\\\\\\\\\\\\\\\\\\' \\"\\\\\\"\\\\\\\\\\"\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\"' // Somewhat more real-word example. -\"He\'s sayin\': \\\"How\'s it goin\'?\\\" Don\'t ask me why.\" -\'He\\\'s sayin\\\': \"How\\\'s it goin\\\'?\" Don\\\'t ask me why.\' +\\"He's sayin': \\\\\\"How's it goin'?\\\\\\" Don't ask me why.\\" +'He\\\\'s sayin\\\\': \\"How\\\\'s it goin\\\\'?\\" Don\\\\'t ask me why.' // Somewhat more real-word example 2. -\"var backslash = \\\"\\\\\\\", doubleQuote = \'\\\"\';\" -\'var backslash = \"\\\\\", doubleQuote = \\\'\"\\\';\' +\\"var backslash = \\\\\\"\\\\\\\\\\\\\\", doubleQuote = '\\\\\\"';\\" +'var backslash = \\"\\\\\\\\\\", doubleQuote = \\\\'\\"\\\\';' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Every string will be changed to double quotes, unless we end up with fewer -// escaped quotes by using single quotes. (Vice versa if the \"singleQuote\" +// escaped quotes by using single quotes. (Vice versa if the \\"singleQuote\\" // option is true). // // Note that even if a string already has the correct enclosing quotes, it is @@ -225,39 +227,39 @@ exports[`test strings.js 2`] = ` // for consistency. // Simple strings. -\'abc\'; -\'abc\'; +'abc'; +'abc'; // Escape. -\'\\0\'; +'\\\\0'; // Emoji. -\'🐶\'; // Empty string. -\'\'; -\'\'; // Single double quote. -\'\"\'; -\'\"\'; // Single single quote. -\"\'\"; -\"\'\"; // Unnecessary escapes. -\"\'\"; -\'\"\'; // One of each. -\'\"\\\'\'; -\'\"\\\'\'; // One of each with unnecessary escapes. -\'\"\\\'\'; -\'\"\\\'\'; // More double quotes than single quotes. -\'\"\\\'\"\'; -\'\"\\\'\"\'; // More single quotes than double quotes. -\"\\\"\'\'\"; -\"\\\"\'\'\"; // Two of each. -\'\"\"\\\'\\\'\'; -\'\"\"\\\'\\\'\'; // Single backslash. -\'\\\\\'; -\'\\\\\'; // Backslases. -\"\\\"\\\\\\\"\\\\\\\\\\\" \'\'\\\\\'\\\\\'\\\\\\\\\'\"; -\'\\\'\\\\\\\'\\\\\\\\\\\' \"\"\\\\\"\\\\\"\\\\\\\\\"\'; // Somewhat more real-word example. -\"He\'s sayin\': \\\"How\'s it goin\'?\\\" Don\'t ask me why.\"; -\"He\'s sayin\': \\\"How\'s it goin\'?\\\" Don\'t ask me why.\"; // Somewhat more real-word example 2. -\'var backslash = \"\\\\\", doubleQuote = \\\'\"\\\';\'; -\'var backslash = \"\\\\\", doubleQuote = \\\'\"\\\';\'; +'🐶'; // Empty string. +''; +''; // Single double quote. +'\\"'; +'\\"'; // Single single quote. +\\"'\\"; +\\"'\\"; // Unnecessary escapes. +\\"'\\"; +'\\"'; // One of each. +'\\"\\\\''; +'\\"\\\\''; // One of each with unnecessary escapes. +'\\"\\\\''; +'\\"\\\\''; // More double quotes than single quotes. +'\\"\\\\'\\"'; +'\\"\\\\'\\"'; // More single quotes than double quotes. +\\"\\\\\\"''\\"; +\\"\\\\\\"''\\"; // Two of each. +'\\"\\"\\\\'\\\\''; +'\\"\\"\\\\'\\\\''; // Single backslash. +'\\\\\\\\'; +'\\\\\\\\'; // Backslases. +\\"\\\\\\"\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\" ''\\\\\\\\'\\\\\\\\'\\\\\\\\\\\\\\\\'\\"; +'\\\\'\\\\\\\\\\\\'\\\\\\\\\\\\\\\\\\\\' \\"\\"\\\\\\\\\\"\\\\\\\\\\"\\\\\\\\\\\\\\\\\\"'; // Somewhat more real-word example. +\\"He's sayin': \\\\\\"How's it goin'?\\\\\\" Don't ask me why.\\"; +\\"He's sayin': \\\\\\"How's it goin'?\\\\\\" Don't ask me why.\\"; // Somewhat more real-word example 2. +'var backslash = \\"\\\\\\\\\\", doubleQuote = \\\\'\\"\\\\';'; +'var backslash = \\"\\\\\\\\\\", doubleQuote = \\\\'\\"\\\\';'; " `; diff --git a/tests/rest/__snapshots__/jsfmt.spec.js.snap b/tests/rest/__snapshots__/jsfmt.spec.js.snap index a5785548f..d723daef3 100644 --- a/tests/rest/__snapshots__/jsfmt.spec.js.snap +++ b/tests/rest/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test trailing-commas.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`trailing-commas.js 1`] = ` "declare class C { f( superSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperLong, diff --git a/tests/shebang/__snapshots__/jsfmt.spec.js.snap b/tests/shebang/__snapshots__/jsfmt.spec.js.snap index 3d70d8699..e6c317e7f 100644 --- a/tests/shebang/__snapshots__/jsfmt.spec.js.snap +++ b/tests/shebang/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test shebang.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`shebang.js 1`] = ` "#!/usr/bin/env node function a() {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -7,7 +9,7 @@ function a() {} " `; -exports[`test shebang-newline.js 1`] = ` +exports[`shebang-newline.js 1`] = ` "#!/usr/bin/env node function a() {} diff --git a/tests/strings/__snapshots__/jsfmt.spec.js.snap b/tests/strings/__snapshots__/jsfmt.spec.js.snap index 838149c9e..f6743984c 100644 --- a/tests/strings/__snapshots__/jsfmt.spec.js.snap +++ b/tests/strings/__snapshots__/jsfmt.spec.js.snap @@ -1,53 +1,55 @@ -exports[`test strings.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`strings.js 1`] = ` "[ - \"abc\", - \'abc\', + \\"abc\\", + 'abc', - \'\\\'\', + '\\\\'', - \'\"\', - \'\\\"\', - \'\\\\\"\', + '\\"', + '\\\\\\"', + '\\\\\\\\\\"', - \"\'\", - \"\\\'\", - \"\\\\\'\", + \\"'\\", + \\"\\\\'\\", + \\"\\\\\\\\'\\", - \"\'\\\"\", - \'\\\'\"\', + \\"'\\\\\\"\\", + '\\\\'\\"', - \'\\\\\', - \"\\\\\", + '\\\\\\\\', + \\"\\\\\\\\\\", - \'\\0\', - \'🐶\', + '\\\\0', + '🐶', - \'\\uD801\\uDC28\', + '\\\\uD801\\\\uDC28', ]; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [ - \"abc\", - \"abc\", + \\"abc\\", + \\"abc\\", - \"\'\", + \\"'\\", - \'\"\', - \'\"\', - \'\\\\\"\', + '\\"', + '\\"', + '\\\\\\\\\\"', - \"\'\", - \"\'\", - \"\\\\\'\", + \\"'\\", + \\"'\\", + \\"\\\\\\\\'\\", - \"\'\\\"\", - \"\'\\\"\", + \\"'\\\\\\"\\", + \\"'\\\\\\"\\", - \"\\\\\", - \"\\\\\", + \\"\\\\\\\\\\", + \\"\\\\\\\\\\", - \"\\0\", - \"🐶\", - \'\\uD801\\uDC28\' + \\"\\\\0\\", + \\"🐶\\", + '\\\\uD801\\\\uDC28' ]; " `; diff --git a/tests/switch/__snapshots__/jsfmt.spec.js.snap b/tests/switch/__snapshots__/jsfmt.spec.js.snap index 9f7dc2a4e..9768792e8 100644 --- a/tests/switch/__snapshots__/jsfmt.spec.js.snap +++ b/tests/switch/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test empty_switch.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`empty_switch.js 1`] = ` "switch (1) { default:; } switch (1) {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/tabWith/__snapshots__/jsfmt.spec.js.snap b/tests/tabWith/__snapshots__/jsfmt.spec.js.snap index 03113ea47..2270b72f2 100644 --- a/tests/tabWith/__snapshots__/jsfmt.spec.js.snap +++ b/tests/tabWith/__snapshots__/jsfmt.spec.js.snap @@ -1,10 +1,12 @@ -exports[`test class.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class.js 1`] = ` "class A { method() { var x = 1; - while(typeof x == \"number\" || typeof x == \"string\") { + while(typeof x == \\"number\\" || typeof x == \\"string\\") { x = x + 1; - if (true) x = \"\"; + if (true) x = \\"\\"; } var z:number = x; } @@ -13,9 +15,9 @@ exports[`test class.js 1`] = ` class A { method() { var x = 1; - while (typeof x == \"number\" || typeof x == \"string\") { + while (typeof x == \\"number\\" || typeof x == \\"string\\") { x = x + 1; - if (true) x = \"\"; + if (true) x = \\"\\"; } var z: number = x; } @@ -23,13 +25,13 @@ class A { " `; -exports[`test class.js 2`] = ` +exports[`class.js 2`] = ` "class A { method() { var x = 1; - while(typeof x == \"number\" || typeof x == \"string\") { + while(typeof x == \\"number\\" || typeof x == \\"string\\") { x = x + 1; - if (true) x = \"\"; + if (true) x = \\"\\"; } var z:number = x; } @@ -38,9 +40,9 @@ exports[`test class.js 2`] = ` class A { method() { var x = 1; - while (typeof x == \"number\" || typeof x == \"string\") { + while (typeof x == \\"number\\" || typeof x == \\"string\\") { x = x + 1; - if (true) x = \"\"; + if (true) x = \\"\\"; } var z: number = x; } @@ -48,7 +50,7 @@ class A { " `; -exports[`test nested-functions.spec.js 1`] = ` +exports[`nested-functions.spec.js 1`] = ` "const c = () => {}; function a() { @@ -75,7 +77,7 @@ function a() { " `; -exports[`test nested-functions.spec.js 2`] = ` +exports[`nested-functions.spec.js 2`] = ` "const c = () => {}; function a() { diff --git a/tests/template/__snapshots__/jsfmt.spec.js.snap b/tests/template/__snapshots__/jsfmt.spec.js.snap index 21a51c195..af996d488 100644 --- a/tests/template/__snapshots__/jsfmt.spec.js.snap +++ b/tests/template/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test faulty-locations.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`faulty-locations.js 1`] = ` "var o = { [\`key\`]: () => { // Comment @@ -31,113 +33,113 @@ var x = { " `; -exports[`test parenthesis.js 1`] = ` -"// \"ArrowFunctionExpression\" +exports[`parenthesis.js 1`] = ` +"// \\"ArrowFunctionExpression\\" (() => {})\`\`; -// \"AssignmentExpression\" +// \\"AssignmentExpression\\" (b = c)\`\`; -// \"AwaitExpression\" +// \\"AwaitExpression\\" async function f() { (await b)\`\`; } -// \"BinaryExpression\" +// \\"BinaryExpression\\" (b + c)\`\`; -// \"CallExpression\" +// \\"CallExpression\\" b()\`\`; -// \"ClassExpression\" +// \\"ClassExpression\\" (class {})\`\`; -// \"ConditionalExpression\" +// \\"ConditionalExpression\\" (b ? c : d)\`\`; -// \"FunctionExpression\" +// \\"FunctionExpression\\" (function() {})\`\`; -// \"LogicalExpression\" +// \\"LogicalExpression\\" (b || c)\`\`; -// \"MemberExpression\" +// \\"MemberExpression\\" b.c\`\`; -// \"NewExpression\" +// \\"NewExpression\\" (new B())\`\`; -// \"ObjectExpression\" +// \\"ObjectExpression\\" ({})\`\`; -// \"SequenceExpression\" +// \\"SequenceExpression\\" (b, c)\`\`; -// \"TaggedTemplateExpression\" +// \\"TaggedTemplateExpression\\" (\`\`)\`\`; -// \"UnaryExpression\" +// \\"UnaryExpression\\" (void b)\`\`; -// \"UpdateExpression\" +// \\"UpdateExpression\\" (++b)\`\`; -// \"YieldExpression\" +// \\"YieldExpression\\" function* f() { (yield 1)\`\`; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// \"ArrowFunctionExpression\" +// \\"ArrowFunctionExpression\\" (() => {})\`\`; -// \"AssignmentExpression\" +// \\"AssignmentExpression\\" (b = c)\`\`; -// \"AwaitExpression\" +// \\"AwaitExpression\\" async function f() { (await b)\`\`; } -// \"BinaryExpression\" +// \\"BinaryExpression\\" (b + c)\`\`; -// \"CallExpression\" +// \\"CallExpression\\" b()\`\`; -// \"ClassExpression\" +// \\"ClassExpression\\" (class {})\`\`; -// \"ConditionalExpression\" +// \\"ConditionalExpression\\" (b ? c : d)\`\`; -// \"FunctionExpression\" +// \\"FunctionExpression\\" (function() {})\`\`; -// \"LogicalExpression\" +// \\"LogicalExpression\\" (b || c)\`\`; -// \"MemberExpression\" +// \\"MemberExpression\\" b.c\`\`; -// \"NewExpression\" +// \\"NewExpression\\" new B()\`\`; -// \"ObjectExpression\" +// \\"ObjectExpression\\" ({})\`\`; -// \"SequenceExpression\" +// \\"SequenceExpression\\" (b, c)\`\`; -// \"TaggedTemplateExpression\" +// \\"TaggedTemplateExpression\\" \`\`\`\`; -// \"UnaryExpression\" +// \\"UnaryExpression\\" (void b)\`\`; -// \"UpdateExpression\" +// \\"UpdateExpression\\" (++b)\`\`; -// \"YieldExpression\" +// \\"YieldExpression\\" function* f() { (yield 1)\`\`; } diff --git a/tests/ternaries/__snapshots__/jsfmt.spec.js.snap b/tests/ternaries/__snapshots__/jsfmt.spec.js.snap index b78a8903c..2f2e57dde 100644 --- a/tests/ternaries/__snapshots__/jsfmt.spec.js.snap +++ b/tests/ternaries/__snapshots__/jsfmt.spec.js.snap @@ -1,31 +1,33 @@ -exports[`test test.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test.js 1`] = ` "const obj0 = conditionIsTruthy ? shortThing : otherShortThing -const obj1 = conditionIsTruthy ? { some: \'long\', object: \'with\', lots: \'of\', stuff } : shortThing +const obj1 = conditionIsTruthy ? { some: 'long', object: 'with', lots: 'of', stuff } : shortThing -const obj2 = conditionIsTruthy ? shortThing : { some: \'long\', object: \'with\', lots: \'of\', stuff } +const obj2 = conditionIsTruthy ? shortThing : { some: 'long', object: 'with', lots: 'of', stuff } -const obj3 = conditionIsTruthy ? { some: \'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\', object: \'with\', lots: \'of\', stuff } : shortThing +const obj3 = conditionIsTruthy ? { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff } : shortThing -const obj4 = conditionIsTruthy ? shortThing : { some: \'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\', object: \'with\', lots: \'of\', stuff } +const obj4 = conditionIsTruthy ? shortThing : { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff } -const obj5 = conditionIsTruthy ? { some: \'long\', object: \'with\', lots: \'of\', stuff } : { some: \'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\', object: \'with\', lots: \'of\', stuff } +const obj5 = conditionIsTruthy ? { some: 'long', object: 'with', lots: 'of', stuff } : { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const obj0 = conditionIsTruthy ? shortThing : otherShortThing; const obj1 = conditionIsTruthy - ? { some: \"long\", object: \"with\", lots: \"of\", stuff } + ? { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff } : shortThing; const obj2 = conditionIsTruthy ? shortThing - : { some: \"long\", object: \"with\", lots: \"of\", stuff }; + : { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff }; const obj3 = conditionIsTruthy ? { - some: \"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\", - object: \"with\", - lots: \"of\", + some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\", + object: \\"with\\", + lots: \\"of\\", stuff } : shortThing; @@ -33,51 +35,51 @@ const obj3 = conditionIsTruthy const obj4 = conditionIsTruthy ? shortThing : { - some: \"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\", - object: \"with\", - lots: \"of\", + some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\", + object: \\"with\\", + lots: \\"of\\", stuff }; const obj5 = conditionIsTruthy - ? { some: \"long\", object: \"with\", lots: \"of\", stuff } + ? { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff } : { - some: \"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\", - object: \"with\", - lots: \"of\", + some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\", + object: \\"with\\", + lots: \\"of\\", stuff }; " `; -exports[`test test.js 2`] = ` +exports[`test.js 2`] = ` "const obj0 = conditionIsTruthy ? shortThing : otherShortThing -const obj1 = conditionIsTruthy ? { some: \'long\', object: \'with\', lots: \'of\', stuff } : shortThing +const obj1 = conditionIsTruthy ? { some: 'long', object: 'with', lots: 'of', stuff } : shortThing -const obj2 = conditionIsTruthy ? shortThing : { some: \'long\', object: \'with\', lots: \'of\', stuff } +const obj2 = conditionIsTruthy ? shortThing : { some: 'long', object: 'with', lots: 'of', stuff } -const obj3 = conditionIsTruthy ? { some: \'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\', object: \'with\', lots: \'of\', stuff } : shortThing +const obj3 = conditionIsTruthy ? { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff } : shortThing -const obj4 = conditionIsTruthy ? shortThing : { some: \'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\', object: \'with\', lots: \'of\', stuff } +const obj4 = conditionIsTruthy ? shortThing : { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff } -const obj5 = conditionIsTruthy ? { some: \'long\', object: \'with\', lots: \'of\', stuff } : { some: \'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\', object: \'with\', lots: \'of\', stuff } +const obj5 = conditionIsTruthy ? { some: 'long', object: 'with', lots: 'of', stuff } : { some: 'eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger', object: 'with', lots: 'of', stuff } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const obj0 = conditionIsTruthy ? shortThing : otherShortThing; const obj1 = conditionIsTruthy - ? { some: \"long\", object: \"with\", lots: \"of\", stuff } + ? { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff } : shortThing; const obj2 = conditionIsTruthy ? shortThing - : { some: \"long\", object: \"with\", lots: \"of\", stuff }; + : { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff }; const obj3 = conditionIsTruthy ? { - some: \"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\", - object: \"with\", - lots: \"of\", + some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\", + object: \\"with\\", + lots: \\"of\\", stuff } : shortThing; @@ -85,18 +87,18 @@ const obj3 = conditionIsTruthy const obj4 = conditionIsTruthy ? shortThing : { - some: \"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\", - object: \"with\", - lots: \"of\", + some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\", + object: \\"with\\", + lots: \\"of\\", stuff }; const obj5 = conditionIsTruthy - ? { some: \"long\", object: \"with\", lots: \"of\", stuff } + ? { some: \\"long\\", object: \\"with\\", lots: \\"of\\", stuff } : { - some: \"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\", - object: \"with\", - lots: \"of\", + some: \\"eeeeeeeeeeeeven looooooooooooooooooooooooooooooonger\\", + object: \\"with\\", + lots: \\"of\\", stuff }; " diff --git a/tests/trailing_comma/__snapshots__/jsfmt.spec.js.snap b/tests/trailing_comma/__snapshots__/jsfmt.spec.js.snap index 3a93f5dbc..43734ed18 100644 --- a/tests/trailing_comma/__snapshots__/jsfmt.spec.js.snap +++ b/tests/trailing_comma/__snapshots__/jsfmt.spec.js.snap @@ -1,241 +1,243 @@ -exports[`test function-calls.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`function-calls.js 1`] = ` "const a = (param1, param2, param3) => {} -a(\'value\', \'value2\', \'value3\'); +a('value', 'value2', 'value3'); a( - \'a-long-value\', - \'a-really-really-long-value\', - \'a-really-really-really-long-value\', + 'a-long-value', + 'a-really-really-long-value', + 'a-really-really-really-long-value', ); -a(\'value\', \'value2\', a(\'long-nested-value\', \'long-nested-value2\', \'long-nested-value3\')); +a('value', 'value2', a('long-nested-value', 'long-nested-value2', 'long-nested-value3')); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const a = (param1, param2, param3) => {}; -a(\"value\", \"value2\", \"value3\"); +a(\\"value\\", \\"value2\\", \\"value3\\"); a( - \"a-long-value\", - \"a-really-really-long-value\", - \"a-really-really-really-long-value\" + \\"a-long-value\\", + \\"a-really-really-long-value\\", + \\"a-really-really-really-long-value\\" ); a( - \"value\", - \"value2\", - a(\"long-nested-value\", \"long-nested-value2\", \"long-nested-value3\") + \\"value\\", + \\"value2\\", + a(\\"long-nested-value\\", \\"long-nested-value2\\", \\"long-nested-value3\\") ); " `; -exports[`test function-calls.js 2`] = ` +exports[`function-calls.js 2`] = ` "const a = (param1, param2, param3) => {} -a(\'value\', \'value2\', \'value3\'); +a('value', 'value2', 'value3'); a( - \'a-long-value\', - \'a-really-really-long-value\', - \'a-really-really-really-long-value\', + 'a-long-value', + 'a-really-really-long-value', + 'a-really-really-really-long-value', ); -a(\'value\', \'value2\', a(\'long-nested-value\', \'long-nested-value2\', \'long-nested-value3\')); +a('value', 'value2', a('long-nested-value', 'long-nested-value2', 'long-nested-value3')); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const a = (param1, param2, param3) => {}; -a(\"value\", \"value2\", \"value3\"); +a(\\"value\\", \\"value2\\", \\"value3\\"); a( - \"a-long-value\", - \"a-really-really-long-value\", - \"a-really-really-really-long-value\", + \\"a-long-value\\", + \\"a-really-really-long-value\\", + \\"a-really-really-really-long-value\\", ); a( - \"value\", - \"value2\", - a(\"long-nested-value\", \"long-nested-value2\", \"long-nested-value3\"), + \\"value\\", + \\"value2\\", + a(\\"long-nested-value\\", \\"long-nested-value2\\", \\"long-nested-value3\\"), ); " `; -exports[`test function-calls.js 3`] = ` +exports[`function-calls.js 3`] = ` "const a = (param1, param2, param3) => {} -a(\'value\', \'value2\', \'value3\'); +a('value', 'value2', 'value3'); a( - \'a-long-value\', - \'a-really-really-long-value\', - \'a-really-really-really-long-value\', + 'a-long-value', + 'a-really-really-long-value', + 'a-really-really-really-long-value', ); -a(\'value\', \'value2\', a(\'long-nested-value\', \'long-nested-value2\', \'long-nested-value3\')); +a('value', 'value2', a('long-nested-value', 'long-nested-value2', 'long-nested-value3')); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const a = (param1, param2, param3) => {}; -a(\"value\", \"value2\", \"value3\"); +a(\\"value\\", \\"value2\\", \\"value3\\"); a( - \"a-long-value\", - \"a-really-really-long-value\", - \"a-really-really-really-long-value\" + \\"a-long-value\\", + \\"a-really-really-long-value\\", + \\"a-really-really-really-long-value\\" ); a( - \"value\", - \"value2\", - a(\"long-nested-value\", \"long-nested-value2\", \"long-nested-value3\") + \\"value\\", + \\"value2\\", + a(\\"long-nested-value\\", \\"long-nested-value2\\", \\"long-nested-value3\\") ); " `; -exports[`test object.js 1`] = ` +exports[`object.js 1`] = ` "const a = { b: true, c: { - c1: \'hello\' + c1: 'hello' }, d: false }; const aLong = { - bHasALongName: \'a-long-value\', + bHasALongName: 'a-long-value', cHasALongName: { - c1: \'a-really-long-value\', - c2: \'a-really-really-long-value\', + c1: 'a-really-long-value', + c2: 'a-really-really-long-value', }, - dHasALongName: \'a-long-value-too\' + dHasALongName: 'a-long-value-too' }; const aLong = { - dHasALongName: \'a-long-value-too\', + dHasALongName: 'a-long-value-too', eHasABooleanExpression: a === a, }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const a = { b: true, c: { - c1: \"hello\" + c1: \\"hello\\" }, d: false }; const aLong = { - bHasALongName: \"a-long-value\", + bHasALongName: \\"a-long-value\\", cHasALongName: { - c1: \"a-really-long-value\", - c2: \"a-really-really-long-value\" + c1: \\"a-really-long-value\\", + c2: \\"a-really-really-long-value\\" }, - dHasALongName: \"a-long-value-too\" + dHasALongName: \\"a-long-value-too\\" }; const aLong = { - dHasALongName: \"a-long-value-too\", + dHasALongName: \\"a-long-value-too\\", eHasABooleanExpression: a === a }; " `; -exports[`test object.js 2`] = ` +exports[`object.js 2`] = ` "const a = { b: true, c: { - c1: \'hello\' + c1: 'hello' }, d: false }; const aLong = { - bHasALongName: \'a-long-value\', + bHasALongName: 'a-long-value', cHasALongName: { - c1: \'a-really-long-value\', - c2: \'a-really-really-long-value\', + c1: 'a-really-long-value', + c2: 'a-really-really-long-value', }, - dHasALongName: \'a-long-value-too\' + dHasALongName: 'a-long-value-too' }; const aLong = { - dHasALongName: \'a-long-value-too\', + dHasALongName: 'a-long-value-too', eHasABooleanExpression: a === a, }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const a = { b: true, c: { - c1: \"hello\", + c1: \\"hello\\", }, d: false, }; const aLong = { - bHasALongName: \"a-long-value\", + bHasALongName: \\"a-long-value\\", cHasALongName: { - c1: \"a-really-long-value\", - c2: \"a-really-really-long-value\", + c1: \\"a-really-long-value\\", + c2: \\"a-really-really-long-value\\", }, - dHasALongName: \"a-long-value-too\", + dHasALongName: \\"a-long-value-too\\", }; const aLong = { - dHasALongName: \"a-long-value-too\", + dHasALongName: \\"a-long-value-too\\", eHasABooleanExpression: a === a, }; " `; -exports[`test object.js 3`] = ` +exports[`object.js 3`] = ` "const a = { b: true, c: { - c1: \'hello\' + c1: 'hello' }, d: false }; const aLong = { - bHasALongName: \'a-long-value\', + bHasALongName: 'a-long-value', cHasALongName: { - c1: \'a-really-long-value\', - c2: \'a-really-really-long-value\', + c1: 'a-really-long-value', + c2: 'a-really-really-long-value', }, - dHasALongName: \'a-long-value-too\' + dHasALongName: 'a-long-value-too' }; const aLong = { - dHasALongName: \'a-long-value-too\', + dHasALongName: 'a-long-value-too', eHasABooleanExpression: a === a, }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ const a = { b: true, c: { - c1: \"hello\", + c1: \\"hello\\", }, d: false, }; const aLong = { - bHasALongName: \"a-long-value\", + bHasALongName: \\"a-long-value\\", cHasALongName: { - c1: \"a-really-long-value\", - c2: \"a-really-really-long-value\", + c1: \\"a-really-long-value\\", + c2: \\"a-really-really-long-value\\", }, - dHasALongName: \"a-long-value-too\", + dHasALongName: \\"a-long-value-too\\", }; const aLong = { - dHasALongName: \"a-long-value-too\", + dHasALongName: \\"a-long-value-too\\", eHasABooleanExpression: a === a, }; " `; -exports[`test trailing_whitespace.js 1`] = ` +exports[`trailing_whitespace.js 1`] = ` "let example = [ - \'FOO\', - \'BAR\', + 'FOO', + 'BAR', // Comment ]; @@ -270,8 +272,8 @@ function supersupersupersuperLongF( } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ let example = [ - \"FOO\", - \"BAR\" + \\"FOO\\", + \\"BAR\\" // Comment ]; @@ -308,10 +310,10 @@ function supersupersupersuperLongF( " `; -exports[`test trailing_whitespace.js 2`] = ` +exports[`trailing_whitespace.js 2`] = ` "let example = [ - \'FOO\', - \'BAR\', + 'FOO', + 'BAR', // Comment ]; @@ -346,8 +348,8 @@ function supersupersupersuperLongF( } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ let example = [ - \"FOO\", - \"BAR\", + \\"FOO\\", + \\"BAR\\", // Comment ]; @@ -384,10 +386,10 @@ function supersupersupersuperLongF( " `; -exports[`test trailing_whitespace.js 3`] = ` +exports[`trailing_whitespace.js 3`] = ` "let example = [ - \'FOO\', - \'BAR\', + 'FOO', + 'BAR', // Comment ]; @@ -422,8 +424,8 @@ function supersupersupersuperLongF( } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ let example = [ - \"FOO\", - \"BAR\", + \\"FOO\\", + \\"BAR\\", // Comment ]; diff --git a/tests/trailing_whitespace/__snapshots__/jsfmt.spec.js.snap b/tests/trailing_whitespace/__snapshots__/jsfmt.spec.js.snap index f2c9a816f..fdbdef959 100644 --- a/tests/trailing_whitespace/__snapshots__/jsfmt.spec.js.snap +++ b/tests/trailing_whitespace/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,7 @@ -exports[`test trailing.js 1`] = ` -"export type Result = | { kind: \"not-test-editor1\" } | { kind: \"not-test-editor2\" }; +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`trailing.js 1`] = ` +"export type Result = | { kind: \\"not-test-editor1\\" } | { kind: \\"not-test-editor2\\" }; // Note: there are trailing whitespace in this file \` @@ -11,8 +13,8 @@ exports[`test trailing.js 1`] = ` \`; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export type Result = - | { kind: \"not-test-editor1\" } - | { kind: \"not-test-editor2\" }; + | { kind: \\"not-test-editor1\\" } + | { kind: \\"not-test-editor2\\" }; // Note: there are trailing whitespace in this file \` diff --git a/tests/unary/__snapshots__/jsfmt.spec.js.snap b/tests/unary/__snapshots__/jsfmt.spec.js.snap index 1adb04cc4..ff9113c2e 100644 --- a/tests/unary/__snapshots__/jsfmt.spec.js.snap +++ b/tests/unary/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test object.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`object.js 1`] = ` "state = { // students hoverColumn: -1 @@ -11,7 +13,7 @@ state = { " `; -exports[`test series.js 1`] = ` +exports[`series.js 1`] = ` "1 + ++x; 1 + x++; diff --git a/tests/unary_expression/__snapshots__/jsfmt.spec.js.snap b/tests/unary_expression/__snapshots__/jsfmt.spec.js.snap index bbc577738..956927202 100644 --- a/tests/unary_expression/__snapshots__/jsfmt.spec.js.snap +++ b/tests/unary_expression/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test urnary_expression.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`urnary_expression.js 1`] = ` "!!x x++ x--; diff --git a/tests/unicode/__snapshots__/jsfmt.spec.js.snap b/tests/unicode/__snapshots__/jsfmt.spec.js.snap index ebc7b6033..69006e423 100644 --- a/tests/unicode/__snapshots__/jsfmt.spec.js.snap +++ b/tests/unicode/__snapshots__/jsfmt.spec.js.snap @@ -1,6 +1,8 @@ -exports[`test keys.js 1`] = ` -"({\'この事はつもり素晴らしいことさ\': \'35jL9V\'}) +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`keys.js 1`] = ` +"({'この事はつもり素晴らしいことさ': '35jL9V'}) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -({ \"この事はつもり素晴らしいことさ\": \"35jL9V\" }); +({ \\"この事はつもり素晴らしいことさ\\": \\"35jL9V\\" }); " `; diff --git a/tests/union_intersection/__snapshots__/jsfmt.spec.js.snap b/tests/union_intersection/__snapshots__/jsfmt.spec.js.snap index f09d34da1..520c0c149 100644 --- a/tests/union_intersection/__snapshots__/jsfmt.spec.js.snap +++ b/tests/union_intersection/__snapshots__/jsfmt.spec.js.snap @@ -1,19 +1,21 @@ -exports[`test test.js 1`] = ` -"type T5 = \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\" | \"10\" | \"11\" | \"12\" | \"13\"; +// Jest Snapshot v1, https://goo.gl/fbAQLP -type T6 = \"a-long-string\" | \"another-long-string\" | \"yet-another-long-string\" | \"one-more-for-good-measure\"; +exports[`test.js 1`] = ` +"type T5 = \\"1\\" | \\"2\\" | \\"3\\" | \\"4\\" | \\"5\\" | \\"6\\" | \\"7\\" | \\"8\\" | \\"9\\" | \\"10\\" | \\"11\\" | \\"12\\" | \\"13\\"; + +type T6 = \\"a-long-string\\" | \\"another-long-string\\" | \\"yet-another-long-string\\" | \\"one-more-for-good-measure\\"; type T7 = - { eventName: \"these\", a: number } | - { eventName: \"will\", b: number } | - { eventName: \"not\", c: number } | - { eventName: \"fit\", d: number } | - { eventName: \"on\", e: number } | - { eventName: \"one\", f: number } | - { eventName: \"line\", g: number }; + { eventName: \\"these\\", a: number } | + { eventName: \\"will\\", b: number } | + { eventName: \\"not\\", c: number } | + { eventName: \\"fit\\", d: number } | + { eventName: \\"on\\", e: number } | + { eventName: \\"one\\", f: number } | + { eventName: \\"line\\", g: number }; type Comment = { - type: \'CommentLine\'; + type: 'CommentLine'; _CommentLine: void; value: string; end: number; @@ -23,7 +25,7 @@ type Comment = { }; start: number; } | { - type: \'CommentBlock\'; + type: 'CommentBlock'; _CommentBlock: void; value: string; end: number; @@ -35,38 +37,38 @@ type Comment = { }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ type T5 = - | \"1\" - | \"2\" - | \"3\" - | \"4\" - | \"5\" - | \"6\" - | \"7\" - | \"8\" - | \"9\" - | \"10\" - | \"11\" - | \"12\" - | \"13\"; + | \\"1\\" + | \\"2\\" + | \\"3\\" + | \\"4\\" + | \\"5\\" + | \\"6\\" + | \\"7\\" + | \\"8\\" + | \\"9\\" + | \\"10\\" + | \\"11\\" + | \\"12\\" + | \\"13\\"; type T6 = - | \"a-long-string\" - | \"another-long-string\" - | \"yet-another-long-string\" - | \"one-more-for-good-measure\"; + | \\"a-long-string\\" + | \\"another-long-string\\" + | \\"yet-another-long-string\\" + | \\"one-more-for-good-measure\\"; type T7 = - | { eventName: \"these\", a: number } - | { eventName: \"will\", b: number } - | { eventName: \"not\", c: number } - | { eventName: \"fit\", d: number } - | { eventName: \"on\", e: number } - | { eventName: \"one\", f: number } - | { eventName: \"line\", g: number }; + | { eventName: \\"these\\", a: number } + | { eventName: \\"will\\", b: number } + | { eventName: \\"not\\", c: number } + | { eventName: \\"fit\\", d: number } + | { eventName: \\"on\\", e: number } + | { eventName: \\"one\\", f: number } + | { eventName: \\"line\\", g: number }; type Comment = | { - type: \"CommentLine\", + type: \\"CommentLine\\", _CommentLine: void, value: string, end: number, @@ -77,7 +79,7 @@ type Comment = start: number } | { - type: \"CommentBlock\", + type: \\"CommentBlock\\", _CommentBlock: void, value: string, end: number, diff --git a/tests/update_expression/__snapshots__/jsfmt.spec.js.snap b/tests/update_expression/__snapshots__/jsfmt.spec.js.snap index 343115b21..374d5904a 100644 --- a/tests/update_expression/__snapshots__/jsfmt.spec.js.snap +++ b/tests/update_expression/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test update_expression.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`update_expression.js 1`] = ` "(this.x++).toString() new (r++); (x++)(); diff --git a/tests/while/__snapshots__/jsfmt.spec.js.snap b/tests/while/__snapshots__/jsfmt.spec.js.snap index eb86ddfe6..6c6ff4bbe 100644 --- a/tests/while/__snapshots__/jsfmt.spec.js.snap +++ b/tests/while/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test indent.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`indent.js 1`] = ` "if (someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD) {} while (someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD) {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/windows/__snapshots__/jsfmt.spec.js.snap b/tests/windows/__snapshots__/jsfmt.spec.js.snap index 59f5cdfa5..5892fe8ee 100644 --- a/tests/windows/__snapshots__/jsfmt.spec.js.snap +++ b/tests/windows/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test line-ending.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`line-ending.js 1`] = ` "this; has; windows; diff --git a/tests/yield/__snapshots__/jsfmt.spec.js.snap b/tests/yield/__snapshots__/jsfmt.spec.js.snap index 4c9654ede..b76a92b37 100644 --- a/tests/yield/__snapshots__/jsfmt.spec.js.snap +++ b/tests/yield/__snapshots__/jsfmt.spec.js.snap @@ -1,4 +1,6 @@ -exports[`test conditional.js 1`] = ` +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`conditional.js 1`] = ` "function* f() { a = (yield) ? 1 : 1; a = yield 1 ? 1 : 1; diff --git a/yarn.lock b/yarn.lock index ad920b5ed..9941f049e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,21 +6,17 @@ version "1.0.0" resolved "https://registry.yarnpkg.com/@comandeer/babel-plugin-banner/-/babel-plugin-banner-1.0.0.tgz#40bcce0bbee084b5b02545a33635d053c248356f" -abab@^1.0.0: +abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" -acorn-globals@^1.0.4: - version "1.0.9" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-1.0.9.tgz#55bb5e98691507b74579d0513413217c380c54cf" +acorn-globals@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" dependencies: - acorn "^2.1.0" + acorn "^4.0.4" -acorn@^2.1.0, acorn@^2.4.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7" - -acorn@^4.0.1: +acorn@^4.0.1, acorn@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" @@ -48,9 +44,18 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansicolors@~0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.2.1.tgz#be089599097b74a5c9c4a84a0cdbcdb62bd87aef" +ansi-styles@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.0.0.tgz#5404e93a544c4fec7f048262977bebfe3155e0c1" + dependencies: + color-convert "^1.0.0" + +anymatch@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + dependencies: + arrify "^1.0.0" + micromatch "^2.1.5" append-transform@^0.3.0: version "0.3.0" @@ -80,7 +85,7 @@ array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" -arrify@^1.0.1: +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -213,13 +218,13 @@ babel-helpers@^6.16.0: babel-runtime "^6.0.0" babel-template "^6.16.0" -babel-jest@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-18.0.0.tgz#17ebba8cb3285c906d859e8707e4e79795fb65e3" +babel-jest@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-19.0.0.tgz#59323ced99a3a84d359da219ca881074ffc6ce3f" dependencies: babel-core "^6.0.0" - babel-plugin-istanbul "^3.0.0" - babel-preset-jest "^18.0.0" + babel-plugin-istanbul "^4.0.0" + babel-preset-jest "^19.0.0" babel-messages@^6.8.0: version "6.8.0" @@ -227,18 +232,17 @@ babel-messages@^6.8.0: dependencies: babel-runtime "^6.0.0" -babel-plugin-istanbul@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-3.1.2.tgz#11d5abde18425ec24b5d648c7e0b5d25cd354a22" +babel-plugin-istanbul@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.0.0.tgz#36bde8fbef4837e5ff0366531a2beabd7b1ffa10" dependencies: - find-up "^1.1.2" + find-up "^2.1.0" istanbul-lib-instrument "^1.4.2" - object-assign "^4.1.0" - test-exclude "^3.3.0" + test-exclude "^4.0.0" -babel-plugin-jest-hoist@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-18.0.0.tgz#4150e70ecab560e6e7344adc849498072d34e12a" +babel-plugin-jest-hoist@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea" babel-plugin-minify-constant-folding@^0.0.3: version "0.0.3" @@ -362,11 +366,11 @@ babel-preset-babili@0.0.9: babel-plugin-transform-simplify-comparison-operators "^6.8.0" babel-plugin-transform-undefined-to-void "^6.8.0" -babel-preset-jest@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-18.0.0.tgz#84faf8ca3ec65aba7d5e3f59bbaed935ab24049e" +babel-preset-jest@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-19.0.0.tgz#22d67201d02324a195811288eb38294bb3cac396" dependencies: - babel-plugin-jest-hoist "^18.0.0" + babel-plugin-jest-hoist "^19.0.0" babel-register@^6.18.0: version "6.18.0" @@ -520,6 +524,12 @@ bser@^1.0.2: dependencies: node-int64 "^0.4.0" +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + buffer-es6@^4.9.1, buffer-es6@^4.9.2: version "4.9.3" resolved "https://registry.yarnpkg.com/buffer-es6/-/buffer-es6-4.9.3.tgz#f26347b82df76fd37e18bcb5288c4970cfd5c404" @@ -544,13 +554,6 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" -cardinal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cardinal/-/cardinal-1.0.0.tgz#50e21c1b0aa37729f9377def196b5a9cec932ee9" - dependencies: - ansicolors "~0.2.1" - redeyed "~1.0.0" - caseless@~0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" @@ -582,19 +585,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1: dependencies: inherits "^2.0.1" -cli-table@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23" - dependencies: - colors "1.0.3" - -cli-usage@^0.1.1: - version "0.1.4" - resolved "https://registry.yarnpkg.com/cli-usage/-/cli-usage-0.1.4.tgz#7c01e0dc706c234b39c933838c8e20b2175776e2" - dependencies: - marked "^0.3.6" - marked-terminal "^1.6.2" - cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" @@ -615,7 +605,17 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" -colors@1.0.3, colors@>=0.6.2: +color-convert@^1.0.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" + +colors@>=0.6.2: version "1.0.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" @@ -691,11 +691,11 @@ crypto-browserify@^3.11.0: public-encrypt "^4.0.0" randombytes "^2.0.0" -cssom@0.3.x, "cssom@>= 0.3.0 < 0.4.0": - version "0.3.1" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.1.tgz#c9e37ef2490e64f6d1baa10fda852257082c25d3" +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" -"cssstyle@>= 0.2.36 < 0.3.0": +"cssstyle@>= 0.2.37 < 0.3.0": version "0.2.37" resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" dependencies: @@ -738,7 +738,7 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" -diff@^3.0.0: +diff@3.2.0, diff@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" @@ -796,10 +796,6 @@ esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" -esprima@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.0.0.tgz#53cf247acda77313e551c3aa2e73342d3fb4f7d9" - estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" @@ -858,12 +854,18 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -fb-watchman@^1.8.0, fb-watchman@^1.9.0: +fb-watchman@^1.8.0: version "1.9.0" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-1.9.0.tgz#6f268f1f347a6b3c875d1e89da7e1ed79adfc0ec" dependencies: bser "^1.0.2" +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + filename-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" @@ -885,13 +887,19 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -find-up@^1.0.0, find-up@^1.1.2: +find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + flow-parser@0.38.0: version "0.38.0" resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.38.0.tgz#a631c46170c5b42400d905a75cfc83ce8db29424" @@ -986,7 +994,7 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" -growly@^1.2.0: +growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" @@ -1067,10 +1075,6 @@ iconv-lite@0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" -iconv-lite@^0.4.13: - version "0.4.15" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1265,13 +1269,13 @@ istanbul-reports@^1.0.0: dependencies: handlebars "^4.0.3" -jest-changed-files@^17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-17.0.2.tgz#f5657758736996f590a51b87e5c9369d904ba7b7" +jest-changed-files@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-19.0.0.tgz#8c1a43a4ffccbcb8ae12e819104585adf2ed93a6" -jest-cli@^18.0.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-18.1.0.tgz#5ead36ecad420817c2c9baa2aa7574f63257b3d6" +jest-cli@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-19.0.0.tgz#327398717a583bd5d5d97564eb3d762c514e97ff" dependencies: ansi-escapes "^1.4.0" callsites "^2.0.0" @@ -1281,180 +1285,190 @@ jest-cli@^18.0.0: istanbul-api "^1.1.0-alpha.1" istanbul-lib-coverage "^1.0.0" istanbul-lib-instrument "^1.1.1" - jest-changed-files "^17.0.2" - jest-config "^18.1.0" - jest-environment-jsdom "^18.1.0" - jest-file-exists "^17.0.0" - jest-haste-map "^18.1.0" - jest-jasmine2 "^18.1.0" - jest-mock "^18.0.0" - jest-resolve "^18.1.0" - jest-resolve-dependencies "^18.1.0" - jest-runtime "^18.1.0" - jest-snapshot "^18.1.0" - jest-util "^18.1.0" - json-stable-stringify "^1.0.0" - node-notifier "^4.6.1" - sane "~1.4.1" - strip-ansi "^3.0.1" + jest-changed-files "^19.0.0" + jest-config "^19.0.0" + jest-environment-jsdom "^19.0.0" + jest-haste-map "^19.0.0" + jest-jasmine2 "^19.0.0" + jest-message-util "^19.0.0" + jest-regex-util "^19.0.0" + jest-resolve-dependencies "^19.0.0" + jest-runtime "^19.0.0" + jest-snapshot "^19.0.0" + jest-util "^19.0.0" + micromatch "^2.3.11" + node-notifier "^5.0.1" + string-length "^1.0.1" throat "^3.0.0" which "^1.1.1" worker-farm "^1.3.1" yargs "^6.3.0" -jest-config@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-18.1.0.tgz#6111740a6d48aab86ff5a9e6ab0b98bd993b6ff4" +jest-config@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-19.0.0.tgz#223db244d987afac1c99a955069d8fe89eea1457" dependencies: chalk "^1.1.1" - jest-environment-jsdom "^18.1.0" - jest-environment-node "^18.1.0" - jest-jasmine2 "^18.1.0" - jest-mock "^18.0.0" - jest-resolve "^18.1.0" - jest-util "^18.1.0" - json-stable-stringify "^1.0.0" + jest-environment-jsdom "^19.0.0" + jest-environment-node "^19.0.0" + jest-jasmine2 "^19.0.0" + jest-regex-util "^19.0.0" + jest-resolve "^19.0.0" + jest-validate "^19.0.0" + pretty-format "^19.0.0" -jest-diff@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-18.1.0.tgz#4ff79e74dd988c139195b365dc65d87f606f4803" +jest-diff@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" dependencies: chalk "^1.1.3" diff "^3.0.0" - jest-matcher-utils "^18.1.0" - pretty-format "^18.1.0" + jest-matcher-utils "^19.0.0" + pretty-format "^19.0.0" -jest-environment-jsdom@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-18.1.0.tgz#18b42f0c4ea2bae9f36cab3639b1e8f8c384e24e" +jest-environment-jsdom@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-19.0.0.tgz#c875ec276ed306c79ebad54bb5ab45b655ab9daf" dependencies: - jest-mock "^18.0.0" - jest-util "^18.1.0" - jsdom "^9.9.1" + jest-mock "^19.0.0" + jest-util "^19.0.0" + jsdom "^9.11.0" -jest-environment-node@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-18.1.0.tgz#4d6797572c8dda99acf5fae696eb62945547c779" +jest-environment-node@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-19.0.0.tgz#e7f0656dcb5fec6845fb6790a4c4ad1bdff09b70" dependencies: - jest-mock "^18.0.0" - jest-util "^18.1.0" + jest-mock "^19.0.0" + jest-util "^19.0.0" -jest-file-exists@^17.0.0: - version "17.0.0" - resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-17.0.0.tgz#7f63eb73a1c43a13f461be261768b45af2cdd169" +jest-file-exists@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" -jest-haste-map@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-18.1.0.tgz#06839c74b770a40c1a106968851df8d281c08375" +jest-haste-map@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-19.0.0.tgz#adde00b62b1fe04432a104b3254fc5004514b55e" dependencies: - fb-watchman "^1.9.0" + fb-watchman "^2.0.0" graceful-fs "^4.1.6" micromatch "^2.3.11" - sane "~1.4.1" + sane "~1.5.0" worker-farm "^1.3.1" -jest-jasmine2@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-18.1.0.tgz#094e104c2c189708766c77263bb2aecb5860a80b" +jest-jasmine2@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-19.0.0.tgz#0f82b06cddca20ae3c54e04940fb597866c0f667" dependencies: graceful-fs "^4.1.6" - jest-matcher-utils "^18.1.0" - jest-matchers "^18.1.0" - jest-snapshot "^18.1.0" - jest-util "^18.1.0" + jest-matcher-utils "^19.0.0" + jest-matchers "^19.0.0" + jest-message-util "^19.0.0" + jest-snapshot "^19.0.0" -jest-matcher-utils@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-18.1.0.tgz#1ac4651955ee2a60cef1e7fcc98cdfd773c0f932" +jest-matcher-utils@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" dependencies: chalk "^1.1.3" - pretty-format "^18.1.0" + pretty-format "^19.0.0" -jest-matchers@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-18.1.0.tgz#0341484bf87a1fd0bac0a4d2c899e2b77a3f1ead" +jest-matchers@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-19.0.0.tgz#c74ecc6ebfec06f384767ba4d6fa4a42d6755754" dependencies: - jest-diff "^18.1.0" - jest-matcher-utils "^18.1.0" - jest-util "^18.1.0" - pretty-format "^18.1.0" + jest-diff "^19.0.0" + jest-matcher-utils "^19.0.0" + jest-message-util "^19.0.0" + jest-regex-util "^19.0.0" -jest-mock@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-18.0.0.tgz#5c248846ea33fa558b526f5312ab4a6765e489b3" - -jest-resolve-dependencies@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-18.1.0.tgz#8134fb5caf59c9ed842fe0152ab01c52711f1bbb" +jest-message-util@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-19.0.0.tgz#721796b89c0e4d761606f9ba8cb828a3b6246416" dependencies: - jest-file-exists "^17.0.0" - jest-resolve "^18.1.0" + chalk "^1.1.1" + micromatch "^2.3.11" -jest-resolve@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-18.1.0.tgz#6800accb536658c906cd5e29de412b1ab9ac249b" +jest-mock@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-19.0.0.tgz#67038641e9607ab2ce08ec4a8cb83aabbc899d01" + +jest-regex-util@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-19.0.0.tgz#b7754587112aede1456510bb1f6afe74ef598691" + +jest-resolve-dependencies@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-19.0.0.tgz#a741ad1fa094140e64ecf2642a504f834ece22ee" + dependencies: + jest-file-exists "^19.0.0" + +jest-resolve@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-19.0.0.tgz#83e6166d58ad9e31c8503e54b215e30ca56cb5ae" dependencies: browser-resolve "^1.11.2" - jest-file-exists "^17.0.0" - jest-haste-map "^18.1.0" + jest-haste-map "^19.0.0" resolve "^1.2.0" -jest-runtime@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-18.1.0.tgz#3abfd687175b21fc3b85a2b8064399e997859922" +jest-runtime@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-19.0.0.tgz#66d06a3f5b52e86f31e4561afd62cc74cce9bc28" dependencies: babel-core "^6.0.0" - babel-jest "^18.0.0" - babel-plugin-istanbul "^3.0.0" + babel-jest "^19.0.0" + babel-plugin-istanbul "^4.0.0" chalk "^1.1.3" graceful-fs "^4.1.6" - jest-config "^18.1.0" - jest-file-exists "^17.0.0" - jest-haste-map "^18.1.0" - jest-mock "^18.0.0" - jest-resolve "^18.1.0" - jest-snapshot "^18.1.0" - jest-util "^18.1.0" - json-stable-stringify "^1.0.0" + jest-config "^19.0.0" + jest-file-exists "^19.0.0" + jest-haste-map "^19.0.0" + jest-regex-util "^19.0.0" + jest-resolve "^19.0.0" + jest-util "^19.0.0" + json-stable-stringify "^1.0.1" micromatch "^2.3.11" + strip-bom "3.0.0" yargs "^6.3.0" -jest-snapshot@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-18.1.0.tgz#55b96d2ee639c9bce76f87f2a3fd40b71c7a5916" +jest-snapshot@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-19.0.0.tgz#1b6b2683a1132d7536e69c8e9753a8d3445bb8df" dependencies: - jest-diff "^18.1.0" - jest-file-exists "^17.0.0" - jest-matcher-utils "^18.1.0" - jest-util "^18.1.0" + chalk "^1.1.3" + jest-diff "^19.0.0" + jest-file-exists "^19.0.0" + jest-matcher-utils "^19.0.0" + jest-util "^19.0.0" natural-compare "^1.4.0" - pretty-format "^18.1.0" + pretty-format "^19.0.0" -jest-util@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-18.1.0.tgz#3a99c32114ab17f84be094382527006e6d4bfc6a" +jest-util@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-19.0.0.tgz#5d8b1b85b412537b1f9eb1e6599a9bdb10743cff" dependencies: chalk "^1.1.1" - diff "^3.0.0" graceful-fs "^4.1.6" - jest-file-exists "^17.0.0" - jest-mock "^18.0.0" + jest-file-exists "^19.0.0" + jest-message-util "^19.0.0" + jest-mock "^19.0.0" + jest-validate "^19.0.0" + leven "^2.0.0" mkdirp "^0.5.1" -jest-validate@18.2.0: - version "18.2.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-18.2.0.tgz#01f93ac78f23901cf9889808e2bbb931ffc58d86" +jest-validate@19.0.0, jest-validate@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.0.tgz#8c6318a20ecfeaba0ba5378bfbb8277abded4173" dependencies: chalk "^1.1.1" - jest-matcher-utils "^18.1.0" + jest-matcher-utils "^19.0.0" leven "^2.0.0" - pretty-format "^18.1.0" + pretty-format "^19.0.0" -jest@18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-18.0.0.tgz#ef12f70befe0fcb30f1c61c0ae58748706267d4b" +jest@19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-19.0.0.tgz#37680d4d8fb54dee7fe7b7c1c0a6203a2dbcbf23" dependencies: - jest-cli "^18.0.0" + jest-cli "^19.0.0" jodid25519@^1.0.0: version "1.0.2" @@ -1481,30 +1495,29 @@ jsbn@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" -jsdom@^9.9.1: - version "9.9.1" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.9.1.tgz#84f3972ad394ab963233af8725211bce4d01bfd5" +jsdom@^9.11.0: + version "9.11.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.11.0.tgz#a95b0304e521a2ca5a63c6ea47bf7708a7a84591" dependencies: - abab "^1.0.0" - acorn "^2.4.0" - acorn-globals "^1.0.4" + abab "^1.0.3" + acorn "^4.0.4" + acorn-globals "^3.1.0" array-equal "^1.0.0" content-type-parser "^1.0.1" - cssom ">= 0.3.0 < 0.4.0" - cssstyle ">= 0.2.36 < 0.3.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" escodegen "^1.6.1" html-encoding-sniffer "^1.0.1" - iconv-lite "^0.4.13" nwmatcher ">= 1.3.9 < 2.0.0" parse5 "^1.5.1" - request "^2.55.0" - sax "^1.1.4" - symbol-tree ">= 3.1.0 < 4.0.0" - tough-cookie "^2.3.1" - webidl-conversions "^3.0.1" + request "^2.79.0" + sax "^1.2.1" + symbol-tree "^3.2.1" + tough-cookie "^2.3.2" + webidl-conversions "^4.0.0" whatwg-encoding "^1.0.1" - whatwg-url "^4.1.0" - xml-name-validator ">= 2.0.1 < 3.0.0" + whatwg-url "^4.3.0" + xml-name-validator "^2.0.1" jsesc@^1.3.0: version "1.3.0" @@ -1514,7 +1527,7 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.0: +json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" dependencies: @@ -1581,74 +1594,12 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" -lodash._arraycopy@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz#76e7b7c1f1fb92547374878a562ed06a3e50f6e1" - -lodash._arrayeach@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._arrayeach/-/lodash._arrayeach-3.0.0.tgz#bab156b2a90d3f1bbd5c653403349e5e5933ef9e" - -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._baseclone@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/lodash._baseclone/-/lodash._baseclone-3.3.0.tgz#303519bf6393fe7e42f34d8b630ef7794e3542b7" - dependencies: - lodash._arraycopy "^3.0.0" - lodash._arrayeach "^3.0.0" - lodash._baseassign "^3.0.0" - lodash._basefor "^3.0.0" - lodash.isarray "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basefor@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash._basefor/-/lodash._basefor-3.0.3.tgz#7550b4e9218ef09fad24343b612021c79b4c20c2" - -lodash._bindcallback@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash.assign@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" - -lodash.clonedeep@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-3.0.2.tgz#a0a1e40d82a5ea89ff5b147b8444ed63d92827db" - dependencies: - lodash._baseclone "^3.0.0" - lodash._bindcallback "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" + p-locate "^2.0.0" + path-exists "^3.0.0" lodash.some@^4.6.0: version "4.6.0" @@ -1686,25 +1637,11 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" -marked-terminal@^1.6.2: - version "1.7.0" - resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-1.7.0.tgz#c8c460881c772c7604b64367007ee5f77f125904" - dependencies: - cardinal "^1.0.0" - chalk "^1.1.3" - cli-table "^0.3.1" - lodash.assign "^4.2.0" - node-emoji "^1.4.1" - -marked@^0.3.6: - version "0.3.6" - resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.6.tgz#b2c6c618fccece4ef86c4fc6cb8a7cbf5aeda8d7" - merge@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" -micromatch@^2.3.11: +micromatch@^2.1.5, micromatch@^2.3.11: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: @@ -1771,27 +1708,18 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" -node-emoji@^1.4.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.5.0.tgz#9a0d9fe03fd43afa357d6d8e439aa31e599959b7" - dependencies: - string.prototype.codepointat "^0.2.0" - node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" -node-notifier@^4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-4.6.1.tgz#056d14244f3dcc1ceadfe68af9cff0c5473a33f3" +node-notifier@^5.0.1: + version "5.0.2" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.0.2.tgz#4438449fe69e321f941cef943986b0797032701b" dependencies: - cli-usage "^0.1.1" - growly "^1.2.0" - lodash.clonedeep "^3.0.0" - minimist "^1.1.1" - semver "^5.1.0" + growly "^1.3.0" + semver "^5.3.0" shellwords "^0.1.0" - which "^1.0.5" + which "^1.2.12" normalize-package-data@^2.3.2: version "2.3.5" @@ -1867,6 +1795,16 @@ os-tmpdir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + parse-asn1@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.0.0.tgz#35060f6d5015d37628c770f4e091a0b5a278bc23" @@ -1902,6 +1840,10 @@ path-exists@^2.0.0: dependencies: pinkie-promise "^2.0.0" +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -1946,11 +1888,11 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -pretty-format@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-18.1.0.tgz#fb65a86f7a7f9194963eee91865c1bcf1039e284" +pretty-format@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84" dependencies: - ansi-styles "^2.2.1" + ansi-styles "^3.0.0" private@^0.1.6: version "0.1.6" @@ -2008,12 +1950,6 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" -redeyed@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/redeyed/-/redeyed-1.0.1.tgz#e96c193b40c0816b00aec842698e61185e55498a" - dependencies: - esprima "~3.0.0" - regenerator-runtime@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb" @@ -2039,7 +1975,7 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@^2.55.0: +request@^2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" dependencies: @@ -2160,10 +2096,11 @@ rollup@0.41.1: dependencies: source-map-support "^0.4.0" -sane@~1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/sane/-/sane-1.4.1.tgz#88f763d74040f5f0c256b6163db399bf110ac715" +sane@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-1.5.0.tgz#a4adeae764d048621ecb27d5f9ecf513101939f3" dependencies: + anymatch "^1.3.0" exec-sh "^0.2.0" fb-watchman "^1.8.0" minimatch "^3.0.2" @@ -2171,11 +2108,11 @@ sane@~1.4.1: walker "~1.0.5" watch "~0.10.0" -sax@^1.1.4: - version "1.2.1" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" +sax@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828" -"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -2258,6 +2195,12 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" +string-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" + dependencies: + strip-ansi "^3.0.0" + string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -2266,10 +2209,6 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string.prototype.codepointat@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/string.prototype.codepointat/-/string.prototype.codepointat-0.2.0.tgz#6b26e9bd3afcaa7be3b4269b526de1b82000ac78" - stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -2280,6 +2219,10 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" +strip-bom@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -2296,13 +2239,13 @@ supports-color@^3.1.2: dependencies: has-flag "^1.0.0" -"symbol-tree@>= 3.1.0 < 4.0.0": - version "3.2.1" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.1.tgz#8549dd1d01fa9f893c18cc9ab0b106b4d9b168cb" +symbol-tree@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" -test-exclude@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-3.3.0.tgz#7a17ca1239988c98367b0621456dbb7d4bc38977" +test-exclude@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.0.tgz#0ddc0100b8ae7e88b34eb4fd98a907e961991900" dependencies: arrify "^1.0.1" micromatch "^2.3.11" @@ -2322,7 +2265,7 @@ to-fast-properties@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" -tough-cookie@^2.3.1, tough-cookie@~2.3.0: +tough-cookie@^2.3.2, tough-cookie@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" dependencies: @@ -2390,19 +2333,23 @@ watch@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" -webidl-conversions@^3.0.0, webidl-conversions@^3.0.1: +webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" +webidl-conversions@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.1.tgz#8015a17ab83e7e1b311638486ace81da6ce206a0" + whatwg-encoding@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.1.tgz#3c6c451a198ee7aec55b1ec61d0920c67801a5f4" dependencies: iconv-lite "0.4.13" -whatwg-url@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.2.0.tgz#abf1a3f5ff4bc2005b3f0c2119382631789d8e44" +whatwg-url@^4.3.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.4.0.tgz#594f95781545c13934a62db40897c818cafa2e04" dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" @@ -2411,7 +2358,7 @@ which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" -which@^1.0.5, which@^1.1.1: +which@^1.1.1, which@^1.2.12: version "1.2.12" resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192" dependencies: @@ -2451,7 +2398,7 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -"xml-name-validator@>= 2.0.1 < 3.0.0": +xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635"