From b1ef5b79f72c7dfa90efa0fb21bf7574290058b1 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 17 Mar 2023 12:58:55 -0700 Subject: [PATCH] Convert config file parsing tests to baseline for easier future update verification and adds missing location verification (#53324) --- src/testRunner/tests.ts | 2 +- .../config/configurationExtension.ts | 327 +-- .../config/convertCompilerOptionsFromJson.ts | 945 ++------- .../config/convertTypeAcquisitionFromJson.ts | 273 +-- src/testRunner/unittests/config/helpers.ts | 105 + src/testRunner/unittests/config/matchFiles.ts | 1812 ++++------------- .../unittests/config/projectReferences.ts | 355 ---- .../unittests/config/tsconfigParsing.ts | 613 +++--- .../config/tsconfigParsingWatchOptions.ts | 100 +- .../unittests/tsc/projectReferencesConfig.ts | 253 +++ ...only once under a case insensitive host.js | 157 ++ ...y only once under a case sensitive host.js | 157 ++ ...only once under a case insensitive host.js | 155 ++ ...s only once under a case sensitive host.js | 155 ++ ...r a case insensitive host with json api.js | 443 ++++ ...nsensitive host with jsonSourceFile api.js | 461 +++++ ...der a case sensitive host with json api.js | 443 ++++ ... sensitive host with jsonSourceFile api.js | 461 +++++ ...ailing comments with jsonSourceFile api.js | 18 + ...ile as an array with jsonSourceFile api.js | 34 + ...ding characters with jsonSourceFile api.js | 27 + ...ling characters with jsonSourceFile api.js | 34 + ....json to compiler-options with json api.js | 44 + ...ompiler-options with jsonSourceFile api.js | 44 + ...false to compiler-options with json api.js | 45 + ...ompiler-options with jsonSourceFile api.js | 45 + ....json to compiler-options with json api.js | 39 + ...ompiler-options with jsonSourceFile api.js | 39 + ...false to compiler-options with json api.js | 41 + ...ompiler-options with jsonSourceFile api.js | 41 + ....json to compiler-options with json api.js | 23 + ...ompiler-options with jsonSourceFile api.js | 23 + ....json to compiler-options with json api.js | 18 + ...ompiler-options with jsonSourceFile api.js | 18 + ... libs to compiler-options with json api.js | 31 + ...ompiler-options with jsonSourceFile api.js | 31 + ...fixes to compiler-options with json api.js | 23 + ...ompiler-options with jsonSourceFile api.js | 23 + ...array to compiler-options with json api.js | 34 + ...ompiler-options with jsonSourceFile api.js | 37 + ... libs to compiler-options with json api.js | 37 + ...ompiler-options with jsonSourceFile api.js | 40 + ...ingle to compiler-options with json api.js | 27 + ...ompiler-options with jsonSourceFile api.js | 27 + ...fixes to compiler-options with json api.js | 29 + ...ompiler-options with jsonSourceFile api.js | 29 + ...f jsx to compiler-options with json api.js | 31 + ...ompiler-options with jsonSourceFile api.js | 34 + ... libs to compiler-options with json api.js | 39 + ...ompiler-options with jsonSourceFile api.js | 42 + ...odule to compiler-options with json api.js | 29 + ...ompiler-options with jsonSourceFile api.js | 32 + ...ution to compiler-options with json api.js | 27 + ...ompiler-options with jsonSourceFile api.js | 30 + ...wLine to compiler-options with json api.js | 29 + ...ompiler-options with jsonSourceFile api.js | 32 + ...arget to compiler-options with json api.js | 27 + ...ompiler-options with jsonSourceFile api.js | 30 + ....json to compiler-options with json api.js | 28 + ...ompiler-options with jsonSourceFile api.js | 31 + ....json to compiler-options with json api.js | 23 + ...ompiler-options with jsonSourceFile api.js | 26 + ... numbers in tsconfig.json with json api.js | 25 + ...n tsconfig.json with jsonSourceFile api.js | 25 + ... libs to compiler-options with json api.js | 34 + ...ompiler-options with jsonSourceFile api.js | 37 + ...fixes to compiler-options with json api.js | 27 + ...ompiler-options with jsonSourceFile api.js | 27 + ...invalid strings with jsonSourceFile api.js | 114 ++ ...t object at all with jsonSourceFile api.js | 22 + ...ompilerOptions' with jsonSourceFile api.js | 24 + ...compilerOptions with jsonSourceFile api.js | 24 + ....json to typeAcquisition with json api.js | 38 + ...ypeAcquisition with jsonSourceFile api.js | 38 + ....json to typeAcquisition with json api.js | 20 + ...ypeAcquisition with jsonSourceFile api.js | 20 + ....json to typeAcquisition with json api.js | 20 + ...ypeAcquisition with jsonSourceFile api.js | 20 + ....json to typeAcquisition with json api.js | 25 + ...ypeAcquisition with jsonSourceFile api.js | 28 + ....json to typeAcquisition with json api.js | 25 + ...ypeAcquisition with jsonSourceFile api.js | 28 + ....json to typeAcquisition with json api.js | 34 + ...ypeAcquisition with jsonSourceFile api.js | 34 + ...perty to typeAcquisition with json api.js | 24 + ...ypeAcquisition with jsonSourceFile api.js | 24 + ...perty to typeAcquisition with json api.js | 24 + ...ypeAcquisition with jsonSourceFile api.js | 24 + .../starstart/star with json api.js | 109 + .../starstart/star with jsonSourceFile api.js | 108 + ...ays include literal files with json api.js | 116 ++ ...e literal files with jsonSourceFile api.js | 115 ++ .../and empty exclude with json api.js | 62 + ...d empty exclude with jsonSourceFile api.js | 61 + .../and exclusions with json api.js | 66 + .../and exclusions with jsonSourceFile api.js | 65 + ...xplicit recursive include with json api.js | 63 + ...cursive include with jsonSourceFile api.js | 62 + ...explicit wildcard include with json api.js | 62 + ...ildcard include with jsonSourceFile api.js | 61 + .../and no exclusions with json api.js | 60 + ...d no exclusions with jsonSourceFile api.js | 59 + .../and wildcard include with json api.js | 59 + ...ildcard include with jsonSourceFile api.js | 58 + ...t removed due to excludes with json api.js | 111 + ...due to excludes with jsonSourceFile api.js | 110 + ...tern starts with starstar with json api.js | 97 + ...s with starstar with jsonSourceFile api.js | 96 + ...ern starts with starstart with json api.js | 99 + ... with starstart with jsonSourceFile api.js | 98 + ...latforms case insensitive with json api.js | 39 + ...ase insensitive with jsonSourceFile api.js | 37 + ... platforms case sensitive with json api.js | 36 + ... case sensitive with jsonSourceFile api.js | 34 + .../case sensitive with json api.js | 97 + .../case sensitive with jsonSourceFile api.js | 96 + ... files when allowJs=false with json api.js | 110 + ...n allowJs=false with jsonSourceFile api.js | 109 + ....js files using wildcards with json api.js | 117 ++ ...using wildcards with jsonSourceFile api.js | 116 ++ ...les with .. in their name with json api.js | 110 + .... in their name with jsonSourceFile api.js | 109 + .../exclude folders with json api.js | 114 ++ ...exclude folders with jsonSourceFile api.js | 113 + ...ject using relative paths with json api.js | 107 + ... relative paths with jsonSourceFile api.js | 106 + ...udes after a subdirectory with json api.js | 114 ++ ... a subdirectory with jsonSourceFile api.js | 116 ++ ...xcludes immediately after with json api.js | 114 ++ ...mediately after with jsonSourceFile api.js | 116 ++ .../matchFiles/in excludes with json api.js | 111 + .../in excludes with jsonSourceFile api.js | 110 + ...iling recursive directory with json api.js | 107 + ...rsive directory with jsonSourceFile api.js | 106 + ...udes after a subdirectory with json api.js | 102 + ... a subdirectory with jsonSourceFile api.js | 104 + ...ncludes immediately after with json api.js | 102 + ...mediately after with jsonSourceFile api.js | 104 + ...ursive directory patterns with json api.js | 108 + ...ectory patterns with jsonSourceFile api.js | 107 + ...iling recursive directory with json api.js | 102 + ...rsive directory with jsonSourceFile api.js | 104 + ...s files when allowJs=true with json api.js | 112 + ...en allowJs=true with jsonSourceFile api.js | 111 + ...s files when allowJs=true with json api.js | 112 + ...en allowJs=true with jsonSourceFile api.js | 111 + ...les with .. in their name with json api.js | 108 + .... in their name with jsonSourceFile api.js | 107 + ...ject using relative paths with json api.js | 112 + ... relative paths with jsonSourceFile api.js | 111 + ...hs outside of the project with json api.js | 110 + ... of the project with jsonSourceFile api.js | 109 + ...hen in alphabetical order with json api.js | 115 ++ ...habetical order with jsonSourceFile api.js | 114 ++ ...g files are still present with json api.js | 105 + ...e still present with jsonSourceFile api.js | 104 + ...s only a single character with json api.js | 105 + ...ingle character with jsonSourceFile api.js | 104 + ...declarations are excluded with json api.js | 106 + ...ns are excluded with jsonSourceFile api.js | 105 + ...tar matches only ts files with json api.js | 106 + ...s only ts files with jsonSourceFile api.js | 105 + ...e not explicitly included with json api.js | 63 + ...icitly included with jsonSourceFile api.js | 62 + ...d directories are present with json api.js | 34 + ...ies are present with jsonSourceFile api.js | 32 + ...th case sensitive exclude with json api.js | 101 + ...nsitive exclude with jsonSourceFile api.js | 100 + ...folders and empty exclude with json api.js | 69 + ...d empty exclude with jsonSourceFile api.js | 68 + ...ge folders and exclusions with json api.js | 75 + ... and exclusions with jsonSourceFile api.js | 74 + ...folders and no exclusions with json api.js | 69 + ...d no exclusions with jsonSourceFile api.js | 68 + .../matchFiles/with defaults with json api.js | 54 + .../with defaults with jsonSourceFile api.js | 52 + ...h jsx=none, allowJs=false with json api.js | 71 + ..., allowJs=false with jsonSourceFile api.js | 70 + ...th jsx=none, allowJs=true with json api.js | 73 + ...e, allowJs=true with jsonSourceFile api.js | 72 + ...x=preserve, allowJs=false with json api.js | 74 + ..., allowJs=false with jsonSourceFile api.js | 73 + ...sx=preserve, allowJs=true with json api.js | 76 + ...e, allowJs=true with jsonSourceFile api.js | 75 + ...act-native, allowJs=false with json api.js | 74 + ..., allowJs=false with jsonSourceFile api.js | 73 + ...eact-native, allowJs=true with json api.js | 76 + ...e, allowJs=true with jsonSourceFile api.js | 75 + .../with literal excludes with json api.js | 110 + ...iteral excludes with jsonSourceFile api.js | 109 + ...with literal include list with json api.js | 103 + ...al include list with jsonSourceFile api.js | 102 + ...ith wildcard include list with json api.js | 103 + ...rd include list with jsonSourceFile api.js | 102 + ...ple recursive directories with json api.js | 111 + ...ive directories with jsonSourceFile api.js | 110 + ...e extensions are excluded with json api.js | 103 + ...ns are excluded with jsonSourceFile api.js | 102 + .../with recursive directory with json api.js | 107 + ...rsive directory with jsonSourceFile api.js | 106 + .../with recursive excludes with json api.js | 120 ++ ...ursive excludes with jsonSourceFile api.js | 119 ++ ...ds that match directories with json api.js | 62 + ...tch directories with jsonSourceFile api.js | 61 + ...dcards that match nothing with json api.js | 63 + ...t match nothing with jsonSourceFile api.js | 62 + ...itly exclude dotted files with json api.js | 62 + ...de dotted files with jsonSourceFile api.js | 61 + .../with wildcard excludes with json api.js | 123 ++ ...ldcard excludes with jsonSourceFile api.js | 122 ++ ...ns with literal file list with json api.js | 105 + ...teral file list with jsonSourceFile api.js | 104 + ...with literal include list with json api.js | 105 + ...al include list with jsonSourceFile api.js | 104 + .../without wildcards with json api.js | 60 + ...thout wildcards with jsonSourceFile api.js | 59 + ...when explicitly requested with json api.js | 24 + ...citly requested with jsonSourceFile api.js | 24 + ...ly in directory seperator with json api.js | 8 + ...ctory seperator with jsonSourceFile api.js | 8 + ...e references are provided with json api.js | 16 + ...es are provided with jsonSourceFile api.js | 16 + ...tionDir unless overridden with json api.js | 42 + ...less overridden with jsonSourceFile api.js | 42 + ... outDir unless overridden with json api.js | 42 + ...less overridden with jsonSourceFile api.js | 42 + ...rectory with no .ts files with json api.js | 15 + ...th no .ts files with jsonSourceFile api.js | 15 + ...rrors for empty directory with json api.js | 15 + ...empty directory with jsonSourceFile api.js | 15 + ...o references are provided with json api.js | 17 + ...es are provided with jsonSourceFile api.js | 20 + ...rors for empty files list with json api.js | 16 + ...mpty files list with jsonSourceFile api.js | 19 + ... errors for empty include with json api.js | 16 + ...r empty include with jsonSourceFile api.js | 16 + ... for includes with outDir with json api.js | 19 + ...des with outDir with jsonSourceFile api.js | 19 + ...ent in tsconfig with jsonSourceFile api.js | 55 + ... when files is not string with json api.js | 14 + ...s is not string with jsonSourceFile api.js | 17 + ...hen include is not string with json api.js | 15 + ...e is not string with jsonSourceFile api.js | 18 + ...aracters in strings correctly jsonParse.js | 29 + ... dotted files and folders with json api.js | 22 + ...les and folders with jsonSourceFile api.js | 22 + ...de common package folders with json api.js | 25 + ...package folders with jsonSourceFile api.js | 25 + ...eeps string content untouched jsonParse.js | 29 + ...mit tsconfig.json file with diagnostics.js | 28 + ...ent directories have dots with json api.js | 8 + ...ories have dots with jsonSourceFile api.js | 8 + ...onfig object without comments jsonParse.js | 33 + ...g for file with comments only jsonParse.js | 13 + ...or file with only whitespaces jsonParse.js | 13 + ...g when config is empty object jsonParse.js | 6 + ...en tsconfig have excludes with json api.js | 24 + ...g have excludes with jsonSourceFile api.js | 27 + ...ers correctly specify library jsonParse.js | 34 + ...th error when json is invalid jsonParse.js | 10 + .../different options with json api.js | 148 +- ...fferent options with jsonSourceFile api.js | 132 +- ...hOptions specified option with json api.js | 18 +- ...pecified option with jsonSourceFile api.js | 15 +- ...hOptions specified option with json api.js | 15 +- ...pecified option with jsonSourceFile api.js | 13 +- ...g passed in watch options with json api.js | 33 +- ...n watch options with jsonSourceFile api.js | 28 +- ...ig file with watchOptions with json api.js | 42 +- ...th watchOptions with jsonSourceFile api.js | 36 +- ...file without watchOptions with json api.js | 42 +- ...ut watchOptions with jsonSourceFile api.js | 36 +- .../default-setup-was-created-correctly.js | 111 + ...ve-composite-if-its-a-container-project.js | 72 + ...snt-infer-the-rootDir-from-source-paths.js | 97 + ...rors-when-a-file-is-outside-the-rootdir.js | 139 ++ ...ed-project-reference-doesnt-set-outFile.js | 122 ++ ...d-project-reference-output-doesnt-exist.js | 139 ++ .../errors-when-declaration-=-false.js | 101 + ...rs-when-the-file-list-is-not-exhaustive.js | 137 ++ ...hen-the-referenced-project-doesnt-exist.js | 107 + ...eferenced-project-doesnt-have-composite.js | 122 ++ ...g-when-module-reference-is-not-relative.js | 137 ++ ...ce-error-when-the-input-file-is-missing.js | 131 ++ .../redirects-to-the-output-dts-file.js | 156 ++ 285 files changed, 20659 insertions(+), 3413 deletions(-) create mode 100644 src/testRunner/unittests/config/helpers.ts delete mode 100644 src/testRunner/unittests/config/projectReferences.ts create mode 100644 src/testRunner/unittests/tsc/projectReferencesConfig.ts create mode 100644 tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case insensitive host.js create mode 100644 tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case sensitive host.js create mode 100644 tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case insensitive host.js create mode 100644 tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case sensitive host.js create mode 100644 tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js create mode 100644 tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js create mode 100644 tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Allow trailing comments with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file as an array with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray leading characters with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray trailing characters with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with json api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert tsconfig options when there are multiple invalid strings with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/Don't crash when root expression is not object at all with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/does not raise an error if you've set a compiler flag in the root when you have included 'compilerOptions' with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertCompilerOptionsFromJson/raises an error if you've set a compiler flag in the root without including compilerOptions with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert correctly format tsconfig.json to typeAcquisition with json api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert correctly format tsconfig.json to typeAcquisition with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default jsconfig.json to typeAcquisition with json api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default jsconfig.json to typeAcquisition with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default tsconfig.json to typeAcquisition with json api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default tsconfig.json to typeAcquisition with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format jsconfig.json to typeAcquisition with json api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format tsconfig.json to typeAcquisition with json api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json to typeAcquisition with json api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json to typeAcquisition with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json with only enable property to typeAcquisition with json api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert tsconfig.json with only enable property to typeAcquisition with json api.js create mode 100644 tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert tsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/Expands z to z/starstart/star with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/Expands z to z/starstart/star with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/always include literal files with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/always include literal files with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/and empty exclude with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/and empty exclude with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/and exclusions with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/and exclusions with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/and explicit recursive include with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/and explicit recursive include with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/and explicit wildcard include with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/and explicit wildcard include with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/and no exclusions with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/and no exclusions with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/and wildcard include with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/and wildcard include with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/are not removed due to excludes with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/are not removed due to excludes with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/can exclude dirs whose pattern starts with starstar with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/can exclude dirs whose pattern starts with starstar with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/can include dirs whose pattern starts with starstart with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/can include dirs whose pattern starts with starstart with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case insensitive with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case insensitive with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case sensitive with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case sensitive with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/case sensitive with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/case sensitive with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/exclude .js files when allowJs=false with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/exclude .js files when allowJs=false with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/exclude .min.js files using wildcards with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/exclude .min.js files using wildcards with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/exclude files with .. in their name with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/exclude files with .. in their name with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/exclude folders with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/exclude folders with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/exclude paths outside of the project using relative paths with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/exclude paths outside of the project using relative paths with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/in excludes after a subdirectory with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/in excludes after a subdirectory with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/in excludes immediately after with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/in excludes immediately after with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/in excludes with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/in excludes with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/in excludes with trailing recursive directory with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/in excludes with trailing recursive directory with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/in includes after a subdirectory with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/in includes after a subdirectory with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/in includes immediately after with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/in includes immediately after with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/in includes with multiple recursive directory patterns with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/in includes with multiple recursive directory patterns with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/in includes with trailing recursive directory with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/in includes with trailing recursive directory with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/include .js files when allowJs=true with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/include .js files when allowJs=true with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/include explicitly listed .min.js files when allowJs=true with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/include explicitly listed .min.js files when allowJs=true with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/include files with .. in their name with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/include files with .. in their name with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/include paths outside of the project using relative paths with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/include paths outside of the project using relative paths with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/include paths outside of the project with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/include paths outside of the project with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/is sorted in include order, then in alphabetical order with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/is sorted in include order, then in alphabetical order with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/missing files are still present with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/missing files are still present with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/question matches only a single character with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/question matches only a single character with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/same named declarations are excluded with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/same named declarations are excluded with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/star matches only ts files with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/star matches only ts files with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/that are not explicitly included with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/that are not explicitly included with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/when recursive symlinked directories are present with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/when recursive symlinked directories are present with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with case sensitive exclude with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with case sensitive exclude with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with common package folders and empty exclude with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with common package folders and empty exclude with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with common package folders and exclusions with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with common package folders and exclusions with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with common package folders and no exclusions with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with common package folders and no exclusions with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with defaults with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with defaults with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=false with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=false with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=true with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=true with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=false with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=false with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=true with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=true with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=false with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=false with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=true with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=true with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with literal excludes with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with literal excludes with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with missing files are excluded with literal include list with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with missing files are excluded with literal include list with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with missing files are excluded with wildcard include list with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with missing files are excluded with wildcard include list with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with multiple recursive directories with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with multiple recursive directories with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with non .ts file extensions are excluded with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with non .ts file extensions are excluded with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with recursive directory with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with recursive directory with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with recursive excludes with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with recursive excludes with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with recursive wildcards that match directories with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with recursive wildcards that match directories with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with recursive wildcards that match nothing with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with recursive wildcards that match nothing with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with wildcard excludes that implicitly exclude dotted files with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with wildcard excludes that implicitly exclude dotted files with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/with wildcard excludes with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/with wildcard excludes with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/without exclusions with literal file list with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/without exclusions with literal file list with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/without exclusions with literal include list with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/without exclusions with literal include list with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/matchFiles/without wildcards with json api.js create mode 100644 tests/baselines/reference/config/matchFiles/without wildcards with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/correctly parses wild card directories from implicit glob when two keys differ only in directory seperator with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/correctly parses wild card directories from implicit glob when two keys differ only in directory seperator with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors for when invalid comment type present in tsconfig with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/handles escaped characters in strings correctly jsonParse.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/keeps string content untouched jsonParse.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/parse and re-emit tsconfig.json file with diagnostics.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/parses wildcard directories even when parent directories have dots with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/parses wildcard directories even when parent directories have dots with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/returns config object without comments jsonParse.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/returns empty config for file with comments only jsonParse.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/returns empty config for file with only whitespaces jsonParse.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/returns empty config when config is empty object jsonParse.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/returns object when users correctly specify library jsonParse.js create mode 100644 tests/baselines/reference/config/tsconfigParsing/returns object with error when json is invalid jsonParse.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/default-setup-was-created-correctly.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/does-not-error-when-the-referenced-project-doesnt-have-composite-if-its-a-container-project.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/doesnt-infer-the-rootDir-from-source-paths.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-file-is-outside-the-rootdir.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-prepended-project-reference-doesnt-set-outFile.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-prepended-project-reference-output-doesnt-exist.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-file-list-is-not-exhaustive.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/issues-a-nice-error-when-the-input-file-is-missing.js create mode 100644 tests/baselines/reference/tsc/projectReferencesConfig/redirects-to-the-output-dts-file.js diff --git a/src/testRunner/tests.ts b/src/testRunner/tests.ts index c95ca207db5..b658c72e1fe 100644 --- a/src/testRunner/tests.ts +++ b/src/testRunner/tests.ts @@ -25,7 +25,6 @@ import "./unittests/config/convertCompilerOptionsFromJson"; import "./unittests/config/convertTypeAcquisitionFromJson"; import "./unittests/config/initializeTSConfig"; import "./unittests/config/matchFiles"; -import "./unittests/config/projectReferences"; import "./unittests/config/showConfig"; import "./unittests/config/tsconfigParsing"; import "./unittests/config/tsconfigParsingWatchOptions"; @@ -106,6 +105,7 @@ import "./unittests/tsc/forceConsistentCasingInFileNames"; import "./unittests/tsc/incremental"; import "./unittests/tsc/listFilesOnly"; import "./unittests/tsc/projectReferences"; +import "./unittests/tsc/projectReferencesConfig"; import "./unittests/tsc/redirect"; import "./unittests/tsc/runWithoutArgs"; import "./unittests/tscWatch/consoleClearing"; diff --git a/src/testRunner/unittests/config/configurationExtension.ts b/src/testRunner/unittests/config/configurationExtension.ts index 8fbc2202b46..6fe41598345 100644 --- a/src/testRunner/unittests/config/configurationExtension.ts +++ b/src/testRunner/unittests/config/configurationExtension.ts @@ -1,6 +1,8 @@ import * as fakes from "../../_namespaces/fakes"; +import * as Harness from "../../_namespaces/Harness"; import * as ts from "../../_namespaces/ts"; import * as vfs from "../../_namespaces/vfs"; +import { baselineParseConfig, baselineParseConfigHost } from "./helpers"; function createFileSystem(ignoreCase: boolean, cwd: string, root: string) { return new vfs.FileSystem(ignoreCase, { @@ -207,46 +209,46 @@ function createFileSystem(ignoreCase: boolean, cwd: string, root: string) { "dev/tests/utils.ts": "", "dev/tests/scenarios/first.json": "", "dev/tests/baselines/first/output.ts": "", - "dev/configs/extendsArrayFirst.json": JSON.stringify({ - compilerOptions: { - allowJs: true, - noImplicitAny: true, - strictNullChecks: true - } - }), - "dev/configs/extendsArraySecond.json": JSON.stringify({ - compilerOptions: { - module: "amd" - }, - include: ["../supplemental.*"] - }), - "dev/configs/extendsArrayThird.json": JSON.stringify({ - compilerOptions: { - module: null, // eslint-disable-line no-null/no-null - noImplicitAny: false - }, - extends: "./extendsArrayFirst", - include: ["../supplemental.*"] - }), - "dev/configs/extendsArrayFourth.json": JSON.stringify({ - compilerOptions: { - module: "system", - strictNullChecks: false - }, - include: null, // eslint-disable-line no-null/no-null - files: ["../main.ts"] - }), - "dev/configs/extendsArrayFifth.json": JSON.stringify({ - extends: ["./extendsArrayFirst", "./extendsArraySecond", "./extendsArrayThird", "./extendsArrayFourth"], - files: [], - }), - "dev/extendsArrayFails.json": JSON.stringify({ - extends: ["./missingFile"], - compilerOptions: { - types: [] - } - }), - "dev/extendsArrayFails2.json": JSON.stringify({ extends: [42] }), + "dev/configs/extendsArrayFirst.json": JSON.stringify({ + compilerOptions: { + allowJs: true, + noImplicitAny: true, + strictNullChecks: true + } + }), + "dev/configs/extendsArraySecond.json": JSON.stringify({ + compilerOptions: { + module: "amd" + }, + include: ["../supplemental.*"] + }), + "dev/configs/extendsArrayThird.json": JSON.stringify({ + compilerOptions: { + module: null, // eslint-disable-line no-null/no-null + noImplicitAny: false + }, + extends: "./extendsArrayFirst", + include: ["../supplemental.*"] + }), + "dev/configs/extendsArrayFourth.json": JSON.stringify({ + compilerOptions: { + module: "system", + strictNullChecks: false + }, + include: null, // eslint-disable-line no-null/no-null + files: ["../main.ts"] + }), + "dev/configs/extendsArrayFifth.json": JSON.stringify({ + extends: ["./extendsArrayFirst", "./extendsArraySecond", "./extendsArrayThird", "./extendsArrayFourth"], + files: [], + }), + "dev/extendsArrayFails.json": JSON.stringify({ + extends: ["./missingFile"], + compilerOptions: { + types: [] + } + }), + "dev/extendsArrayFails2.json": JSON.stringify({ extends: [42] }), } } }); @@ -258,205 +260,78 @@ const caseInsensitiveHost = new fakes.ParseConfigHost(createFileSystem(/*ignoreC const caseSensitiveBasePath = "/dev/"; const caseSensitiveHost = new fakes.ParseConfigHost(createFileSystem(/*ignoreCase*/ false, caseSensitiveBasePath, "/")); -function verifyDiagnostics(actual: ts.Diagnostic[], expected: { code: number; messageText: string; }[]) { - assert.isTrue(expected.length === actual.length, `Expected error: ${JSON.stringify(expected)}. Actual error: ${JSON.stringify(actual)}.`); - for (let i = 0; i < actual.length; i++) { - const actualError = actual[i]; - const expectedError = expected[i]; - assert.equal(actualError.code, expectedError.code, "Error code mismatch"); - assert.equal(actualError.category, ts.DiagnosticCategory.Error, "Category mismatch"); // Should always be error - assert.equal(ts.flattenDiagnosticMessageText(actualError.messageText, "\n"), expectedError.messageText); - } -} - describe("unittests:: config:: configurationExtension", () => { ts.forEach<[string, string, fakes.ParseConfigHost], void>([ ["under a case insensitive host", caseInsensitiveBasePath, caseInsensitiveHost], ["under a case sensitive host", caseSensitiveBasePath, caseSensitiveHost] ], ([testName, basePath, host]) => { - function getParseCommandLine(entry: string) { - const {config, error} = ts.readConfigFile(entry, name => host.readFile(name)); - assert(config && !error, ts.flattenDiagnosticMessageText(error && error.messageText, "\n")); - return ts.parseJsonConfigFileContent(config, host, basePath, {}, entry); + const nameAndEntry: [name: string, entry: string][] = []; + function baselineParsedCommandLine(name: string, entry: string) { + nameAndEntry.push([name, entry]); } - function getParseCommandLineJsonSourceFile(entry: string) { - const jsonSourceFile = ts.readJsonConfigFile(entry, name => host.readFile(name)); - assert(jsonSourceFile.endOfFileToken && !jsonSourceFile.parseDiagnostics.length, ts.flattenDiagnosticMessageText(jsonSourceFile.parseDiagnostics[0] && jsonSourceFile.parseDiagnostics[0].messageText, "\n")); - return { - jsonSourceFile, - parsed: ts.parseJsonSourceFileConfigFileContent(jsonSourceFile, host, basePath, {}, entry) - }; - } + baselineParsedCommandLine("can resolve an extension with a base extension", "tsconfig.json"); + baselineParsedCommandLine("can resolve an extension with a base extension that overrides options", "tsconfig.nostrictnull.json"); + baselineParsedCommandLine("can report errors on circular imports", "circular.json"); + baselineParsedCommandLine("can report missing configurations", "missing.json"); + baselineParsedCommandLine("can report errors in extended configs", "failure.json"); + baselineParsedCommandLine("can error when 'extends' is not a string or Array", "extends.json"); + baselineParsedCommandLine("can error when 'extends' is given an empty string", "extends3.json"); + baselineParsedCommandLine("can error when 'extends' is given an empty string in an array", "extends4.json"); + baselineParsedCommandLine("can overwrite compiler options using extended 'null'", "configs/third.json"); + baselineParsedCommandLine("can overwrite top-level options using extended 'null'", "configs/fourth.json"); + baselineParsedCommandLine("can overwrite top-level files using extended []", "configs/fifth.json"); + baselineParsedCommandLine("can lookup via tsconfig field", "tsconfig.extendsBox.json"); + baselineParsedCommandLine("can lookup via package-relative path", "tsconfig.extendsStrict.json"); + baselineParsedCommandLine("can lookup via non-redirected-to package-relative path", "tsconfig.extendsUnStrict.json"); + baselineParsedCommandLine("can lookup via package-relative path with extension", "tsconfig.extendsStrictExtension.json"); + baselineParsedCommandLine("can lookup via an implicit tsconfig", "tsconfig.extendsBoxImplied.json"); + baselineParsedCommandLine("can lookup via an implicit tsconfig in a package-relative directory", "tsconfig.extendsBoxImpliedUnstrict.json"); + baselineParsedCommandLine("can lookup via an implicit tsconfig in a package-relative directory with name", "tsconfig.extendsBoxImpliedUnstrictExtension.json"); + baselineParsedCommandLine("can lookup via an implicit tsconfig in a package-relative directory with extension", "tsconfig.extendsBoxImpliedPath.json"); + baselineParsedCommandLine("can lookup via an package.json exports", "tsconfig.extendsFoo.json"); - function testSuccess(name: string, entry: string, expected: ts.CompilerOptions, expectedFiles: string[]) { - expected.configFilePath = entry; - it(name, () => { - const parsed = getParseCommandLine(entry); - assert(!parsed.errors.length, ts.flattenDiagnosticMessageText(parsed.errors[0] && parsed.errors[0].messageText, "\n")); - assert.deepEqual(parsed.options, expected); - assert.deepEqual(parsed.fileNames, expectedFiles); - }); + baselineExtendsSourceFile("adds extendedSourceFiles only once", "configs/fourth.json"); + baselineExtendsSourceFile("adds extendedSourceFiles from an array only once", "configs/extendsArrayFifth.json"); - it(name + " with jsonSourceFile", () => { - const { parsed, jsonSourceFile } = getParseCommandLineJsonSourceFile(entry); - assert(!parsed.errors.length, ts.flattenDiagnosticMessageText(parsed.errors[0] && parsed.errors[0].messageText, "\n")); - assert.deepEqual(parsed.options, expected); - assert.equal(parsed.options.configFile, jsonSourceFile); - assert.deepEqual(parsed.fileNames, expectedFiles); - }); - } + baselineParsedCommandLine("can overwrite top-level compilerOptions", "configs/extendsArrayFifth.json"); + baselineParsedCommandLine("can report missing configurations", "extendsArrayFails.json"); + baselineParsedCommandLine("can error when 'extends' is not a string or Array2", "extendsArrayFails2.json"); - function testFailure(name: string, entry: string, expectedDiagnostics: { code: number; messageText: string; }[]) { - it(name, () => { - const parsed = getParseCommandLine(entry); - verifyDiagnostics(parsed.errors, expectedDiagnostics); - }); - - it(name + " with jsonSourceFile", () => { - const { parsed } = getParseCommandLineJsonSourceFile(entry); - verifyDiagnostics(parsed.errors, expectedDiagnostics); - }); - } - - describe(testName, () => { - testSuccess("can resolve an extension with a base extension", "tsconfig.json", { - allowJs: true, - noImplicitAny: true, - strictNullChecks: true, - }, [ - ts.combinePaths(basePath, "main.ts"), - ts.combinePaths(basePath, "supplemental.ts"), - ]); - - testSuccess("can resolve an extension with a base extension that overrides options", "tsconfig.nostrictnull.json", { - allowJs: true, - noImplicitAny: true, - strictNullChecks: false, - }, [ - ts.combinePaths(basePath, "main.ts"), - ts.combinePaths(basePath, "supplemental.ts"), - ]); - - testFailure("can report errors on circular imports", "circular.json", [ - { - code: 18000, - messageText: `Circularity detected while resolving configuration: ${[ts.combinePaths(basePath, "circular.json"), ts.combinePaths(basePath, "circular2.json"), ts.combinePaths(basePath, "circular.json")].join(" -> ")}` - } - ]); - - testFailure("can report missing configurations", "missing.json", [{ - code: 6053, - messageText: `File './missing2' not found.` - }]); - - testFailure("can report errors in extended configs", "failure.json", [{ - code: 6114, - messageText: `Unknown option 'excludes'. Did you mean 'exclude'?` - }]); - - testFailure("can error when 'extends' is not a string or Array", "extends.json", [{ - code: 5024, - messageText: `Compiler option 'extends' requires a value of type string or Array.` - }]); - - testFailure("can error when 'extends' is given an empty string", "extends3.json", [{ - code: 18051, - messageText: `Compiler option 'extends' cannot be given an empty string.` - }]); - - testFailure("can error when 'extends' is given an empty string in an array", "extends4.json", [{ - code: 18051, - messageText: `Compiler option 'extends' cannot be given an empty string.` - }]); - - testSuccess("can overwrite compiler options using extended 'null'", "configs/third.json", { - allowJs: true, - noImplicitAny: true, - strictNullChecks: true, - module: undefined // Technically, this is distinct from the key never being set; but within the compiler we don't make the distinction - }, [ - ts.combinePaths(basePath, "supplemental.ts") - ]); - - testSuccess("can overwrite top-level options using extended 'null'", "configs/fourth.json", { - allowJs: true, - noImplicitAny: true, - strictNullChecks: true, - module: ts.ModuleKind.System - }, [ - ts.combinePaths(basePath, "main.ts") - ]); - - testSuccess("can overwrite top-level files using extended []", "configs/fifth.json", { - allowJs: true, - noImplicitAny: true, - strictNullChecks: true, - module: ts.ModuleKind.System - }, [ - ts.combinePaths(basePath, "tests/utils.ts") - ]); - - describe("finding extended configs from node_modules", () => { - testSuccess("can lookup via tsconfig field", "tsconfig.extendsBox.json", { strict: true }, [ts.combinePaths(basePath, "main.ts")]); - testSuccess("can lookup via package-relative path", "tsconfig.extendsStrict.json", { strict: true }, [ts.combinePaths(basePath, "main.ts")]); - testSuccess("can lookup via non-redirected-to package-relative path", "tsconfig.extendsUnStrict.json", { strict: false }, [ts.combinePaths(basePath, "main.ts")]); - testSuccess("can lookup via package-relative path with extension", "tsconfig.extendsStrictExtension.json", { strict: true }, [ts.combinePaths(basePath, "main.ts")]); - testSuccess("can lookup via an implicit tsconfig", "tsconfig.extendsBoxImplied.json", { strict: true }, [ts.combinePaths(basePath, "main.ts")]); - testSuccess("can lookup via an implicit tsconfig in a package-relative directory", "tsconfig.extendsBoxImpliedUnstrict.json", { strict: false }, [ts.combinePaths(basePath, "main.ts")]); - testSuccess("can lookup via an implicit tsconfig in a package-relative directory with name", "tsconfig.extendsBoxImpliedUnstrictExtension.json", { strict: false }, [ts.combinePaths(basePath, "main.ts")]); - testSuccess("can lookup via an implicit tsconfig in a package-relative directory with extension", "tsconfig.extendsBoxImpliedPath.json", { strict: true }, [ts.combinePaths(basePath, "main.ts")]); - testSuccess("can lookup via an package.json exports", "tsconfig.extendsFoo.json", { strict: true }, [ts.combinePaths(basePath, "main.ts")]); - }); - - it("adds extendedSourceFiles only once", () => { - const sourceFile = ts.readJsonConfigFile("configs/fourth.json", (path) => host.readFile(path)); - const dir = ts.combinePaths(basePath, "configs"); - const expected = [ - ts.combinePaths(dir, "third.json"), - ts.combinePaths(dir, "second.json"), - ts.combinePaths(dir, "base.json"), - ]; - ts.parseJsonSourceFileConfigFileContent(sourceFile, host, dir, {}, "fourth.json"); - assert.deepEqual(sourceFile.extendedSourceFiles, expected); - ts.parseJsonSourceFileConfigFileContent(sourceFile, host, dir, {}, "fourth.json"); - assert.deepEqual(sourceFile.extendedSourceFiles, expected); - }); + baselineParseConfig({ + scenario: "configurationExtension", + subScenario: testName, + input: () => nameAndEntry.map(([name, entry]) => ({ + createHost: baseline => { + baseline.push(name); + return host; + }, + jsonText: host.readFile(entry)!, + configFileName: entry, + baselineParsed: (baseline, parsed) => { + baseline.push("CompilerOptions::"); + baseline.push(JSON.stringify(parsed.options, undefined, " ")); + baseline.push("FileNames::"); + baseline.push(parsed.fileNames.join()); + }, + })), + skipFs: true, + header: baseline => baselineParseConfigHost(baseline, host), }); - describe(testName, () => { - it("adds extendedSourceFiles from an array only once", () => { - const sourceFile = ts.readJsonConfigFile("configs/extendsArrayFifth.json", (path) => host.readFile(path)); + function baselineExtendsSourceFile(name: string, entry: string) { + it(name, () => { + const baseline: string[] = []; + baselineParseConfigHost(baseline, host); + baseline.push(`configFileName:: ${name}`); + const sourceFile = ts.readJsonConfigFile(entry, (path) => host.readFile(path)); const dir = ts.combinePaths(basePath, "configs"); - const expected = [ - ts.combinePaths(dir, "extendsArrayFirst.json"), - ts.combinePaths(dir, "extendsArraySecond.json"), - ts.combinePaths(dir, "extendsArrayThird.json"), - ts.combinePaths(dir, "extendsArrayFourth.json"), - ]; - ts.parseJsonSourceFileConfigFileContent(sourceFile, host, dir, {}, "extendsArrayFifth.json"); - assert.deepEqual(sourceFile.extendedSourceFiles, expected); - ts.parseJsonSourceFileConfigFileContent(sourceFile, host, dir, {}, "extendsArrayFifth.json"); - assert.deepEqual(sourceFile.extendedSourceFiles, expected); + ts.parseJsonSourceFileConfigFileContent(sourceFile, host, dir, {}, ts.getBaseFileName(entry)); + baseline.push("ExtendedSourceFiles::", ...sourceFile.extendedSourceFiles!); + ts.parseJsonSourceFileConfigFileContent(sourceFile, host, dir, {}, ts.getBaseFileName(entry)); + baseline.push("After reusing sourceFile ExtendedSourceFiles::", ...sourceFile.extendedSourceFiles!); + Harness.Baseline.runBaseline(`config/configurationExtension/${name} ${testName}.js`, baseline.join("\n")); }); - - testSuccess("can overwrite top-level compilerOptions", "configs/extendsArrayFifth.json", { - allowJs: true, - noImplicitAny: false, - strictNullChecks: false, - module: ts.ModuleKind.System - }, []); - - testFailure("can report missing configurations", "extendsArrayFails.json", [{ - code: 6053, - messageText: `File './missingFile' not found.` - }]); - - testFailure("can error when 'extends' is not a string or Array2", "extendsArrayFails2.json", [{ - code: 5024, - messageText: `Compiler option 'extends' requires a value of type string.` - }]); - }); + } }); }); - diff --git a/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts b/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts index 1a994f0384a..d636d07c4e4 100644 --- a/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts +++ b/src/testRunner/unittests/config/convertCompilerOptionsFromJson.ts @@ -1,646 +1,228 @@ import * as fakes from "../../_namespaces/fakes"; -import * as ts from "../../_namespaces/ts"; import * as vfs from "../../_namespaces/vfs"; +import { baselineParseConfig } from "./helpers"; describe("unittests:: config:: convertCompilerOptionsFromJson", () => { - const formatDiagnosticHost: ts.FormatDiagnosticsHost = { - getCurrentDirectory: () => "/apath/", - getCanonicalFileName: ts.createGetCanonicalFileName(/*useCaseSensitiveFileNames*/ true), - getNewLine: () => "\n" - }; - - interface ExpectedResultWithParsingSuccess { - compilerOptions: ts.CompilerOptions; - errors: readonly ts.Diagnostic[]; + function baselineCompilerOptions(subScenario: string, json: any, configFileName: string) { + baselineCompilerOptionsJsonText( + subScenario, + JSON.stringify(json, undefined, " "), + configFileName, + /*skipJson*/ false, + ); } - interface ExpectedResultWithParsingFailure { - compilerOptions: ts.CompilerOptions; - hasParseErrors: true; - } - - type ExpectedResult = ExpectedResultWithParsingSuccess | ExpectedResultWithParsingFailure; - - function isExpectedResultWithParsingFailure(expectedResult: ExpectedResult): expectedResult is ExpectedResultWithParsingFailure { - return !!(expectedResult as ExpectedResultWithParsingFailure).hasParseErrors; - } - - function assertCompilerOptions(json: any, configFileName: string, expectedResult: ExpectedResultWithParsingSuccess) { - assertCompilerOptionsWithJson(json, configFileName, expectedResult); - assertCompilerOptionsWithJsonNode(json, configFileName, expectedResult); - } - - function assertCompilerOptionsWithJson(json: any, configFileName: string, expectedResult: ExpectedResultWithParsingSuccess) { - const { options: actualCompilerOptions, errors: actualErrors } = ts.convertCompilerOptionsFromJson(json.compilerOptions, "/apath/", configFileName); - - const parsedCompilerOptions = JSON.stringify(actualCompilerOptions); - const expectedCompilerOptions = JSON.stringify({ ...expectedResult.compilerOptions, configFilePath: configFileName }); - assert.equal(parsedCompilerOptions, expectedCompilerOptions); - - verifyErrors(actualErrors, expectedResult.errors, /*ignoreLocation*/ true); - } - - function assertCompilerOptionsWithJsonNode(json: any, configFileName: string, expectedResult: ExpectedResultWithParsingSuccess) { - assertCompilerOptionsWithJsonText(JSON.stringify(json), configFileName, expectedResult); - } - - function assertCompilerOptionsWithJsonText(fileText: string, configFileName: string, expectedResult: ExpectedResult) { - const result = ts.parseJsonText(configFileName, fileText); - assert(!!result.endOfFileToken); - assert.equal(!!result.parseDiagnostics.length, isExpectedResultWithParsingFailure(expectedResult)); - const host: ts.ParseConfigHost = new fakes.ParseConfigHost(new vfs.FileSystem(/*ignoreCase*/ false, { cwd: "/apath/" })); - const { options: actualCompilerOptions, errors: actualParseErrors } = ts.parseJsonSourceFileConfigFileContent(result, host, "/apath/", /*existingOptions*/ undefined, configFileName); - expectedResult.compilerOptions.configFilePath = configFileName; - - const parsedCompilerOptions = JSON.stringify(actualCompilerOptions); - const expectedCompilerOptions = JSON.stringify(expectedResult.compilerOptions); - assert.equal(parsedCompilerOptions, expectedCompilerOptions); - assert.equal(actualCompilerOptions.configFile, result); - - if (!isExpectedResultWithParsingFailure(expectedResult)) { - verifyErrors(actualParseErrors.filter(error => error.code !== ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code), expectedResult.errors); - } - } - - function verifyErrors(actualErrors: ts.Diagnostic[], expectedErrors: readonly ts.Diagnostic[], ignoreLocation?: boolean) { - assert.isTrue(expectedErrors.length === actualErrors.length, `Expected error: ${JSON.stringify(expectedErrors.map(getDiagnosticString), undefined, " ")}. Actual error: ${JSON.stringify(actualErrors.map(getDiagnosticString), undefined, " ")}.`); - for (let i = 0; i < actualErrors.length; i++) { - const actualError = actualErrors[i]; - const expectedError = expectedErrors[i]; - - assert.equal(actualError.code, expectedError.code, `Expected error-code: ${JSON.stringify(expectedError.code)}. Actual error-code: ${JSON.stringify(actualError.code)}.`); - assert.equal(actualError.category, expectedError.category, `Expected error-category: ${JSON.stringify(expectedError.category)}. Actual error-category: ${JSON.stringify(actualError.category)}.`); - if (!ignoreLocation) { - assert(actualError.file); - assert.isDefined(actualError.start); - assert(actualError.length); - } - } - - function getDiagnosticString(diagnostic: ts.Diagnostic) { - if (ignoreLocation) { - const { file, ...rest } = diagnostic; - diagnostic = { file: undefined, ...rest }; - } - return ts.formatDiagnostic(diagnostic, formatDiagnosticHost); - } + function baselineCompilerOptionsJsonText(subScenario: string, jsonText: string, configFileName: string, skipJson = true) { + baselineParseConfig({ + scenario: "convertCompilerOptionsFromJson", + subScenario, + input: () => [{ + createHost: () => new fakes.ParseConfigHost(new vfs.FileSystem( + /*ignoreCase*/ false, + { + cwd: "/apath/", + files: { + [`/apath/${configFileName}`]: jsonText, + "/apath/a.ts": "", + "/apath/b.js": "", + } + }, + )), + jsonText, + configFileName, + basePath: "/apath", + baselineParsed: (baseline, parsed) => baseline.push("CompilerOptions::", JSON.stringify(parsed.options, undefined, " ")), + }], + skipJson, + }); } // tsconfig.json tests - it("Convert correctly format tsconfig.json to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: false, - sourceMap: false, - lib: ["es5", "es2015.core", "es2015.symbol"] - } - }, "tsconfig.json", - { - compilerOptions: { - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - lib: ["lib.es5.d.ts", "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts"] - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert correctly format tsconfig.json to compiler-options", { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: false, + sourceMap: false, + lib: ["es5", "es2015.core", "es2015.symbol"] + } + }, "tsconfig.json"); - it("Convert correctly format tsconfig.json with allowJs is false to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: false, - sourceMap: false, - allowJs: false, - lib: ["es5", "es2015.core", "es2015.symbol"] - } - }, "tsconfig.json", - { - compilerOptions: { - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - allowJs: false, - lib: ["lib.es5.d.ts", "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts"] - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert correctly format tsconfig.json with allowJs is false to compiler-options", { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: false, + sourceMap: false, + allowJs: false, + lib: ["es5", "es2015.core", "es2015.symbol"] + } + }, "tsconfig.json"); - it("Convert incorrect option of jsx to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: false, - sourceMap: false, - jsx: "" - } - }, "tsconfig.json", - { - compilerOptions: { - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - }, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Argument for '--jsx' option must be: 'preserve', 'react-native', 'react'.", - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category - }] - } - ); - }); + baselineCompilerOptions("Convert incorrect option of jsx to compiler-options", { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: false, + sourceMap: false, + jsx: "" + } + }, "tsconfig.json"); - it("Convert incorrect option of module to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "", - target: "es5", - noImplicitAny: false, - sourceMap: false, - } - }, "tsconfig.json", - { - compilerOptions: { - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - }, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext'.", - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category - }] - } - ); - }); + baselineCompilerOptions("Convert incorrect option of module to compiler-options", { + compilerOptions: { + module: "", + target: "es5", + noImplicitAny: false, + sourceMap: false, + } + }, "tsconfig.json"); - it("Convert incorrect option of newLine to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - newLine: "", - target: "es5", - noImplicitAny: false, - sourceMap: false, - } - }, "tsconfig.json", - { - compilerOptions: { - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - }, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Argument for '--newLine' option must be: 'crlf', 'lf'.", - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category - }] - } - ); - }); + baselineCompilerOptions("Convert incorrect option of newLine to compiler-options", { + compilerOptions: { + newLine: "", + target: "es5", + noImplicitAny: false, + sourceMap: false, + } + }, "tsconfig.json"); - it("Convert incorrect option of target to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - target: "", - noImplicitAny: false, - sourceMap: false, - } - }, "tsconfig.json", - { - compilerOptions: { - noImplicitAny: false, - sourceMap: false, - }, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'esnext'.", - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category - }] - } - ); - }); + baselineCompilerOptions("Convert incorrect option of target to compiler-options", { + compilerOptions: { + target: "", + noImplicitAny: false, + sourceMap: false, + } + }, "tsconfig.json"); - it("Convert incorrect option of module-resolution to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - moduleResolution: "", - noImplicitAny: false, - sourceMap: false, - } - }, "tsconfig.json", - { - compilerOptions: { - noImplicitAny: false, - sourceMap: false, - }, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Argument for '--moduleResolution' option must be: 'node', 'classic'.", - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category - }] - } - ); - }); + baselineCompilerOptions("Convert incorrect option of module-resolution to compiler-options", { + compilerOptions: { + moduleResolution: "", + noImplicitAny: false, + sourceMap: false, + } + }, "tsconfig.json"); - it("Convert incorrect option of libs to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: false, - sourceMap: false, - lib: ["es5", "es2015.core", "incorrectLib"] - } - }, "tsconfig.json", - { - compilerOptions: { - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - lib: ["lib.es5.d.ts", "lib.es2015.core.d.ts"] - }, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.symbol', 'esnext.intl', 'esnext.bigint', 'esnext.bigint', 'esnext.string', 'esnext.promise'.", - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category - }] - } - ); - }); + baselineCompilerOptions("Convert incorrect option of libs to compiler-options", { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: false, + sourceMap: false, + lib: ["es5", "es2015.core", "incorrectLib"] + } + }, "tsconfig.json"); - it("Convert empty string option of libs to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: false, - sourceMap: false, - lib: ["es5", ""] - } - }, "tsconfig.json", - { - compilerOptions: { - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - lib: ["lib.es5.d.ts"] - }, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.symbol', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise'.", - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category - }] - } - ); - }); + baselineCompilerOptions("Convert empty string option of libs to compiler-options", { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: false, + sourceMap: false, + lib: ["es5", ""] + } + }, "tsconfig.json"); - it("Convert empty string option of libs to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: false, - sourceMap: false, - lib: [""] - } - }, "tsconfig.json", - { - compilerOptions: { - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - lib: [] - }, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.symbol', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise'.", - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category - }] - } - ); - }); + baselineCompilerOptions("Convert empty string option of libs array to compiler-options", { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: false, + sourceMap: false, + lib: [""] + } + }, "tsconfig.json"); - it("Convert trailing-whitespace string option of libs to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: false, - sourceMap: false, - lib: [" "] - } - }, "tsconfig.json", - { - compilerOptions: { - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - lib: [] - }, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.symbol', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise'.", - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category - }] - } - ); - }); + baselineCompilerOptions("Convert trailing-whitespace string option of libs to compiler-options", { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: false, + sourceMap: false, + lib: [" "] + } + }, "tsconfig.json"); - it("Convert empty option of libs to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: false, - sourceMap: false, - lib: [] - } - }, "tsconfig.json", - { - compilerOptions: { - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - lib: [] - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert empty option of libs to compiler-options", { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: false, + sourceMap: false, + lib: [] + } + }, "tsconfig.json"); - it("Convert empty string option of moduleSuffixes to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - moduleSuffixes: [".ios", ""] - } - }, "tsconfig.json", - { - compilerOptions: { - moduleSuffixes: [".ios", ""] - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert empty string option of moduleSuffixes to compiler-options", { + compilerOptions: { + moduleSuffixes: [".ios", ""] + } + }, "tsconfig.json"); - it("Convert empty string option of moduleSuffixes to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - moduleSuffixes: [""] - } - }, "tsconfig.json", - { - compilerOptions: { - moduleSuffixes: [""] - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert empty string option of moduleSuffixes single to compiler-options", { + compilerOptions: { + moduleSuffixes: [""] + } + }, "tsconfig.json"); - it("Convert trailing-whitespace string option of moduleSuffixes to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - moduleSuffixes: [" "] - } - }, "tsconfig.json", - { - compilerOptions: { - moduleSuffixes: [" "] - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert trailing-whitespace string option of moduleSuffixes to compiler-options", { + compilerOptions: { + moduleSuffixes: [" "] + } + }, "tsconfig.json"); - it("Convert empty option of moduleSuffixes to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - moduleSuffixes: [] - } - }, "tsconfig.json", - { - compilerOptions: { - moduleSuffixes: [] - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert empty option of moduleSuffixes to compiler-options", { + compilerOptions: { + moduleSuffixes: [] + } + }, "tsconfig.json"); - it("Convert incorrectly format tsconfig.json to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - modu: "commonjs", - } - }, "tsconfig.json", - { - compilerOptions: {}, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Unknown compiler option 'modu'.", - code: ts.Diagnostics.Unknown_compiler_option_0.code, - category: ts.Diagnostics.Unknown_compiler_option_0.category - }] - } - ); - }); + baselineCompilerOptions("Convert incorrectly format tsconfig.json to compiler-options", { + compilerOptions: { + modu: "commonjs", + } + }, "tsconfig.json"); - it("Convert default tsconfig.json to compiler-options ", () => { - assertCompilerOptions({}, "tsconfig.json", - { - compilerOptions: {}, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert default tsconfig.json to compiler-options", {}, "tsconfig.json"); - it("Convert negative numbers in tsconfig.json ", () => { - assertCompilerOptions( - { - compilerOptions: { - allowJs: true, - maxNodeModuleJsDepth: -1 - } - }, "tsconfig.json", - { - compilerOptions: { - allowJs: true, - maxNodeModuleJsDepth: -1 - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert negative numbers in tsconfig.json", { + compilerOptions: { + allowJs: true, + maxNodeModuleJsDepth: -1 + } + }, "tsconfig.json"); // jsconfig.json - it("Convert correctly format jsconfig.json to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: false, - sourceMap: false, - lib: ["es5", "es2015.core", "es2015.symbol"] - } - }, "jsconfig.json", - { - compilerOptions: { - allowJs: true, - maxNodeModuleJsDepth: 2, - allowSyntheticDefaultImports: true, - skipLibCheck: true, - noEmit: true, - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - lib: ["lib.es5.d.ts", "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts"] - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert correctly format jsconfig.json to compiler-options", { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: false, + sourceMap: false, + lib: ["es5", "es2015.core", "es2015.symbol"] + } + }, "jsconfig.json"); - it("Convert correctly format jsconfig.json with allowJs is false to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: false, - sourceMap: false, - allowJs: false, - lib: ["es5", "es2015.core", "es2015.symbol"] - } - }, "jsconfig.json", - { - compilerOptions: { - allowJs: false, - maxNodeModuleJsDepth: 2, - allowSyntheticDefaultImports: true, - skipLibCheck: true, - noEmit: true, - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, - noImplicitAny: false, - sourceMap: false, - lib: ["lib.es5.d.ts", "lib.es2015.core.d.ts", "lib.es2015.symbol.d.ts"] - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert correctly format jsconfig.json with allowJs is false to compiler-options", { + compilerOptions: { + module: "commonjs", + target: "es5", + noImplicitAny: false, + sourceMap: false, + allowJs: false, + lib: ["es5", "es2015.core", "es2015.symbol"] + } + }, "jsconfig.json"); - it("Convert incorrectly format jsconfig.json to compiler-options ", () => { - assertCompilerOptions( - { - compilerOptions: { - modu: "commonjs", - } - }, "jsconfig.json", - { - compilerOptions: - { - allowJs: true, - maxNodeModuleJsDepth: 2, - allowSyntheticDefaultImports: true, - skipLibCheck: true, - noEmit: true - }, - errors: [{ - file: undefined, - start: 0, - length: 0, - messageText: "Unknown compiler option 'modu'.", - code: ts.Diagnostics.Unknown_compiler_option_0.code, - category: ts.Diagnostics.Unknown_compiler_option_0.category - }] - } - ); - }); + baselineCompilerOptions("Convert incorrectly format jsconfig.json to compiler-options", { + compilerOptions: { + modu: "commonjs", + } + }, "jsconfig.json"); - it("Convert default jsconfig.json to compiler-options ", () => { - assertCompilerOptions({}, "jsconfig.json", - { - compilerOptions: - { - allowJs: true, - maxNodeModuleJsDepth: 2, - allowSyntheticDefaultImports: true, - skipLibCheck: true, - noEmit: true - }, - errors: [] - } - ); - }); + baselineCompilerOptions("Convert default jsconfig.json to compiler-options", {}, "jsconfig.json"); - it("Convert tsconfig options when there are multiple invalid strings", () => { - assertCompilerOptionsWithJsonText(`{ + baselineCompilerOptionsJsonText("Convert tsconfig options when there are multiple invalid strings", `{ "compilerOptions": { "target": "<%- options.useTsWithBabel ? 'esnext' : 'es5' %>", "module": "esnext", @@ -660,122 +242,43 @@ describe("unittests:: config:: convertCompilerOptionsFromJson", () => { } } `, - "tsconfig.json", - { - compilerOptions: { - target: undefined, - module: ts.ModuleKind.ESNext, - experimentalDecorators: true, - }, - hasParseErrors: true - }); - }); + "tsconfig.json"); - it("Convert a tsconfig file with stray trailing characters", () => { - assertCompilerOptionsWithJsonText(`{ - "compilerOptions": { - "target": "esnext" - } - } blah`, "tsconfig.json", { - compilerOptions: { - target: ts.ScriptTarget.ESNext - }, - hasParseErrors: true, - errors: [{ - ...ts.Diagnostics.The_root_value_of_a_0_file_must_be_an_object, - messageText: "The root value of a 'tsconfig.json' file must be an object.", - file: undefined, - start: 0, - length: 0 - }] - }); - }); + baselineCompilerOptionsJsonText("Convert a tsconfig file with stray trailing characters", + `{ + "compilerOptions": { + "target": "esnext" + } + } blah`, "tsconfig.json"); - it("Convert a tsconfig file with stray leading characters", () => { - assertCompilerOptionsWithJsonText(`blah { - "compilerOptions": { - "target": "esnext" - } - }`, "tsconfig.json", { - compilerOptions: { - target: ts.ScriptTarget.ESNext - }, - hasParseErrors: true, - errors: [{ - ...ts.Diagnostics.The_root_value_of_a_0_file_must_be_an_object, - messageText: "The root value of a 'tsconfig.json' file must be an object.", - file: undefined, - start: 0, - length: 0 - }] - }); - }); + baselineCompilerOptionsJsonText("Convert a tsconfig file with stray leading characters", + `blah { + "compilerOptions": { + "target": "esnext" + } + }`, "tsconfig.json"); - it("Convert a tsconfig file as an array", () => { - assertCompilerOptionsWithJsonText(`[{ - "compilerOptions": { - "target": "esnext" - } - }]`, "tsconfig.json", { - compilerOptions: { - target: ts.ScriptTarget.ESNext - }, - errors: [{ - ...ts.Diagnostics.The_root_value_of_a_0_file_must_be_an_object, - messageText: "The root value of a 'tsconfig.json' file must be an object.", - file: undefined, - start: 0, - length: 0 - }] - }); - }); + baselineCompilerOptionsJsonText("Convert a tsconfig file as an array", + `[{ + "compilerOptions": { + "target": "esnext" + } + }]`, "tsconfig.json"); - it("raises an error if you've set a compiler flag in the root without including 'compilerOptions'", () => { - assertCompilerOptionsWithJsonText(`{ - "module": "esnext", - }`, "tsconfig.json", { - compilerOptions: {}, - errors: [{ - ...ts.Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, - messageText: "'module' should be set inside the 'compilerOptions' object of the config json file.", - file: undefined, - start: 0, - length: 0 - }] - }); - }); + baselineCompilerOptionsJsonText("raises an error if you've set a compiler flag in the root without including compilerOptions", + `{ + "module": "esnext", + }`, "tsconfig.json"); - it("does not raise an error if you've set a compiler flag in the root when you have included 'compilerOptions'", () => { - assertCompilerOptionsWithJsonText(`{ - "target": "esnext", - "compilerOptions": { - "module": "esnext" - } - }`, "tsconfig.json", { - compilerOptions: { - module: ts.ModuleKind.ESNext - }, - errors: [] - }); - }); + baselineCompilerOptionsJsonText("does not raise an error if you've set a compiler flag in the root when you have included 'compilerOptions'", + `{ + "target": "esnext", + "compilerOptions": { + "module": "esnext" + } + }`, "tsconfig.json"); - it("Don't crash when root expression is not object at all", () => { - assertCompilerOptionsWithJsonText(`42`, "tsconfig.json", { - compilerOptions: {}, - errors: [{ - ...ts.Diagnostics.The_root_value_of_a_0_file_must_be_an_object, - messageText: "The root value of a 'tsconfig.json' file must be an object.", - file: undefined, - start: 0, - length: 0 - }] - }); - }); + baselineCompilerOptionsJsonText("Don't crash when root expression is not object at all", `42`, "tsconfig.json"); - it("Allow trailing comments", () => { - assertCompilerOptionsWithJsonText(`{} // no options`, "tsconfig.json", { - compilerOptions: {}, - errors: [] - }); - }); + baselineCompilerOptionsJsonText("Allow trailing comments", `{} // no options`, "tsconfig.json"); }); diff --git a/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts b/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts index 8fa6758774b..f506eab0890 100644 --- a/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts +++ b/src/testRunner/unittests/config/convertTypeAcquisitionFromJson.ts @@ -1,217 +1,96 @@ import * as fakes from "../../_namespaces/fakes"; -import * as ts from "../../_namespaces/ts"; import * as vfs from "../../_namespaces/vfs"; +import { baselineParseConfig } from "./helpers"; -interface ExpectedResult { typeAcquisition: ts.TypeAcquisition; errors: ts.Diagnostic[]; } describe("unittests:: config:: convertTypeAcquisitionFromJson", () => { - function assertTypeAcquisition(json: any, configFileName: string, expectedResult: ExpectedResult) { - assertTypeAcquisitionWithJson(json, configFileName, expectedResult); - assertTypeAcquisitionWithJsonNode(json, configFileName, expectedResult); - } - - function verifyAcquisition(actualTypeAcquisition: ts.TypeAcquisition | undefined, expectedResult: ExpectedResult) { - const parsedTypeAcquisition = JSON.stringify(actualTypeAcquisition); - const expectedTypeAcquisition = JSON.stringify(expectedResult.typeAcquisition); - assert.equal(parsedTypeAcquisition, expectedTypeAcquisition); - } - - function verifyErrors(actualErrors: ts.Diagnostic[], expectedResult: ExpectedResult, hasLocation?: boolean) { - const expectedErrors = expectedResult.errors; - assert.isTrue(expectedResult.errors.length === actualErrors.length, `Expected error: ${JSON.stringify(expectedResult.errors)}. Actual error: ${JSON.stringify(actualErrors)}.`); - for (let i = 0; i < actualErrors.length; i++) { - const actualError = actualErrors[i]; - const expectedError = expectedErrors[i]; - assert.equal(actualError.code, expectedError.code, `Expected error-code: ${JSON.stringify(expectedError.code)}. Actual error-code: ${JSON.stringify(actualError.code)}.`); - assert.equal(actualError.category, expectedError.category, `Expected error-category: ${JSON.stringify(expectedError.category)}. Actual error-category: ${JSON.stringify(actualError.category)}.`); - if (hasLocation) { - assert(actualError.file); - assert(actualError.start); - assert(actualError.length); - } - } - } - - function assertTypeAcquisitionWithJson(json: any, configFileName: string, expectedResult: ExpectedResult) { - const jsonOptions = json.typeAcquisition; - const { options: actualTypeAcquisition, errors: actualErrors } = ts.convertTypeAcquisitionFromJson(jsonOptions, "/apath/", configFileName); - verifyAcquisition(actualTypeAcquisition, expectedResult); - verifyErrors(actualErrors, expectedResult); - } - - function assertTypeAcquisitionWithJsonNode(json: any, configFileName: string, expectedResult: ExpectedResult) { - const fileText = JSON.stringify(json); - const result = ts.parseJsonText(configFileName, fileText); - assert(!result.parseDiagnostics.length); - assert(!!result.endOfFileToken); - const host: ts.ParseConfigHost = new fakes.ParseConfigHost(new vfs.FileSystem(/*ignoreCase*/ false, { cwd: "/apath/" })); - const { typeAcquisition: actualTypeAcquisition, errors: actualParseErrors } = ts.parseJsonSourceFileConfigFileContent(result, host, "/apath/", /*existingOptions*/ undefined, configFileName); - verifyAcquisition(actualTypeAcquisition, expectedResult); - - const actualErrors = ts.filter(actualParseErrors, error => error.code !== ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code); - verifyErrors(actualErrors, expectedResult, /*hasLocation*/ true); - } - - it("Convert correctly format tsconfig.json to typeAcquisition ", () => { - assertTypeAcquisition( - { - typeAcquisition: - { - enable: true, - include: ["0.d.ts", "1.d.ts"], - exclude: ["0.js", "1.js"] - } + function baselineTypeAcquisition(subScenario: string, json: any, configFileName: string) { + baselineParseConfig({ + scenario: "convertTypeAcquisitionFromJson", + subScenario, + input: () => { + const jsonText = JSON.stringify(json, undefined, " "); + return [{ + createHost: () => new fakes.ParseConfigHost(new vfs.FileSystem( + /*ignoreCase*/ false, + { + cwd: "/apath/", + files: { + [`/apath/${configFileName}`]: jsonText, + "/apath/a.ts": "", + "/apath/b.js": "", + } + }, + )), + jsonText, + configFileName, + basePath: "/apath", + baselineParsed: (baseline, parsed) => baseline.push("TypeAcquisition::", JSON.stringify(parsed.typeAcquisition, undefined, " ")), + }]; }, - "tsconfig.json", - { - typeAcquisition: - { - enable: true, - include: ["0.d.ts", "1.d.ts"], - exclude: ["0.js", "1.js"] - }, - errors: [] as ts.Diagnostic[] - }); - }); + }); + } - it("Convert incorrect format tsconfig.json to typeAcquisition ", () => { - assertTypeAcquisition( + baselineTypeAcquisition("Convert correctly format tsconfig.json to typeAcquisition ", + { + typeAcquisition: { - typeAcquisition: - { - enableAutoDiscovy: true, - } - }, "tsconfig.json", - { - typeAcquisition: - { - enable: false, - include: [], - exclude: [] - }, - errors: [ - { - category: ts.Diagnostics.Unknown_type_acquisition_option_0.category, - code: ts.Diagnostics.Unknown_type_acquisition_option_0.code, - file: undefined, - start: 0, - length: 0, - messageText: undefined!, // TODO: GH#18217 - } - ] - }); - }); + enable: true, + include: ["0.d.ts", "1.d.ts"], + exclude: ["0.js", "1.js"] + } + }, + "tsconfig.json" + ); - it("Convert default tsconfig.json to typeAcquisition ", () => { - assertTypeAcquisition({}, "tsconfig.json", + baselineTypeAcquisition("Convert incorrect format tsconfig.json to typeAcquisition ", + { + typeAcquisition: { - typeAcquisition: - { - enable: false, - include: [], - exclude: [] - }, - errors: [] as ts.Diagnostic[] - }); - }); + enableAutoDiscovy: true, + } + }, "tsconfig.json", + ); - it("Convert tsconfig.json with only enable property to typeAcquisition ", () => { - assertTypeAcquisition( + baselineTypeAcquisition("Convert default tsconfig.json to typeAcquisition ", {}, "tsconfig.json"); + + baselineTypeAcquisition("Convert tsconfig.json with only enable property to typeAcquisition ", + { + typeAcquisition: { - typeAcquisition: - { - enable: true - } - }, "tsconfig.json", - { - typeAcquisition: - { - enable: true, - include: [], - exclude: [] - }, - errors: [] as ts.Diagnostic[] - }); - }); + enable: true + } + }, "tsconfig.json", + ); // jsconfig.json - it("Convert jsconfig.json to typeAcquisition ", () => { - assertTypeAcquisition( + baselineTypeAcquisition("Convert jsconfig.json to typeAcquisition ", + { + typeAcquisition: { - typeAcquisition: - { - enable: false, - include: ["0.d.ts"], - exclude: ["0.js"] - } - }, "jsconfig.json", - { - typeAcquisition: - { - enable: false, - include: ["0.d.ts"], - exclude: ["0.js"] - }, - errors: [] as ts.Diagnostic[] - }); - }); + enable: false, + include: ["0.d.ts"], + exclude: ["0.js"] + } + }, "jsconfig.json", + ); - it("Convert default jsconfig.json to typeAcquisition ", () => { - assertTypeAcquisition({ }, "jsconfig.json", - { - typeAcquisition: - { - enable: true, - include: [], - exclude: [] - }, - errors: [] as ts.Diagnostic[] - }); - }); + baselineTypeAcquisition("Convert default jsconfig.json to typeAcquisition ", {}, "jsconfig.json"); - it("Convert incorrect format jsconfig.json to typeAcquisition ", () => { - assertTypeAcquisition( + baselineTypeAcquisition("Convert incorrect format jsconfig.json to typeAcquisition ", + { + typeAcquisition: { - typeAcquisition: - { - enableAutoDiscovy: true, - } - }, "jsconfig.json", - { - typeAcquisition: - { - enable: true, - include: [], - exclude: [] - }, - errors: [ - { - category: ts.Diagnostics.Unknown_type_acquisition_option_0.category, - code: ts.Diagnostics.Unknown_type_acquisition_option_0.code, - file: undefined, - start: 0, - length: 0, - messageText: undefined!, // TODO: GH#18217 - } - ] - }); - }); + enableAutoDiscovy: true, + } + }, "jsconfig.json", + ); - it("Convert jsconfig.json with only enable property to typeAcquisition ", () => { - assertTypeAcquisition( + baselineTypeAcquisition("Convert jsconfig.json with only enable property to typeAcquisition ", + { + typeAcquisition: { - typeAcquisition: - { - enable: false - } - }, "jsconfig.json", - { - typeAcquisition: - { - enable: false, - include: [], - exclude: [] - }, - errors: [] as ts.Diagnostic[] - }); - }); + enable: false + } + }, "jsconfig.json", + ); }); diff --git a/src/testRunner/unittests/config/helpers.ts b/src/testRunner/unittests/config/helpers.ts new file mode 100644 index 00000000000..8c754e92e63 --- /dev/null +++ b/src/testRunner/unittests/config/helpers.ts @@ -0,0 +1,105 @@ +import * as fakes from "../../_namespaces/fakes"; +import * as Harness from "../../_namespaces/Harness"; +import * as ts from "../../_namespaces/ts"; +import * as vfs from "../../_namespaces/vfs"; + +function getParsedCommandJson( + jsonText: string, + configFileName: string, + host: fakes.ParseConfigHost, + basePath: string | undefined, + existingOptions: ts.CompilerOptions | undefined, + existingWatchOptions: ts.WatchOptions | undefined, +) { + const parsed = ts.parseConfigFileTextToJson(configFileName, jsonText); + return ts.parseJsonConfigFileContent( + parsed.config, + host, + basePath ?? host.sys.getCurrentDirectory(), + existingOptions, + configFileName, + /*resolutionStack*/ undefined, + /*extraFileExtensions*/ undefined, + /*extendedConfigCache*/ undefined, + existingWatchOptions, + ); +} + +function getParsedCommandJsonSourceFile( + jsonText: string, + configFileName: string, + host: fakes.ParseConfigHost, + basePath: string | undefined, + existingOptions: ts.CompilerOptions | undefined, + existingWatchOptions: ts.WatchOptions | undefined, +) { + const parsed = ts.parseJsonText(configFileName, jsonText); + return ts.parseJsonSourceFileConfigFileContent( + parsed, + host, + basePath ?? host.sys.getCurrentDirectory(), + existingOptions, + configFileName, + /*resolutionStack*/ undefined, + /*extraFileExtensions*/ undefined, + /*extendedConfigCache*/ undefined, + existingWatchOptions, + ); +} + +export interface ParseConfigInput { + createHost: (baseline: string[]) => fakes.ParseConfigHost; + jsonText: string; + configFileName: string; + basePath?: string, + existingOptions?: ts.CompilerOptions; + existingWatchOptions?: ts.WatchOptions; + baselineParsed(baseline: string[], parsed: ts.ParsedCommandLine): void; +} +export interface BaselineParseConfigInput { + scenario: string; + subScenario: string; + input(): ParseConfigInput[]; + skipJson?: boolean; + skipErrors?: boolean; + skipFs?: boolean; + header?(baseline: string[]): void; +} +export function baselineParseConfig(input: BaselineParseConfigInput) { + if (!input.skipJson) baselineParseConfigWith("with json api", getParsedCommandJson, input); + baselineParseConfigWith("with jsonSourceFile api", getParsedCommandJsonSourceFile, input); +} + +export function baselineParseConfigHost(baseline: string[], host: fakes.ParseConfigHost) { + baseline.push("Fs::", vfs.formatPatch(host.sys.vfs.diff(/*base*/ undefined, { baseIsNotShadowRoot: true })!)); +} + +function baselineParseConfigWith( + jsonTest: string, + getParsed: typeof getParsedCommandJson, + { scenario, subScenario, input, skipErrors, skipFs, header }: BaselineParseConfigInput, +) { + describe(subScenario, () => { + it(jsonTest, () => { + const baseline: string[] = []; + header?.(baseline); + for (const { createHost, jsonText, configFileName, existingOptions, basePath, existingWatchOptions, baselineParsed } of input()) { + const host = createHost(baseline); + if (!skipFs) baselineParseConfigHost(baseline, host); + baseline.push(`configFileName:: ${configFileName}`); + const parsed = getParsed(jsonText, configFileName, host, basePath, existingOptions, existingWatchOptions); + baselineParsed(baseline, parsed); + if (!skipErrors) { + baseline.push("Errors::"); + baseline.push(ts.formatDiagnosticsWithColorAndContext(parsed.errors, { + getCurrentDirectory: () => basePath || host.sys.getCurrentDirectory(), + getCanonicalFileName: ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames), + getNewLine: () => host.sys.newLine, + })); + } + baseline.push(""); + } + Harness.Baseline.runBaseline(`config/${scenario}/${subScenario} ${jsonTest}.js`, baseline.join("\n")); + }); + }); +} \ No newline at end of file diff --git a/src/testRunner/unittests/config/matchFiles.ts b/src/testRunner/unittests/config/matchFiles.ts index a7ecae04252..33c21ff2410 100644 --- a/src/testRunner/unittests/config/matchFiles.ts +++ b/src/testRunner/unittests/config/matchFiles.ts @@ -1,6 +1,7 @@ import * as fakes from "../../_namespaces/fakes"; import * as ts from "../../_namespaces/ts"; import * as vfs from "../../_namespaces/vfs"; +import { baselineParseConfig } from "./helpers"; const caseInsensitiveBasePath = "c:/dev/"; const caseInsensitiveTsconfigPath = "c:/dev/tsconfig.json"; @@ -103,1421 +104,488 @@ const caseSensitiveOrderingDiffersWithCaseHost = new fakes.ParseConfigHost(new v "/dev/zebra.ts": "", }})); -function assertParsed(actual: ts.ParsedCommandLine, expected: ts.ParsedCommandLine): void { - assert.deepEqual(actual.fileNames, expected.fileNames); - assert.deepEqual(actual.wildcardDirectories, expected.wildcardDirectories); - assert.deepEqual(actual.errors, expected.errors); -} - -function validateMatches(expected: ts.ParsedCommandLine, json: any, host: ts.ParseConfigHost, basePath: string, existingOptions?: ts.CompilerOptions, configFileName?: string, resolutionStack?: ts.Path[]) { - { - const jsonText = JSON.stringify(json); - const result = ts.parseJsonText(caseInsensitiveTsconfigPath, jsonText); - const actual = ts.parseJsonSourceFileConfigFileContent(result, host, basePath, existingOptions, configFileName, resolutionStack); - for (const error of expected.errors) { - if (error.file) { - error.file = result; +function baselineMatches(subScenario: string, json: any, host: fakes.ParseConfigHost, basePath: string) { + const jsonText = JSON.stringify(json, undefined, " "); + baselineParseConfig({ + scenario: "matchFiles", + subScenario, + input: () => [{ + createHost: () => host, + jsonText, + configFileName: caseInsensitiveTsconfigPath, + basePath, + baselineParsed: (baseline, parsed) => { + const wildcardDirectories = parsed.wildcardDirectories ? {} as ts.MapLike : undefined; + if (parsed.wildcardDirectories) ts.getOwnKeys(parsed.wildcardDirectories).forEach(dir => wildcardDirectories![dir] = `WatchDirectoryFlags.${(ts as any).WatchDirectoryFlags[parsed.wildcardDirectories![dir]]}`); + baseline.push("Result", JSON.stringify({ + ...parsed, + errors: undefined, + wildcardDirectories, + }, undefined, " ")); } - } - assertParsed(actual, expected); - } - { - const actual = ts.parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack); - expected.errors = expected.errors.map((error): ts.Diagnostic => ({ - category: error.category, - code: error.code, - file: undefined, - length: undefined, - messageText: error.messageText, - start: undefined, - reportsUnnecessary: undefined, - reportsDeprecated: undefined - })); - assertParsed(actual, expected); - } -} - -function createDiagnosticForConfigFile(json: any, start: number, length: number, diagnosticMessage: ts.DiagnosticMessage, arg0: string) { - const text = JSON.stringify(json); - const file = { - fileName: caseInsensitiveTsconfigPath, - kind: ts.SyntaxKind.SourceFile, - text - } as ts.SourceFile; - return ts.createFileDiagnostic(file, start, length, diagnosticMessage, arg0); + }], + header: baseline => baseline.push("config:", jsonText), + }); } describe("unittests:: config:: matchFiles", () => { - it("with defaults", () => { - const json = {}; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.ts", - "c:/dev/x/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - + baselineMatches("with defaults", {}, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); describe("with literal file list", () => { - it("without exclusions", () => { - const json = { - files: [ - "a.ts", - "b.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("missing files are still present", () => { - const json = { - files: [ - "z.ts", - "x.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/z.ts", - "c:/dev/x.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("are not removed due to excludes", () => { - const json = { - files: [ - "a.ts", - "b.ts" - ], - exclude: [ - "b.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); + baselineMatches("without exclusions with literal file list", { + files: [ + "a.ts", + "b.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("missing files are still present", { + files: [ + "z.ts", + "x.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("are not removed due to excludes", { + files: [ + "a.ts", + "b.ts" + ], + exclude: [ + "b.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); }); describe("with literal include list", () => { - it("without exclusions", () => { - const json = { - include: [ - "a.ts", - "b.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("with non .ts file extensions are excluded", () => { - const json = { - include: [ - "a.js", - "b.js" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") - ], - fileNames: [], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); - it("with missing files are excluded", () => { - const json = { - include: [ - "z.ts", - "x.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") - ], - fileNames: [], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); - it("with literal excludes", () => { - const json = { - include: [ - "a.ts", - "b.ts" - ], - exclude: [ - "b.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("with wildcard excludes", () => { - const json = { - include: [ - "a.ts", - "b.ts", - "z/a.ts", - "z/abz.ts", - "z/aba.ts", - "x/b.ts" - ], - exclude: [ - "*.ts", - "z/??z.ts", - "*/b.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/z/a.ts", - "c:/dev/z/aba.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("with recursive excludes", () => { - const json = { - include: [ - "a.ts", - "b.ts", - "x/a.ts", - "x/b.ts", - "x/y/a.ts", - "x/y/b.ts" - ], - exclude: [ - "**/b.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/x/a.ts", - "c:/dev/x/y/a.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("with case sensitive exclude", () => { - const json = { - include: [ - "B.ts" - ], - exclude: [ - "**/b.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "/dev/B.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseSensitiveHost, caseSensitiveBasePath); - }); - it("with common package folders and no exclusions", () => { - const json = { - include: [ - "a.ts", - "b.ts", - "node_modules/a.ts", - "bower_components/a.ts", - "jspm_packages/a.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.ts", - "c:/dev/node_modules/a.ts", - "c:/dev/bower_components/a.ts", - "c:/dev/jspm_packages/a.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - it("with common package folders and exclusions", () => { - const json = { - include: [ - "a.ts", - "b.ts", - "node_modules/a.ts", - "bower_components/a.ts", - "jspm_packages/a.ts" - ], - exclude: [ - "a.ts", - "b.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/node_modules/a.ts", - "c:/dev/bower_components/a.ts", - "c:/dev/jspm_packages/a.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - it("with common package folders and empty exclude", () => { - const json = { - include: [ - "a.ts", - "b.ts", - "node_modules/a.ts", - "bower_components/a.ts", - "jspm_packages/a.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.ts", - "c:/dev/node_modules/a.ts", - "c:/dev/bower_components/a.ts", - "c:/dev/jspm_packages/a.ts" - ], - wildcardDirectories: {}, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); + baselineMatches("without exclusions with literal include list", { + include: [ + "a.ts", + "b.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("with non .ts file extensions are excluded", { + include: [ + "a.js", + "b.js" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("with missing files are excluded with literal include list", { + include: [ + "z.ts", + "x.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("with literal excludes", { + include: [ + "a.ts", + "b.ts" + ], + exclude: [ + "b.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("with wildcard excludes", { + include: [ + "a.ts", + "b.ts", + "z/a.ts", + "z/abz.ts", + "z/aba.ts", + "x/b.ts" + ], + exclude: [ + "*.ts", + "z/??z.ts", + "*/b.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("with recursive excludes", { + include: [ + "a.ts", + "b.ts", + "x/a.ts", + "x/b.ts", + "x/y/a.ts", + "x/y/b.ts" + ], + exclude: [ + "**/b.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("with case sensitive exclude", { + include: [ + "B.ts" + ], + exclude: [ + "**/b.ts" + ] + }, caseSensitiveHost, caseSensitiveBasePath); + baselineMatches("with common package folders and no exclusions", { + include: [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ] + }, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + baselineMatches("with common package folders and exclusions", { + include: [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ], + exclude: [ + "a.ts", + "b.ts" + ] + }, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + baselineMatches("with common package folders and empty exclude", { + include: [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ] + }, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); }); describe("with wildcard include list", () => { - it("is sorted in include order, then in alphabetical order", () => { - const json = { - include: [ - "z/*.ts", - "x/*.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/z/a.ts", - "c:/dev/z/aba.ts", - "c:/dev/z/abz.ts", - "c:/dev/z/b.ts", - "c:/dev/z/bba.ts", - "c:/dev/z/bbz.ts", - "c:/dev/x/a.ts", - "c:/dev/x/aa.ts", - "c:/dev/x/b.ts" - ], - wildcardDirectories: { - "c:/dev/z": ts.WatchDirectoryFlags.None, - "c:/dev/x": ts.WatchDirectoryFlags.None - }, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("same named declarations are excluded", () => { - const json = { - include: [ - "*.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.ts", - "c:/dev/c.d.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.None - }, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("`*` matches only ts files", () => { - const json = { - include: [ - "*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.ts", - "c:/dev/c.d.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.None - }, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("`?` matches only a single character", () => { - const json = { - include: [ - "x/?.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/x/a.ts", - "c:/dev/x/b.ts" - ], - wildcardDirectories: { - "c:/dev/x": ts.WatchDirectoryFlags.None - }, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("with recursive directory", () => { - const json = { + baselineMatches("is sorted in include order, then in alphabetical order", { + include: [ + "z/*.ts", + "x/*.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("same named declarations are excluded", { + include: [ + "*.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("star matches only ts files", { + include: [ + "*" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("question matches only a single character", { + include: [ + "x/?.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("with recursive directory", { + include: [ + "**/a.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("with multiple recursive directories", { + include: [ + "x/y/**/a.ts", + "x/**/a.ts", + "z/**/a.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("case sensitive", { + include: [ + "**/A.ts" + ] + }, caseSensitiveHost, caseSensitiveBasePath); + baselineMatches("with missing files are excluded with wildcard include list", { + include: [ + "*/z.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("always include literal files", { + files: [ + "a.ts" + ], + include: [ + "*/z.ts" + ], + exclude: [ + "**/a.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("exclude folders", { + include: [ + "**/*" + ], + exclude: [ + "z", + "x" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + describe("with common package folders", () => { + baselineMatches("and no exclusions", { include: [ "**/a.ts" ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/x/a.ts", - "c:/dev/x/y/a.ts", - "c:/dev/z/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("with multiple recursive directories", () => { - const json = { + }, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + baselineMatches("and exclusions", { include: [ - "x/y/**/a.ts", - "x/**/a.ts", - "z/**/a.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/x/y/a.ts", - "c:/dev/x/a.ts", - "c:/dev/z/a.ts" - ], - wildcardDirectories: { - "c:/dev/x": ts.WatchDirectoryFlags.Recursive, - "c:/dev/z": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("case sensitive", () => { - const json = { - include: [ - "**/A.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "/dev/A.ts" - ], - wildcardDirectories: { - "/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseSensitiveHost, caseSensitiveBasePath); - }); - it("with missing files are excluded", () => { - const json = { - include: [ - "*/z.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") - ], - fileNames: [], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); - it("always include literal files", () => { - const json = { - files: [ - "a.ts" - ], - include: [ - "*/z.ts" + "**/?.ts" ], exclude: [ - "**/a.ts" + "a.ts" ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts" + }, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + baselineMatches("and empty exclude", { + include: [ + "**/a.ts" ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); + exclude: [] as string[] + }, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + baselineMatches("and explicit recursive include", { + include: [ + "**/a.ts", + "**/node_modules/a.ts" + ] + }, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + baselineMatches("and wildcard include", { + include: [ + "*/a.ts" + ] + }, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); + baselineMatches("and explicit wildcard include", { + include: [ + "*/a.ts", + "node_modules/a.ts" + ] + }, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); }); - it("exclude folders", () => { - const json = { + baselineMatches("exclude .js files when allowJs=false", { + compilerOptions: { + allowJs: false + }, + include: [ + "js/*" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("include .js files when allowJs=true", { + compilerOptions: { + allowJs: true + }, + include: [ + "js/*" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("include explicitly listed .min.js files when allowJs=true", { + compilerOptions: { + allowJs: true + }, + include: [ + "js/*.min.js" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("include paths outside of the project", { + include: [ + "*", + "c:/ext/*" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("include paths outside of the project using relative paths", { + include: [ + "*", + "../ext/*" + ], + exclude: [ + "**" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("exclude paths outside of the project using relative paths", { + include: [ + "c:/**/*" + ], + exclude: [ + "../**" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("include files with .. in their name", { + include: [ + "c:/ext/b/a..b.ts" + ], + exclude: [ + "**" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("exclude files with .. in their name", { + include: [ + "c:/ext/**/*" + ], + exclude: [ + "c:/ext/b/a..b.ts" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("with jsx=none, allowJs=false", { + compilerOptions: { + allowJs: false + } + }, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); + baselineMatches("with jsx=preserve, allowJs=false", { + compilerOptions: { + jsx: "preserve", + allowJs: false + } + }, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); + baselineMatches("with jsx=react-native, allowJs=false", { + compilerOptions: { + jsx: "react-native", + allowJs: false + } + }, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); + baselineMatches("with jsx=none, allowJs=true", { + compilerOptions: { + allowJs: true + } + }, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); + baselineMatches("with jsx=preserve, allowJs=true", { + compilerOptions: { + jsx: "preserve", + allowJs: true + } + }, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); + baselineMatches("with jsx=react-native, allowJs=true", { + compilerOptions: { + jsx: "react-native", + allowJs: true + } + }, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); + baselineMatches("exclude .min.js files using wildcards", { + compilerOptions: { + allowJs: true + }, + include: [ + "js/*.min.js" + ], + exclude: [ + "js/a*" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + + describe("with trailing recursive directory", () => { + baselineMatches("in includes with trailing recursive directory", { + include: [ + "**" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); + baselineMatches("in excludes with trailing recursive directory", { include: [ "**/*" ], - exclude: [ - "z", - "x" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.ts", - "c:/dev/c.d.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - describe("with common package folders", () => { - it("and no exclusions", () => { - const json = { - include: [ - "**/a.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/x/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - it("and exclusions", () => { - const json = { - include: [ - "**/?.ts" - ], - exclude: [ - "a.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/b.ts", - "c:/dev/x/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - it("and empty exclude", () => { - const json = { - include: [ - "**/a.ts" - ], - exclude: [] as string[] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/x/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - it("and explicit recursive include", () => { - const json = { - include: [ - "**/a.ts", - "**/node_modules/a.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/x/a.ts", - "c:/dev/node_modules/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - it("and wildcard include", () => { - const json = { - include: [ - "*/a.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/x/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - it("and explicit wildcard include", () => { - const json = { - include: [ - "*/a.ts", - "node_modules/a.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/x/a.ts", - "c:/dev/node_modules/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); - }); - }); - it("exclude .js files when allowJs=false", () => { - const json = { - compilerOptions: { - allowJs: false - }, - include: [ - "js/*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: { - allowJs: false - }, - errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") - ], - fileNames: [], - wildcardDirectories: { - "c:/dev/js": ts.WatchDirectoryFlags.None - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); - it("include .js files when allowJs=true", () => { - const json = { - compilerOptions: { - allowJs: true - }, - include: [ - "js/*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: { - allowJs: true - }, - errors: [], - fileNames: [ - "c:/dev/js/a.js", - "c:/dev/js/b.js" - ], - wildcardDirectories: { - "c:/dev/js": ts.WatchDirectoryFlags.None - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("include explicitly listed .min.js files when allowJs=true", () => { - const json = { - compilerOptions: { - allowJs: true - }, - include: [ - "js/*.min.js" - ] - }; - const expected: ts.ParsedCommandLine = { - options: { - allowJs: true - }, - errors: [], - fileNames: [ - "c:/dev/js/ab.min.js", - "c:/dev/js/d.min.js" - ], - wildcardDirectories: { - "c:/dev/js": ts.WatchDirectoryFlags.None - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("include paths outside of the project", () => { - const json = { - include: [ - "*", - "c:/ext/*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.ts", - "c:/dev/c.d.ts", - "c:/ext/ext.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.None, - "c:/ext": ts.WatchDirectoryFlags.None - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("include paths outside of the project using relative paths", () => { - const json = { - include: [ - "*", - "../ext/*" - ], exclude: [ "**" ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/ext/ext.ts" - ], - wildcardDirectories: { - "c:/ext": ts.WatchDirectoryFlags.None - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("exclude paths outside of the project using relative paths", () => { - const json = { - include: [ - "c:/**/*" - ], - exclude: [ - "../**" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - caseInsensitiveTsconfigPath, JSON.stringify(json.include), JSON.stringify(json.exclude))] - , - fileNames: [], - wildcardDirectories: {} - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); - it("include files with .. in their name", () => { - const json = { - include: [ - "c:/ext/b/a..b.ts" - ], - exclude: [ - "**" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/ext/b/a..b.ts" - ], - wildcardDirectories: {} - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("exclude files with .. in their name", () => { - const json = { - include: [ - "c:/ext/**/*" - ], - exclude: [ - "c:/ext/b/a..b.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/ext/ext.ts", - ], - wildcardDirectories: { - "c:/ext": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - it("with jsx=none, allowJs=false", () => { - const json = { - compilerOptions: { - allowJs: false - } - }; - const expected: ts.ParsedCommandLine = { - options: { - allowJs: false - }, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.tsx", - "c:/dev/c.tsx", - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); - }); - it("with jsx=preserve, allowJs=false", () => { - const json = { - compilerOptions: { - jsx: "preserve", - allowJs: false - } - }; - const expected: ts.ParsedCommandLine = { - options: { - jsx: ts.JsxEmit.Preserve, - allowJs: false - }, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.tsx", - "c:/dev/c.tsx", - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); - }); - it("with jsx=react-native, allowJs=false", () => { - const json = { - compilerOptions: { - jsx: "react-native", - allowJs: false - } - }; - const expected: ts.ParsedCommandLine = { - options: { - jsx: ts.JsxEmit.ReactNative, - allowJs: false - }, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.tsx", - "c:/dev/c.tsx", - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); - }); - it("with jsx=none, allowJs=true", () => { - const json = { - compilerOptions: { - allowJs: true - } - }; - const expected: ts.ParsedCommandLine = { - options: { - allowJs: true - }, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.tsx", - "c:/dev/c.tsx", - "c:/dev/d.js", - "c:/dev/e.jsx", - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); - }); - it("with jsx=preserve, allowJs=true", () => { - const json = { - compilerOptions: { - jsx: "preserve", - allowJs: true - } - }; - const expected: ts.ParsedCommandLine = { - options: { - jsx: ts.JsxEmit.Preserve, - allowJs: true - }, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.tsx", - "c:/dev/c.tsx", - "c:/dev/d.js", - "c:/dev/e.jsx", - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); - }); - it("with jsx=react-native, allowJs=true", () => { - const json = { - compilerOptions: { - jsx: "react-native", - allowJs: true - } - }; - const expected: ts.ParsedCommandLine = { - options: { - jsx: ts.JsxEmit.ReactNative, - allowJs: true - }, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/b.tsx", - "c:/dev/c.tsx", - "c:/dev/d.js", - "c:/dev/e.jsx", - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); - }); - it("exclude .min.js files using wildcards", () => { - const json = { - compilerOptions: { - allowJs: true - }, - include: [ - "js/*.min.js" - ], - exclude: [ - "js/a*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: { - allowJs: true - }, - errors: [], - fileNames: [ - "c:/dev/js/d.min.js" - ], - wildcardDirectories: { - "c:/dev/js": ts.WatchDirectoryFlags.None - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); - - describe("with trailing recursive directory", () => { - it("in includes", () => { - const json = { - include: [ - "**" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - createDiagnosticForConfigFile(json, 12, 4, ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**"), - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") - ], - fileNames: [], - wildcardDirectories: {} - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); - it("in excludes", () => { - const json = { - include: [ - "**/*" - ], - exclude: [ - "**" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - caseInsensitiveTsconfigPath, JSON.stringify(json.include), JSON.stringify(json.exclude)) - ], - fileNames: [], - wildcardDirectories: {} - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); + }, caseInsensitiveHost, caseInsensitiveBasePath); }); describe("with multiple recursive directory patterns", () => { - it("in includes", () => { - const json = { - include: [ - "**/x/**/*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/x/a.ts", - "c:/dev/x/aa.ts", - "c:/dev/x/b.ts", - "c:/dev/x/y/a.ts", - "c:/dev/x/y/b.ts", - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); - it("in excludes", () => { - const json = { - include: [ - "**/a.ts" - ], - exclude: [ - "**/x/**" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/z/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); + baselineMatches("in includes with multiple recursive directory patterns", { + include: [ + "**/x/**/*" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); }); + baselineMatches("in excludes", { + include: [ + "**/a.ts" + ], + exclude: [ + "**/x/**" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); describe("with parent directory symbols after a recursive directory pattern", () => { - it("in includes immediately after", () => { - const json = { - include: [ - "**/../*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - createDiagnosticForConfigFile(json, 12, 9, ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/../*"), - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") - ], - fileNames: [], - wildcardDirectories: {} - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); + baselineMatches("in includes immediately after", { + include: [ + "**/../*" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); - it("in includes after a subdirectory", () => { - const json = { - include: [ - "**/y/../*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - createDiagnosticForConfigFile(json, 12, 11, ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/y/../*"), - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") - ], - fileNames: [], - wildcardDirectories: {} - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); + baselineMatches("in includes after a subdirectory", { + include: [ + "**/y/../*" + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); - it("in excludes immediately after", () => { - const json = { - include: [ - "**/a.ts" - ], - exclude: [ - "**/.." - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - createDiagnosticForConfigFile(json, 34, 7, ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/..") - ], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/x/a.ts", - "c:/dev/x/y/a.ts", - "c:/dev/z/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); + baselineMatches("in excludes immediately after", { + include: [ + "**/a.ts" + ], + exclude: [ + "**/.." + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); - it("in excludes after a subdirectory", () => { - const json = { - include: [ - "**/a.ts" - ], - exclude: [ - "**/y/.." - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - createDiagnosticForConfigFile(json, 34, 9, ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/y/..") - ], - fileNames: [ - "c:/dev/a.ts", - "c:/dev/x/a.ts", - "c:/dev/x/y/a.ts", - "c:/dev/z/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); + baselineMatches("in excludes after a subdirectory", { + include: [ + "**/a.ts" + ], + exclude: [ + "**/y/.." + ] + }, caseInsensitiveHost, caseInsensitiveBasePath); }); describe("with implicit globbification", () => { - it("Expands 'z' to 'z/**/*'", () => { - const json = { - include: ["z"] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ "a.ts", "aba.ts", "abz.ts", "b.ts", "bba.ts", "bbz.ts" ].map(x => `c:/dev/z/${x}`), - wildcardDirectories: { - "c:/dev/z": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); - }); + baselineMatches("Expands z to z/starstart/star", { + include: ["z"] + }, caseInsensitiveHost, caseInsensitiveBasePath); }); }); describe("with files or folders that begin with a .", () => { - it("that are not explicitly included", () => { - const json = { - include: [ - "x/**/*", - "w/*/*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/x/d.ts", - "c:/dev/x/y/d.ts", - ], - wildcardDirectories: { - "c:/dev/x": ts.WatchDirectoryFlags.Recursive, - "c:/dev/w": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); - }); + baselineMatches("that are not explicitly included", { + include: [ + "x/**/*", + "w/*/*" + ] + }, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); describe("that are explicitly included", () => { - it("without wildcards", () => { - const json = { - include: [ - "x/.y/a.ts", - "c:/dev/.z/.b.ts" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/x/.y/a.ts", - "c:/dev/.z/.b.ts" - ], - wildcardDirectories: {} - }; - validateMatches(expected, json, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); - }); - it("with recursive wildcards that match directories", () => { - const json = { - include: [ - "**/.*/*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/.z/c.ts", - "c:/dev/g.min.js/.g/g.ts", - "c:/dev/w/.u/e.ts", - "c:/dev/x/.y/a.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); - }); - it("with recursive wildcards that match nothing", () => { - const json = { - include: [ - "x/**/.y/*", - ".z/**/.*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/x/.y/a.ts", - "c:/dev/.z/.b.ts" - ], - wildcardDirectories: { - "c:/dev/.z": ts.WatchDirectoryFlags.Recursive, - "c:/dev/x": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); - }); - it("with wildcard excludes that implicitly exclude dotted files", () => { - const json = { - include: [ - "**/.*/*" - ], - exclude: [ - "**/*" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, - caseInsensitiveTsconfigPath, JSON.stringify(json.include), JSON.stringify(json.exclude)) - ], - fileNames: [], - wildcardDirectories: {} - }; - validateMatches(expected, json, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); - }); + baselineMatches("without wildcards", { + include: [ + "x/.y/a.ts", + "c:/dev/.z/.b.ts" + ] + }, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); + baselineMatches("with recursive wildcards that match directories", { + include: [ + "**/.*/*" + ] + }, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); + baselineMatches("with recursive wildcards that match nothing", { + include: [ + "x/**/.y/*", + ".z/**/.*" + ] + }, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); + baselineMatches("with wildcard excludes that implicitly exclude dotted files", { + include: [ + "**/.*/*" + ], + exclude: [ + "**/*" + ] + }, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); }); }); describe("exclude or include patterns which start with **", () => { - it("can exclude dirs whose pattern starts with **", () => { - const json = { - exclude: [ - "**/x" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "/dev/A.ts", - "/dev/B.ts", - "/dev/a.ts", - "/dev/b.ts", - "/dev/c.d.ts", - "/dev/q/a/c/b/d.ts", - "/dev/z/a.ts", - "/dev/z/aba.ts", - "/dev/z/abz.ts", - "/dev/z/b.ts", - "/dev/z/bba.ts", - "/dev/z/bbz.ts", - ], - wildcardDirectories: { - "/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseSensitiveHost, caseSensitiveBasePath); - }); - it("can include dirs whose pattern starts with **", () => { - const json = { - include: [ - "**/x", - "**/a/**/b" - ] - }; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "/dev/x/a.ts", - "/dev/x/b.ts", - "/dev/x/y/a.ts", - "/dev/x/y/b.ts", - "/dev/q/a/c/b/d.ts", - ], - wildcardDirectories: { - "/dev": ts.WatchDirectoryFlags.Recursive - } - }; - validateMatches(expected, json, caseSensitiveHost, caseSensitiveBasePath); - }); + baselineMatches("can exclude dirs whose pattern starts with starstar", { + exclude: [ + "**/x" + ] + }, caseSensitiveHost, caseSensitiveBasePath); + baselineMatches("can include dirs whose pattern starts with starstart", { + include: [ + "**/x", + "**/a/**/b" + ] + }, caseSensitiveHost, caseSensitiveBasePath); }); - it("can include files in the same order on multiple platforms", () => { - function getExpected(basePath: string): ts.ParsedCommandLine { - return { - options: {}, - errors: [], - fileNames: [ - `${basePath}Yosemite.ts`, // capital always comes before lowercase letters - `${basePath}xylophone.ts`, - `${basePath}zebra.ts` - ], - wildcardDirectories: { - [basePath.slice(0, basePath.length - 1)]: ts.WatchDirectoryFlags.Recursive - }, - }; - } - const json = {}; - validateMatches(getExpected(caseSensitiveBasePath), json, caseSensitiveOrderingDiffersWithCaseHost, caseSensitiveBasePath); - validateMatches(getExpected(caseInsensitiveBasePath), json, caseInsensitiveOrderingDiffersWithCaseHost, caseInsensitiveBasePath); - }); + baselineMatches("can include files in the same order on multiple platforms case sensitive", {}, caseSensitiveOrderingDiffersWithCaseHost, caseSensitiveBasePath); + baselineMatches("can include files in the same order on multiple platforms case insensitive", {}, caseInsensitiveOrderingDiffersWithCaseHost, caseInsensitiveBasePath); - it("when recursive symlinked directories are present", () => { + describe("when recursive symlinked directories are present", () => { const fs = new vfs.FileSystem(/*ignoreCase*/ true, { cwd: caseInsensitiveBasePath, files: { "c:/dev/index.ts": "" @@ -1529,16 +597,6 @@ describe("unittests:: config:: matchFiles", () => { fs.symlinkSync("c:/dev/a", "c:/dev/a/b/c/grandparent"); const host = new fakes.ParseConfigHost(fs); const json = {}; - const expected: ts.ParsedCommandLine = { - options: {}, - errors: [], - fileNames: [ - "c:/dev/index.ts" - ], - wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive - }, - }; - validateMatches(expected, json, host, caseInsensitiveBasePath); + baselineMatches("when recursive symlinked directories are present", json, host, caseInsensitiveBasePath); }); }); diff --git a/src/testRunner/unittests/config/projectReferences.ts b/src/testRunner/unittests/config/projectReferences.ts deleted file mode 100644 index e08d6d0f104..00000000000 --- a/src/testRunner/unittests/config/projectReferences.ts +++ /dev/null @@ -1,355 +0,0 @@ -import * as fakes from "../../_namespaces/fakes"; -import * as ts from "../../_namespaces/ts"; -import * as vfs from "../../_namespaces/vfs"; -import { libFile } from "../virtualFileSystemWithWatch"; - -interface TestProjectSpecification { - configFileName?: string; - references?: readonly (string | ts.ProjectReference)[]; - files: { [fileName: string]: string }; - outputFiles?: { [fileName: string]: string }; - config?: object; - options?: Partial; -} -interface TestSpecification { - [path: string]: TestProjectSpecification; -} - -function assertHasError(message: string, errors: readonly ts.Diagnostic[], diag: ts.DiagnosticMessage) { - if (!errors.some(e => e.code === diag.code)) { - const errorString = errors.map(e => ` ${e.file ? e.file.fileName : "[global]"}: ${e.messageText}`).join("\r\n"); - assert(false, `${message}: Did not find any diagnostic for ${diag.message} in:\r\n${errorString}`); - } -} - -function assertNoErrors(message: string, errors: readonly ts.Diagnostic[]) { - if (errors && errors.length > 0) { - assert(false, `${message}: Expected no errors, but found:\r\n${errors.map(e => ` ${e.messageText}`).join("\r\n")}`); - } -} - -function combineAllPaths(...paths: string[]) { - let result = paths[0]; - for (let i = 1; i < paths.length; i++) { - result = ts.combinePaths(result, paths[i]); - } - return result; -} - -const emptyModule = "export { };"; - -/** - * Produces the text of a source file which imports all of the - * specified module names - */ -function moduleImporting(...names: string[]) { - return names.map((n, i) => `import * as mod_${i} from ${n}`).join("\r\n"); -} - -function testProjectReferences(spec: TestSpecification, entryPointConfigFileName: string, checkResult: (prog: ts.Program, host: fakes.CompilerHost) => void) { - const files = new Map(); - for (const key in spec) { - const sp = spec[key]; - const configFileName = combineAllPaths("/", key, sp.configFileName || "tsconfig.json"); - const options = { - compilerOptions: { - composite: true, - outDir: "bin", - ...sp.options - }, - references: (sp.references || []).map(r => { - if (typeof r === "string") { - return { path: r }; - } - return r; - }), - ...sp.config - }; - const configContent = JSON.stringify(options); - const outDir = options.compilerOptions.outDir; - files.set(configFileName, configContent); - for (const sourceFile of Object.keys(sp.files)) { - files.set(sourceFile, sp.files[sourceFile]); - } - if (sp.outputFiles) { - for (const outFile of Object.keys(sp.outputFiles)) { - files.set(combineAllPaths("/", key, outDir, outFile), sp.outputFiles[outFile]); - } - } - } - - const vfsys = new vfs.FileSystem(false, { files: { "/lib.d.ts": libFile.content } }); - files.forEach((v, k) => { - vfsys.mkdirpSync(ts.getDirectoryPath(k)); - vfsys.writeFileSync(k, v); - }); - const host = new fakes.CompilerHost(new fakes.System(vfsys)); - - const { config, error } = ts.readConfigFile(entryPointConfigFileName, name => host.readFile(name)); - - // We shouldn't have any errors about invalid tsconfig files in these tests - assert(config && !error, ts.flattenDiagnosticMessageText(error && error.messageText, "\n")); - const file = ts.parseJsonConfigFileContent(config, ts.parseConfigHostFromCompilerHostLike(host), ts.getDirectoryPath(entryPointConfigFileName), {}, entryPointConfigFileName); - file.options.configFilePath = entryPointConfigFileName; - const prog = ts.createProgram({ - rootNames: file.fileNames, - options: file.options, - host, - projectReferences: file.projectReferences - }); - checkResult(prog, host); -} - -describe("unittests:: config:: project-references meta check", () => { - it("default setup was created correctly", () => { - const spec: TestSpecification = { - "/primary": { - files: { "/primary/a.ts": emptyModule }, - references: [] - }, - "/reference": { - files: { "/secondary/b.ts": moduleImporting("../primary/a") }, - references: ["../primary"] - } - }; - testProjectReferences(spec, "/primary/tsconfig.json", prog => { - assert.isTrue(!!prog, "Program should exist"); - assertNoErrors("Sanity check should not produce errors", prog.getOptionsDiagnostics()); - }); - }); -}); - -/** - * Validate that we enforce the basic settings constraints for referenced projects - */ -describe("unittests:: config:: project-references constraint checking for settings", () => { - it("errors when declaration = false", () => { - const spec: TestSpecification = { - "/primary": { - files: { "/primary/a.ts": emptyModule }, - references: [], - options: { - declaration: false - } - } - }; - - testProjectReferences(spec, "/primary/tsconfig.json", program => { - const errs = program.getOptionsDiagnostics(); - assertHasError("Reports an error about the wrong decl setting", errs, ts.Diagnostics.Composite_projects_may_not_disable_declaration_emit); - }); - }); - - it("errors when the referenced project doesn't have composite:true", () => { - const spec: TestSpecification = { - "/primary": { - files: { "/primary/a.ts": emptyModule }, - references: [], - options: { - composite: false - } - }, - "/reference": { - files: { "/secondary/b.ts": moduleImporting("../primary/a") }, - references: ["../primary"], - config: { - files: ["b.ts"] - } - } - }; - testProjectReferences(spec, "/reference/tsconfig.json", program => { - const errs = program.getOptionsDiagnostics(); - assertHasError("Reports an error about 'composite' not being set", errs, ts.Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true); - }); - }); - - it("does not error when the referenced project doesn't have composite:true if its a container project", () => { - const spec: TestSpecification = { - "/primary": { - files: { "/primary/a.ts": emptyModule }, - references: [], - options: { - composite: false - } - }, - "/reference": { - files: { "/secondary/b.ts": moduleImporting("../primary/a") }, - references: ["../primary"], - } - }; - testProjectReferences(spec, "/reference/tsconfig.json", program => { - const errs = program.getOptionsDiagnostics(); - assertNoErrors("Reports an error about 'composite' not being set", errs); - }); - }); - - it("errors when the file list is not exhaustive", () => { - const spec: TestSpecification = { - "/primary": { - files: { - "/primary/a.ts": "import * as b from './b'", - "/primary/b.ts": "export {}" - }, - config: { - files: ["a.ts"] - } - } - }; - - testProjectReferences(spec, "/primary/tsconfig.json", program => { - const errs = program.getSemanticDiagnostics(program.getSourceFile("/primary/a.ts")); - assertHasError("Reports an error about b.ts not being in the list", errs, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern); - }); - }); - - it("errors when the referenced project doesn't exist", () => { - const spec: TestSpecification = { - "/primary": { - files: { "/primary/a.ts": emptyModule }, - references: ["../foo"] - } - }; - testProjectReferences(spec, "/primary/tsconfig.json", program => { - const errs = program.getOptionsDiagnostics(); - assertHasError("Reports an error about a missing file", errs, ts.Diagnostics.File_0_not_found); - }); - }); - - it("errors when a prepended project reference doesn't set outFile", () => { - const spec: TestSpecification = { - "/primary": { - files: { "/primary/a.ts": emptyModule }, - references: [{ path: "../someProj", prepend: true }] - }, - "/someProj": { - files: { "/someProj/b.ts": "const x = 100;" } - } - }; - testProjectReferences(spec, "/primary/tsconfig.json", program => { - const errs = program.getOptionsDiagnostics(); - assertHasError("Reports an error about outFile not being set", errs, ts.Diagnostics.Cannot_prepend_project_0_because_it_does_not_have_outFile_set); - }); - }); - - it("errors when a prepended project reference output doesn't exist", () => { - const spec: TestSpecification = { - "/primary": { - files: { "/primary/a.ts": "const y = x;" }, - references: [{ path: "../someProj", prepend: true }] - }, - "/someProj": { - files: { "/someProj/b.ts": "const x = 100;" }, - options: { outFile: "foo.js" } - } - }; - testProjectReferences(spec, "/primary/tsconfig.json", program => { - const errs = program.getOptionsDiagnostics(); - assertHasError("Reports an error about outFile being missing", errs, ts.Diagnostics.Output_file_0_from_project_1_does_not_exist); - }); - }); -}); - -/** - * Path mapping behavior - */ -describe("unittests:: config:: project-references path mapping", () => { - it("redirects to the output .d.ts file", () => { - const spec: TestSpecification = { - "/alpha": { - files: { "/alpha/a.ts": "export const m: number = 3;" }, - references: [], - outputFiles: { "a.d.ts": emptyModule } - }, - "/beta": { - files: { "/beta/b.ts": "import { m } from '../alpha/a'" }, - references: ["../alpha"] - } - }; - testProjectReferences(spec, "/beta/tsconfig.json", program => { - assertNoErrors("File setup should be correct", program.getOptionsDiagnostics()); - assertHasError("Found a type error", program.getSemanticDiagnostics(), ts.Diagnostics.Module_0_has_no_exported_member_1); - }); - }); -}); - -describe("unittests:: config:: project-references nice-behavior", () => { - it("issues a nice error when the input file is missing", () => { - const spec: TestSpecification = { - "/alpha": { - files: { "/alpha/a.ts": "export const m: number = 3;" }, - references: [] - }, - "/beta": { - files: { "/beta/b.ts": "import { m } from '../alpha/a'" }, - references: ["../alpha"] - } - }; - testProjectReferences(spec, "/beta/tsconfig.json", program => { - assertHasError("Issues a useful error", program.getSemanticDiagnostics(), ts.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1); - }); - }); - - it("issues a nice error when the input file is missing when module reference is not relative", () => { - const spec: TestSpecification = { - "/alpha": { - files: { "/alpha/a.ts": "export const m: number = 3;" }, - references: [] - }, - "/beta": { - files: { "/beta/b.ts": "import { m } from '@alpha/a'" }, - references: ["../alpha"], - options: { - baseUrl: "./", - paths: { - "@alpha/*": ["/alpha/*"] - } - } - } - }; - testProjectReferences(spec, "/beta/tsconfig.json", program => { - assertHasError("Issues a useful error", program.getSemanticDiagnostics(), ts.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1); - }); - }); -}); - -/** - * 'composite' behavior - */ -describe("unittests:: config:: project-references behavior changes under composite: true", () => { - it("doesn't infer the rootDir from source paths", () => { - const spec: TestSpecification = { - "/alpha": { - files: { "/alpha/src/a.ts": "export const m: number = 3;" }, - options: { - declaration: true, - outDir: "bin" - }, - references: [] - } - }; - testProjectReferences(spec, "/alpha/tsconfig.json", (program, host) => { - program.emit(); - assert.deepEqual(host.outputs.map(e => e.file).sort(), ["/alpha/bin/src/a.d.ts", "/alpha/bin/src/a.js", "/alpha/bin/tsconfig.tsbuildinfo"]); - }); - }); -}); - -describe("unittests:: config:: project-references errors when a file in a composite project occurs outside the root", () => { - it("Errors when a file is outside the rootdir", () => { - const spec: TestSpecification = { - "/alpha": { - files: { "/alpha/src/a.ts": "import * from '../../beta/b'", "/beta/b.ts": "export { }" }, - options: { - declaration: true, - outDir: "bin" - }, - references: [] - } - }; - testProjectReferences(spec, "/alpha/tsconfig.json", (program) => { - const semanticDiagnostics = program.getSemanticDiagnostics(program.getSourceFile("/alpha/src/a.ts")); - assertHasError("Issues an error about the rootDir", semanticDiagnostics, ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files); - assertHasError("Issues an error about the fileList", semanticDiagnostics, ts.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern); - }); - }); -}); diff --git a/src/testRunner/unittests/config/tsconfigParsing.ts b/src/testRunner/unittests/config/tsconfigParsing.ts index db2a21c9e22..136fbb3a0b0 100644 --- a/src/testRunner/unittests/config/tsconfigParsing.ts +++ b/src/testRunner/unittests/config/tsconfigParsing.ts @@ -1,268 +1,224 @@ import * as fakes from "../../_namespaces/fakes"; +import * as Harness from "../../_namespaces/Harness"; import * as ts from "../../_namespaces/ts"; import * as vfs from "../../_namespaces/vfs"; +import { baselineParseConfig } from "./helpers"; describe("unittests:: config:: tsconfigParsing:: parseConfigFileTextToJson", () => { - function assertParseResult(jsonText: string, expectedConfigObject: { config?: any; error?: ts.Diagnostic[] }) { - const parsed = ts.parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); - assert.equal(JSON.stringify(parsed), JSON.stringify(expectedConfigObject)); + function formatErrors(errors: readonly ts.Diagnostic[]) { + return ts.formatDiagnosticsWithColorAndContext(errors, { + getCurrentDirectory: () => "/", + getCanonicalFileName: ts.identity, + getNewLine: () => "\n", + }); } - - function assertParseErrorWithExcludesKeyword(jsonText: string) { - { - const parsed = ts.parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); - const parsedCommand = ts.parseJsonConfigFileContent(parsed.config, ts.sys, "tests/cases/unittests"); - assert.isTrue(parsedCommand.errors && parsedCommand.errors.length === 1 && - parsedCommand.errors[0].code === ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude.code); - } - { - const parsed = ts.parseJsonText("/apath/tsconfig.json", jsonText); - const parsedCommand = ts.parseJsonSourceFileConfigFileContent(parsed, ts.sys, "tests/cases/unittests"); - assert.isTrue(parsedCommand.errors && parsedCommand.errors.length === 1 && - parsedCommand.errors[0].code === ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude.code); - } - } - - function getParsedCommandJson(jsonText: string, configFileName: string, basePath: string, allFileList: string[]) { - const parsed = ts.parseConfigFileTextToJson(configFileName, jsonText); - const files = allFileList.reduce((files, value) => (files[value] = "", files), {} as vfs.FileSet); - const host: ts.ParseConfigHost = new fakes.ParseConfigHost(new vfs.FileSystem(/*ignoreCase*/ false, { cwd: basePath, files: { "/": {}, ...files } })); - return ts.parseJsonConfigFileContent(parsed.config, host, basePath, /*existingOptions*/ undefined, configFileName); - } - - function getParsedCommandJsonNode(jsonText: string, configFileName: string, basePath: string, allFileList: string[]) { - const parsed = ts.parseJsonText(configFileName, jsonText); - const files = allFileList.reduce((files, value) => (files[value] = "", files), {} as vfs.FileSet); - const host: ts.ParseConfigHost = new fakes.ParseConfigHost(new vfs.FileSystem(/*ignoreCase*/ false, { cwd: basePath, files: { "/": {}, ...files } })); - return ts.parseJsonSourceFileConfigFileContent(parsed, host, basePath, /*existingOptions*/ undefined, configFileName); - } - - function assertParseFileList(jsonText: string, configFileName: string, basePath: string, allFileList: string[], expectedFileList: string[]) { - { - const parsed = getParsedCommandJson(jsonText, configFileName, basePath, allFileList); - assert.isTrue(ts.arrayIsEqualTo(parsed.fileNames.sort(), expectedFileList.sort())); - } - { - const parsed = getParsedCommandJsonNode(jsonText, configFileName, basePath, allFileList); - assert.isTrue(ts.arrayIsEqualTo(parsed.fileNames.sort(), expectedFileList.sort())); - } - } - - function assertParseFileDiagnostics(jsonText: string, configFileName: string, basePath: string, allFileList: string[], expectedDiagnosticCode: number, noLocation?: boolean) { - { - const parsed = getParsedCommandJson(jsonText, configFileName, basePath, allFileList); - assert.isTrue(parsed.errors.length >= 0); - assert.isTrue(parsed.errors.filter(e => e.code === expectedDiagnosticCode).length > 0, `Expected error code ${expectedDiagnosticCode} to be in ${JSON.stringify(parsed.errors)}`); - } - { - const parsed = getParsedCommandJsonNode(jsonText, configFileName, basePath, allFileList); - assert.isTrue(parsed.errors.length >= 0); - assert.isTrue(parsed.errors.filter(e => e.code === expectedDiagnosticCode).length > 0, `Expected error code ${expectedDiagnosticCode} to be in ${JSON.stringify(parsed.errors)}`); - if (!noLocation) { - assert.isTrue(parsed.errors.filter(e => e.code === expectedDiagnosticCode && e.file && e.start && e.length).length > 0, `Expected error code ${expectedDiagnosticCode} to be in ${JSON.stringify(parsed.errors)} with location information`); + function baselineParseResult(name: string, jsonTexts: () => string[]) { + it(name, () => { + const baseline: string[] = []; + for (const jsonText of jsonTexts()) { + baseline.push("Input::", jsonText); + const parsed = ts.parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); + baseline.push("Config::", JSON.stringify(parsed.config, /*replacer*/ undefined, " ")); + baseline.push("Errors::"); + baseline.push(formatErrors(parsed.error ? [parsed.error] : ts.emptyArray)); + baseline.push(""); } - } + Harness.Baseline.runBaseline(`config/tsconfigParsing/${name} jsonParse.js`, baseline.join("\n")); + }); } - function assertParseFileDiagnosticsExclusion(jsonText: string, configFileName: string, basePath: string, allFileList: string[], expectedExcludedDiagnosticCode: number) { - { - const parsed = getParsedCommandJson(jsonText, configFileName, basePath, allFileList); - assert.isTrue(parsed.errors.length >= 0); - assert.isTrue(parsed.errors.findIndex(e => e.code === expectedExcludedDiagnosticCode) === -1, `Expected error code ${expectedExcludedDiagnosticCode} to not be in ${JSON.stringify(parsed.errors)}`); - } - { - const parsed = getParsedCommandJsonNode(jsonText, configFileName, basePath, allFileList); - assert.isTrue(parsed.errors.length >= 0); - assert.isTrue(parsed.errors.findIndex(e => e.code === expectedExcludedDiagnosticCode) === -1, `Expected error code ${expectedExcludedDiagnosticCode} to not be in ${JSON.stringify(parsed.errors)}`); - } + interface VerifyConfig { + jsonText: string; + configFileName: string; + basePath: string; + allFileList: string[]; } - it("returns empty config for file with only whitespaces", () => { - assertParseResult("", { config : {} }); - assertParseResult(" ", { config : {} }); - }); + function baselinedParsed(subScenario: string, scenario: () => VerifyConfig[], skipJson?: true) { + baselineParseConfig({ + scenario: "tsconfigParsing", + subScenario, + input: () => scenario().map(({ jsonText, configFileName, basePath, allFileList }) => ({ + createHost: () => { + const files = allFileList.reduce((files, value) => (files[value] = "", files), {} as vfs.FileSet); + files[ts.combinePaths(basePath, configFileName)] = jsonText; + return new fakes.ParseConfigHost(new vfs.FileSystem( + /*ignoreCase*/ false, + { + cwd: basePath, + files: { "/": {}, ...files } + })); + }, + jsonText, + configFileName, + basePath, + baselineParsed: (baseline, parsed) => { + baseline.push("FileNames::"); + baseline.push(parsed.fileNames.join()); + }, + })), + skipJson + }); + } - it("returns empty config for file with comments only", () => { - assertParseResult("// Comment", { config: {} }); - assertParseResult("/* Comment*/", { config: {} }); - }); + baselineParseResult("returns empty config for file with only whitespaces", () => [ + "", + " ", + ]); - it("returns empty config when config is empty object", () => { - assertParseResult("{}", { config: {} }); - }); + baselineParseResult("returns empty config for file with comments only", () => [ + "// Comment", + "/* Comment*/", + ]); - it("returns config object without comments", () => { - assertParseResult( - `{ // Excluded files - "exclude": [ - // Exclude d.ts - "file.d.ts" - ] - }`, { config: { exclude: ["file.d.ts"] } }); + baselineParseResult("returns empty config when config is empty object", () => [ + "{}" + ]); - assertParseResult( - `{ - /* Excluded - Files - */ - "exclude": [ - /* multiline comments can be in the middle of a line */"file.d.ts" - ] - }`, { config: { exclude: ["file.d.ts"] } }); - }); + baselineParseResult("returns config object without comments", () => [ + `{ // Excluded files + "exclude": [ + // Exclude d.ts + "file.d.ts" + ] + }`, + `{ + /* Excluded + Files + */ + "exclude": [ + /* multiline comments can be in the middle of a line */"file.d.ts" + ] + }`, + ]); - it("keeps string content untouched", () => { - assertParseResult( - `{ - "exclude": [ - "xx//file.d.ts" - ] - }`, { config: { exclude: ["xx//file.d.ts"] } }); - assertParseResult( - `{ - "exclude": [ - "xx/*file.d.ts*/" - ] - }`, { config: { exclude: ["xx/*file.d.ts*/"] } }); - }); + baselineParseResult("keeps string content untouched", () => [ + `{ + "exclude": [ + "xx//file.d.ts" + ] + }`, + `{ + "exclude": [ + "xx/*file.d.ts*/" + ] + }`, + ]); - it("handles escaped characters in strings correctly", () => { - assertParseResult( - `{ - "exclude": [ - "xx\\"//files" - ] - }`, { config: { exclude: ["xx\"//files"] } }); + baselineParseResult("handles escaped characters in strings correctly", () => [ + `{ + "exclude": [ + "xx\\"//files" + ] + }`, + `{ + "exclude": [ + "xx\\\\" // end of line comment + ] + }`, + ]); - assertParseResult( - `{ - "exclude": [ - "xx\\\\" // end of line comment - ] - }`, { config: { exclude: ["xx\\"] } }); - }); + baselineParseResult("returns object with error when json is invalid", () => [ + "invalid", + ]); - it("returns object with error when json is invalid", () => { - const parsed = ts.parseConfigFileTextToJson("/apath/tsconfig.json", "invalid"); - assert.deepEqual(parsed.config, {}); - const expected = ts.createCompilerDiagnostic(ts.Diagnostics._0_expected, "{"); - const error = parsed.error!; - assert.equal(error.messageText, expected.messageText); - assert.equal(error.category, expected.category); - assert.equal(error.code, expected.code); - assert.equal(error.start, 0); - assert.equal(error.length, "invalid".length); - }); + baselineParseResult("returns object when users correctly specify library", () => [ + `{ + "compilerOptions": { + "lib": ["es5"] + } + }`, + `{ + "compilerOptions": { + "lib": ["es5", "es6"] + } + }`, + ]); - it("returns object when users correctly specify library", () => { - assertParseResult( - `{ - "compilerOptions": { - "lib": ["es5"] - } - }`, { - config: { compilerOptions: { lib: ["es5"] } } - }); - - assertParseResult( - `{ - "compilerOptions": { - "lib": ["es5", "es6"] - } - }`, { - config: { compilerOptions: { lib: ["es5", "es6"] } } - }); - }); - - it("returns error when tsconfig have excludes", () => { - assertParseErrorWithExcludesKeyword( - `{ + baselinedParsed("returns error when tsconfig have excludes", () => [{ + jsonText: `{ "compilerOptions": { "lib": ["es5"] }, "excludes": [ "foge.ts" ] - }`); - }); + }`, + configFileName: "tsconfig.json", + basePath: "/apath", + allFileList: ["/apath/test.ts", "/apath/foge.ts"], + }]); - it("ignore dotted files and folders", () => { - assertParseFileList( - `{}`, - "tsconfig.json", - "/apath", - ["/apath/test.ts", "/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"], - ["/apath/test.ts"] - ); - }); + baselinedParsed("ignore dotted files and folders", () => [{ + jsonText: `{}`, + configFileName: "tsconfig.json", + basePath: "/apath", + allFileList: ["/apath/test.ts", "/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"], + }]); - it("allow dotted files and folders when explicitly requested", () => { - assertParseFileList( - `{ + baselinedParsed("allow dotted files and folders when explicitly requested", () => [{ + jsonText: `{ "files": ["/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"] }`, - "tsconfig.json", - "/apath", - ["/apath/test.ts", "/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"], - ["/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"] - ); - }); + configFileName: "tsconfig.json", + basePath: "/apath", + allFileList: ["/apath/test.ts", "/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"], + }]); - it("exclude outDir unless overridden", () => { + baselinedParsed("exclude outDir unless overridden", () => { const tsconfigWithoutExclude = - `{ + `{ "compilerOptions": { "outDir": "bin" } }`; const tsconfigWithExclude = - `{ + `{ "compilerOptions": { "outDir": "bin" }, "exclude": [ "obj" ] }`; - const rootDir = "/"; - const allFiles = ["/bin/a.ts", "/b.ts"]; - const expectedFiles = ["/b.ts"]; - assertParseFileList(tsconfigWithoutExclude, "tsconfig.json", rootDir, allFiles, expectedFiles); - assertParseFileList(tsconfigWithExclude, "tsconfig.json", rootDir, allFiles, allFiles); + const basePath = "/"; + const allFileList = ["/bin/a.ts", "/b.ts"]; + return [ + { jsonText: tsconfigWithoutExclude, configFileName: "tsconfig.json", basePath, allFileList }, + { jsonText: tsconfigWithExclude, configFileName: "tsconfig.json", basePath, allFileList }, + ]; }); - it("exclude declarationDir unless overridden", () => { + baselinedParsed("exclude declarationDir unless overridden", () => { const tsconfigWithoutExclude = - `{ + `{ "compilerOptions": { "declarationDir": "declarations" } }`; const tsconfigWithExclude = - `{ + `{ "compilerOptions": { "declarationDir": "declarations" }, "exclude": [ "types" ] }`; - const rootDir = "/"; - const allFiles = ["/declarations/a.d.ts", "/a.ts"]; - const expectedFiles = ["/a.ts"]; - - assertParseFileList(tsconfigWithoutExclude, "tsconfig.json", rootDir, allFiles, expectedFiles); - assertParseFileList(tsconfigWithExclude, "tsconfig.json", rootDir, allFiles, allFiles); + const basePath = "/"; + const allFileList = ["/declarations/a.d.ts", "/a.ts"]; + return [ + { jsonText: tsconfigWithoutExclude, configFileName: "tsconfig.json", basePath, allFileList }, + { jsonText: tsconfigWithExclude, configFileName: "tsconfig.json", basePath, allFileList }, + ]; }); - it("implicitly exclude common package folders", () => { - assertParseFileList( - `{}`, - "tsconfig.json", - "/", - ["/node_modules/a.ts", "/bower_components/b.ts", "/jspm_packages/c.ts", "/d.ts", "/folder/e.ts"], - ["/d.ts", "/folder/e.ts"] - ); - }); + baselinedParsed("implicitly exclude common package folders", () => [{ + jsonText: `{}`, + configFileName: "tsconfig.json", + basePath: "/", + allFileList: ["/node_modules/a.ts", "/bower_components/b.ts", "/jspm_packages/c.ts", "/d.ts", "/folder/e.ts"], + }]); it("parse and re-emit tsconfig.json file with diagnostics", () => { + const baseline: string[] = []; const content = `{ "compilerOptions": { "allowJs": true @@ -271,166 +227,157 @@ describe("unittests:: config:: tsconfigParsing:: parseConfigFileTextToJson", () } "files": ["file1.ts"] }`; + baseline.push("Initial::", content); const result = ts.parseJsonText("config.json", content); - const diagnostics = result.parseDiagnostics; - const configJsonObject = ts.convertToObject(result, diagnostics); - const expectedResult = { - compilerOptions: { - allowJs: true, - outDir: "bin" - }, - files: ["file1.ts"] - }; - assert.isTrue(diagnostics.length === 2); - assert.equal(JSON.stringify(configJsonObject), JSON.stringify(expectedResult)); + const configJsonObject = ts.convertToObject(result, result.parseDiagnostics); + baseline.push("Result::", JSON.stringify(configJsonObject, undefined, " ")); + baseline.push("Errors::", formatErrors(result.parseDiagnostics)); + Harness.Baseline.runBaseline(`config/tsconfigParsing/parse and re-emit tsconfig.json file with diagnostics.js`, baseline.join("\n")); }); - it("generates errors for empty files list", () => { - const content = `{ + baselinedParsed("generates errors for empty files list", () => [{ + jsonText: `{ "files": [] - }`; - assertParseFileDiagnostics(content, - "/apath/tsconfig.json", - "tests/cases/unittests", - ["/apath/a.ts"], - ts.Diagnostics.The_files_list_in_config_file_0_is_empty.code); - }); + }`, + configFileName: "/apath/tsconfig.json", + basePath: "tests/cases/unittests", + allFileList: ["/apath/a.ts"], + }]); - it("generates errors for empty files list when no references are provided", () => { - const content = `{ + baselinedParsed("generates errors for empty files list when no references are provided", () => [{ + jsonText: `{ "files": [], "references": [] - }`; - assertParseFileDiagnostics(content, - "/apath/tsconfig.json", - "tests/cases/unittests", - ["/apath/a.ts"], - ts.Diagnostics.The_files_list_in_config_file_0_is_empty.code); - }); + }`, + configFileName: "/apath/tsconfig.json", + basePath: "tests/cases/unittests", + allFileList: ["/apath/a.ts"], + }]); - it("does not generate errors for empty files list when one or more references are provided", () => { - const content = `{ + baselinedParsed("does not generate errors for empty files list when one or more references are provided", () => [{ + jsonText: `{ "files": [], "references": [{ "path": "/apath" }] - }`; - assertParseFileDiagnosticsExclusion(content, - "/apath/tsconfig.json", - "tests/cases/unittests", - ["/apath/a.ts"], - ts.Diagnostics.The_files_list_in_config_file_0_is_empty.code); - }); + }`, + configFileName: "/apath/tsconfig.json", + basePath: "tests/cases/unittests", + allFileList: ["/apath/a.ts"], + }]); - it("generates errors for directory with no .ts files", () => { - const content = `{ - }`; - assertParseFileDiagnostics(content, - "/apath/tsconfig.json", - "tests/cases/unittests", - ["/apath/a.js"], - ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code, - /*noLocation*/ true); - }); + baselinedParsed("generates errors for directory with no .ts files", () => [{ + jsonText: `{ + }`, + configFileName: "/apath/tsconfig.json", + basePath: "tests/cases/unittests", + allFileList: ["/apath/a.js"], + }]); - it("generates errors for empty directory", () => { - const content = `{ + baselinedParsed("generates errors for empty directory", () => [{ + jsonText: `{ "compilerOptions": { "allowJs": true } - }`; - assertParseFileDiagnostics(content, - "/apath/tsconfig.json", - "tests/cases/unittests", - [], - ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code, - /*noLocation*/ true); - }); + }`, + configFileName: "/apath/tsconfig.json", + basePath: "tests/cases/unittests", + allFileList: [], + }]); - it("generates errors for empty include", () => { - const content = `{ + baselinedParsed("generates errors for empty include", () => [{ + jsonText: `{ "include": [] - }`; - assertParseFileDiagnostics(content, - "/apath/tsconfig.json", - "tests/cases/unittests", - ["/apath/a.ts"], - ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code, - /*noLocation*/ true); - }); + }`, + configFileName: "/apath/tsconfig.json", + basePath: "tests/cases/unittests", + allFileList: ["/apath/a.ts"], + }]); - it("generates errors for includes with outDir", () => { - const content = `{ + baselinedParsed("generates errors for includes with outDir", () => [{ + jsonText: `{ "compilerOptions": { "outDir": "./" }, "include": ["**/*"] - }`; - assertParseFileDiagnostics(content, - "/apath/tsconfig.json", - "tests/cases/unittests", - ["/apath/a.ts"], - ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code, - /*noLocation*/ true); - }); + }`, + configFileName: "/apath/tsconfig.json", + basePath: "tests/cases/unittests", + allFileList: ["/apath/a.ts"], + }]); - - it("generates errors for when invalid comment type present in tsconfig", () => { - const jsonText = `{ + baselinedParsed("generates errors for when invalid comment type present in tsconfig", () => [{ + jsonText: `{ "compilerOptions": { ## this comment does cause issues "types" : [ ] } - }`; - const parsed = getParsedCommandJsonNode(jsonText, "/apath/tsconfig.json", "tests/cases/unittests", ["/apath/a.ts"]); - assert.isTrue(parsed.errors.length >= 0); - }); + }`, + configFileName: "/apath/tsconfig.json", + basePath: "tests/cases/unittests", + allFileList: ["/apath/a.ts"], + }], /*skipJson*/ true); - it("generates errors when files is not string", () => { - assertParseFileDiagnostics( - JSON.stringify({ - files: [{ - compilerOptions: { - experimentalDecorators: true, - allowJs: true - } - }] - }), - "/apath/tsconfig.json", - "tests/cases/unittests", - ["/apath/a.ts"], - ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1.code, - /*noLocation*/ true); - }); + baselinedParsed("generates errors when files is not string", () => [{ + jsonText: JSON.stringify({ + files: [{ + compilerOptions: { + experimentalDecorators: true, + allowJs: true + } + }] + }), + configFileName: "/apath/tsconfig.json", + basePath: "tests/cases/unittests", + allFileList: ["/apath/a.ts"], + }]); - it("generates errors when include is not string", () => { - assertParseFileDiagnostics( - JSON.stringify({ - include: [ - ["./**/*.ts"] - ] - }), - "/apath/tsconfig.json", - "tests/cases/unittests", - ["/apath/a.ts"], - ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1.code, - /*noLocation*/ true); - }); + baselinedParsed("generates errors when include is not string", () => [{ + jsonText: JSON.stringify({ + include: [ + ["./**/*.ts"] + ] + }), + configFileName: "/apath/tsconfig.json", + basePath: "tests/cases/unittests", + allFileList: ["/apath/a.ts"], + }]); - it("parses wildcard directories even when parent directories have dots", () => { - const parsed = ts.parseConfigFileTextToJson("/foo.bar/tsconfig.json", JSON.stringify({ + function baselineWildcards(subScenario: string, scenario: () => { configFileName: string, jsonText: string, basePath: string }[]) { + baselineParseConfig({ + scenario: "tsconfigParsing", + subScenario, + input: () => scenario().map(({ jsonText, configFileName, basePath }) => ({ + createHost: () => new fakes.ParseConfigHost(new vfs.FileSystem(/*ignoreCase*/ false, { + cwd: basePath, + files: { [configFileName]: jsonText } + })), + jsonText, + configFileName, + basePath, + baselineParsed: (baseline, parsed) => { + baseline.push("Wildcards::"); + ts.getOwnKeys(parsed.wildcardDirectories!).forEach(dir => + baseline.push(`${dir}: WatchDirectoryFlags.${(ts as any).WatchDirectoryFlags[parsed.wildcardDirectories![dir]]}`) + ); + }, + })), + skipErrors: true, + }); + } + + baselineWildcards("parses wildcard directories even when parent directories have dots", () => [{ + configFileName: "/foo.bar/tsconfig.json", + jsonText: JSON.stringify({ include: ["src"] - })); + }), + basePath: "/foo.bar", + }]); - const parsedCommand = ts.parseJsonConfigFileContent(parsed.config, ts.sys, "/foo.bar"); - assert.deepEqual(parsedCommand.wildcardDirectories, { "/foo.bar/src": ts.WatchDirectoryFlags.Recursive }); - }); - - it("correctly parses wild card directories from implicit glob when two keys differ only in directory seperator", () => { - const parsed = ts.parseConfigFileTextToJson("/foo.bar/tsconfig.json", JSON.stringify({ + baselineWildcards("correctly parses wild card directories from implicit glob when two keys differ only in directory seperator", () => [{ + configFileName: "/foo.bar/tsconfig.json", + jsonText: JSON.stringify({ include: ["./", "./**/*.json"] - })); - - const parsedCommand = ts.parseJsonConfigFileContent(parsed.config, ts.sys, "/foo"); - assert.deepEqual(parsedCommand.wildcardDirectories, { "/foo": ts.WatchDirectoryFlags.Recursive }); - }); + }), + basePath: "/foo", + }]); }); diff --git a/src/testRunner/unittests/config/tsconfigParsingWatchOptions.ts b/src/testRunner/unittests/config/tsconfigParsingWatchOptions.ts index fd476c1748a..e87053dd5f5 100644 --- a/src/testRunner/unittests/config/tsconfigParsingWatchOptions.ts +++ b/src/testRunner/unittests/config/tsconfigParsingWatchOptions.ts @@ -1,49 +1,9 @@ import * as fakes from "../../_namespaces/fakes"; -import * as Harness from "../../_namespaces/Harness"; import * as ts from "../../_namespaces/ts"; import * as vfs from "../../_namespaces/vfs"; +import { baselineParseConfig } from "./helpers"; describe("unittests:: config:: tsconfigParsingWatchOptions:: parseConfigFileTextToJson", () => { - function createParseConfigHost(additionalFiles?: vfs.FileSet) { - return new fakes.ParseConfigHost( - new vfs.FileSystem( - /*ignoreCase*/ false, - { - cwd: "/", - files: { "/": {}, "/a.ts": "", ...additionalFiles } - } - ) - ); - } - function getParsedCommandJson(json: object, additionalFiles?: vfs.FileSet, existingWatchOptions?: ts.WatchOptions) { - return ts.parseJsonConfigFileContent( - json, - createParseConfigHost(additionalFiles), - "/", - /*existingOptions*/ undefined, - "tsconfig.json", - /*resolutionStack*/ undefined, - /*extraFileExtensions*/ undefined, - /*extendedConfigCache*/ undefined, - existingWatchOptions, - ); - } - - function getParsedCommandJsonNode(json: object, additionalFiles?: vfs.FileSet, existingWatchOptions?: ts.WatchOptions) { - const parsed = ts.parseJsonText("tsconfig.json", JSON.stringify(json)); - return ts.parseJsonSourceFileConfigFileContent( - parsed, - createParseConfigHost(additionalFiles), - "/", - /*existingOptions*/ undefined, - "tsconfig.json", - /*resolutionStack*/ undefined, - /*extraFileExtensions*/ undefined, - /*extendedConfigCache*/ undefined, - existingWatchOptions, - ); - } - interface VerifyWatchOptions { json: object; additionalFiles?: vfs.FileSet; @@ -51,37 +11,35 @@ describe("unittests:: config:: tsconfigParsingWatchOptions:: parseConfigFileText } function verifyWatchOptions(subScenario: string, scenario: () => VerifyWatchOptions[]) { - describe(subScenario, () => { - it("with json api", () => { - const baseline: string[] = []; - for (const { json, additionalFiles, existingWatchOptions } of scenario()) { - addToBaseLine(baseline, json, getParsedCommandJson(json, additionalFiles, existingWatchOptions)); - } - runBaseline(`${subScenario} with json api`, baseline); - }); - - it("with json source file api", () => { - const baseline: string[] = []; - for (const { json, additionalFiles, existingWatchOptions, } of scenario()) { - addToBaseLine(baseline, json, getParsedCommandJsonNode(json, additionalFiles, existingWatchOptions)); - } - runBaseline(`${subScenario} with jsonSourceFile api`, baseline); - }); + baselineParseConfig({ + scenario: "tsconfigParsingWatchOptions", + subScenario, + input: () => scenario().map(({ json, additionalFiles, existingWatchOptions }) => { + const jsonText = JSON.stringify(json, undefined, " "); + return { + createHost: () => new fakes.ParseConfigHost( + new vfs.FileSystem( + /*ignoreCase*/ false, + { + cwd: "/", + files: { + "/a.ts": "", + ...additionalFiles, + "/tsconfig.json": jsonText, + } + } + ) + ), + jsonText, + configFileName: "tsconfig.json", + existingWatchOptions, + baselineParsed: (baseline, parsed) => { + baseline.push(`Result: WatchOptions::`); + baseline.push(JSON.stringify(parsed.watchOptions, undefined, " ")); + }, + }; + }), }); - function addToBaseLine(baseline: string[], json: object, parsed: ts.ParsedCommandLine) { - baseline.push(`Input:: ${JSON.stringify(json, /*replacer*/ undefined, " ")}`); - baseline.push(`Result: WatchOptions::`); - baseline.push(JSON.stringify(parsed.watchOptions, /*replacer*/ undefined, " ")); - baseline.push(`Result: Errors::`); - baseline.push(ts.formatDiagnosticsWithColorAndContext(parsed.errors, { - getCurrentDirectory: () => "/", - getCanonicalFileName: ts.identity, - getNewLine: () => "\n" - })); - } - function runBaseline(subScenario: string, baseline: readonly string[]) { - Harness.Baseline.runBaseline(`config/tsconfigParsingWatchOptions/${subScenario}.js`, baseline.join("\n")); - } } verifyWatchOptions("no watchOptions specified option", () => [{ diff --git a/src/testRunner/unittests/tsc/projectReferencesConfig.ts b/src/testRunner/unittests/tsc/projectReferencesConfig.ts new file mode 100644 index 00000000000..17b26e89285 --- /dev/null +++ b/src/testRunner/unittests/tsc/projectReferencesConfig.ts @@ -0,0 +1,253 @@ +import * as ts from "../../_namespaces/ts"; +import { loadProjectFromFiles, verifyTsc } from "./helpers"; + +function emptyModule() { + return "export { };"; +} + +/** + * Produces the text of a source file which imports all of the + * specified module names + */ +function moduleImporting(...names: string[]) { + return names.map((n, i) => `import * as mod_${i} from "${n}"`).join("\r\n"); +} + +function getConfig({ references, options, config }: { + references?: (string | ts.ProjectReference)[]; + options?: ts.CompilerOptions; + config?: object +} = {}) { + return JSON.stringify({ + compilerOptions: { + composite: true, + outDir: "bin", + ...options + }, + references: references?.map(r => { + if (typeof r === "string") { + return { path: r }; + } + return r; + }) || [], + ...config, + }, undefined, " "); +} + +describe("unittests:: config:: project-references meta check", () => { + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "default setup was created correctly", + fs: () => loadProjectFromFiles({ + "/primary/tsconfig.json": getConfig(), + "/primary/a.ts": emptyModule(), + "/secondary/tsconfig.json": getConfig({ + references: ["../primary"] + }), + "/secondary/b.ts": moduleImporting("../primary/a"), + }), + commandLineArgs: ["--p", "/primary/tsconfig.json"] + }); +}); + +/** + * Validate that we enforce the basic settings constraints for referenced projects + */ +describe("unittests:: config:: project-references constraint checking for settings", () => { + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "errors when declaration = false", + fs: () => loadProjectFromFiles({ + "/primary/tsconfig.json": getConfig({ + options: { + declaration: false + } + }), + "/primary/a.ts": emptyModule(), + }), + commandLineArgs: ["--p", "/primary/tsconfig.json"] + }); + + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "errors when the referenced project doesnt have composite", + fs: () => loadProjectFromFiles({ + "/primary/tsconfig.json": getConfig({ + options: { + composite: false + } + }), + "/primary/a.ts": emptyModule(), + "/reference/tsconfig.json": getConfig({ + references: ["../primary"], + config: { + files: ["b.ts"] + } + }), + "/reference/b.ts": moduleImporting("../primary/a"), + }), + commandLineArgs: ["--p", "/reference/tsconfig.json"] + }); + + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "does not error when the referenced project doesnt have composite if its a container project", + fs: () => loadProjectFromFiles({ + "/primary/tsconfig.json": getConfig({ + options: { + composite: false + } + }), + "/primary/a.ts": emptyModule(), + "/reference/tsconfig.json": getConfig({ + references: ["../primary"], + config: { + files: [] + } + }), + "/reference/b.ts": moduleImporting("../primary/a"), + }), + commandLineArgs: ["--p", "/reference/tsconfig.json"] + }); + + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "errors when the file list is not exhaustive", + fs: () => loadProjectFromFiles({ + "/primary/tsconfig.json": getConfig({ + config: { + files: ["a.ts"] + } + }), + "/primary/a.ts": "import * as b from './b'", + "/primary/b.ts": "export {}", + }), + commandLineArgs: ["--p", "/primary/tsconfig.json"] + }); + + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "errors when the referenced project doesnt exist", + fs: () => loadProjectFromFiles({ + "/primary/tsconfig.json": getConfig({ + references: ["../foo"] + }), + "/primary/a.ts": emptyModule(), + }), + commandLineArgs: ["--p", "/primary/tsconfig.json"] + }); + + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "errors when a prepended project reference doesnt set outFile", + fs: () => loadProjectFromFiles({ + "/primary/tsconfig.json": getConfig({ + references: [{ path: "../someProj", prepend: true }], + }), + "/primary/a.ts": emptyModule(), + "/someProj/tsconfig.json": getConfig(), + "/someProj/b.ts": "const x = 100;", + }), + commandLineArgs: ["--p", "/primary/tsconfig.json", "--ignoreDeprecations", "5.0"] + }); + + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "errors when a prepended project reference output doesnt exist", + fs: () => loadProjectFromFiles({ + "/primary/tsconfig.json": getConfig({ + references: [{ path: "../someProj", prepend: true }], + }), + "/primary/a.ts": "const y = x;", + "/someProj/tsconfig.json": getConfig({ + options: { outFile: "foo.js" } + }), + "/someProj/b.ts": "const x = 100;", + }), + commandLineArgs: ["--p", "/primary/tsconfig.json", "--ignoreDeprecations", "5.0"] + }); +}); + +/** + * Path mapping behavior + */ +describe("unittests:: config:: project-references path mapping", () => { + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "redirects to the output dts file", + fs: () => loadProjectFromFiles({ + "/alpha/tsconfig.json": getConfig(), + "/alpha/a.ts": "export const m: number = 3;", + "/alpha/bin/a.d.ts": emptyModule(), + "/beta/tsconfig.json": getConfig({ + references: ["../alpha"] + }), + "/beta/b.ts": "import { m } from '../alpha/a'", + }), + commandLineArgs: ["--p", "/beta/tsconfig.json", "--explainFiles"] + }); +}); + +describe("unittests:: config:: project-references nice-behavior", () => { + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "issues a nice error when the input file is missing", + fs: () => loadProjectFromFiles({ + "/alpha/tsconfig.json": getConfig(), + "/alpha/a.ts": "export const m: number = 3;", + "/beta/tsconfig.json": getConfig({ + references: ["../alpha"] + }), + "/beta/b.ts": "import { m } from '../alpha/a'", + }), + commandLineArgs: ["--p", "/beta/tsconfig.json"] + }); + + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "issues a nice error when the input file is missing when module reference is not relative", + fs: () => loadProjectFromFiles({ + "/alpha/tsconfig.json": getConfig(), + "/alpha/a.ts": "export const m: number = 3;", + "/beta/tsconfig.json": getConfig({ + references: ["../alpha"], + options: { + baseUrl: "./", + paths: { + "@alpha/*": ["/alpha/*"] + } + } + }), + "/beta/b.ts": "import { m } from '@alpha/a'", + }), + commandLineArgs: ["--p", "/beta/tsconfig.json"] + }); +}); + +/** + * 'composite' behavior + */ +describe("unittests:: config:: project-references behavior changes under composite: true", () => { + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "doesnt infer the rootDir from source paths", + fs: () => loadProjectFromFiles({ + "/alpha/tsconfig.json": getConfig(), + "/alpha/src/a.ts": "export const m: number = 3;", + }), + commandLineArgs: ["--p", "/alpha/tsconfig.json"] + }); +}); + +describe("unittests:: config:: project-references errors when a file in a composite project occurs outside the root", () => { + verifyTsc({ + scenario: "projectReferencesConfig", + subScenario: "errors when a file is outside the rootdir", + fs: () => loadProjectFromFiles({ + "/alpha/tsconfig.json": getConfig(), + "/alpha/src/a.ts": "import * as b from '../../beta/b'", + "/beta/b.ts": "export { }", + }), + commandLineArgs: ["--p", "/alpha/tsconfig.json"] + }); +}); diff --git a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case insensitive host.js b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case insensitive host.js new file mode 100644 index 00000000000..25df25570d0 --- /dev/null +++ b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case insensitive host.js @@ -0,0 +1,157 @@ +Fs:: +//// [c:/dev/circular.json] +{"extends":"./circular2","compilerOptions":{"module":"amd"}} + +//// [c:/dev/circular2.json] +{"extends":"./circular","compilerOptions":{"module":"commonjs"}} + +//// [c:/dev/configs/base.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [c:/dev/configs/extendsArrayFifth.json] +{"extends":["./extendsArrayFirst","./extendsArraySecond","./extendsArrayThird","./extendsArrayFourth"],"files":[]} + +//// [c:/dev/configs/extendsArrayFirst.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [c:/dev/configs/extendsArrayFourth.json] +{"compilerOptions":{"module":"system","strictNullChecks":false},"include":null,"files":["../main.ts"]} + +//// [c:/dev/configs/extendsArraySecond.json] +{"compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [c:/dev/configs/extendsArrayThird.json] +{"compilerOptions":{"module":null,"noImplicitAny":false},"extends":"./extendsArrayFirst","include":["../supplemental.*"]} + +//// [c:/dev/configs/fifth.json] +{"extends":"./fourth","include":["../tests/utils.ts"],"files":[]} + +//// [c:/dev/configs/first.json] +{"extends":"./base","compilerOptions":{"module":"commonjs"},"files":["../main.ts"]} + +//// [c:/dev/configs/fourth.json] +{"extends":"./third","compilerOptions":{"module":"system"},"include":null,"files":["../main.ts"]} + +//// [c:/dev/configs/second.json] +{"extends":"./base","compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [c:/dev/configs/tests.json] +{"compilerOptions":{"preserveConstEnums":true,"removeComments":false,"sourceMap":true},"exclude":["../tests/baselines","../tests/scenarios"],"include":["../tests/**/*.ts"]} + +//// [c:/dev/configs/third.json] +{"extends":"./second","compilerOptions":{"module":null},"include":["../supplemental.*"]} + +//// [c:/dev/extends.json] +{"extends":42} + +//// [c:/dev/extends2.json] +{"extends":"configs/base"} + +//// [c:/dev/extends3.json] +{"extends":""} + +//// [c:/dev/extends4.json] +{"extends":[""]} + +//// [c:/dev/extendsArrayFails.json] +{"extends":["./missingFile"],"compilerOptions":{"types":[]}} + +//// [c:/dev/extendsArrayFails2.json] +{"extends":[42]} + +//// [c:/dev/failure.json] +{"extends":"./failure2.json","compilerOptions":{"typeRoots":[]}} + +//// [c:/dev/failure2.json] +{"excludes":["*.js"]} + +//// [c:/dev/main.ts] + + +//// [c:/dev/missing.json] +{"extends":"./missing2","compilerOptions":{"types":[]}} + +//// [c:/dev/node_modules/@foo/tsconfig/package.json] +{"name":"@foo/tsconfig","version":"1.0.0","exports":{".":"./src/tsconfig.json"}} + +//// [c:/dev/node_modules/@foo/tsconfig/src/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box/package.json] +{"name":"config-box","version":"1.0.0","tsconfig":"./strict.json"} + +//// [c:/dev/node_modules/config-box/strict.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box/unstrict.json] +{"compilerOptions":{"strict":false}} + +//// [c:/dev/node_modules/config-box-implied/package.json] +{"name":"config-box-implied","version":"1.0.0"} + +//// [c:/dev/node_modules/config-box-implied/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box-implied/unstrict/tsconfig.json] +{"compilerOptions":{"strict":false}} + +//// [c:/dev/supplemental.ts] + + +//// [c:/dev/tests/baselines/first/output.ts] + + +//// [c:/dev/tests/scenarios/first.json] + + +//// [c:/dev/tests/unit/spec.ts] + + +//// [c:/dev/tests/utils.ts] + + +//// [c:/dev/tsconfig.extendsBox.json] +{"extends":"config-box","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImplied.json] +{"extends":"config-box-implied","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedPath.json] +{"extends":"config-box-implied/tsconfig.json","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedUnstrict.json] +{"extends":"config-box-implied/unstrict","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json] +{"extends":"config-box-implied/unstrict/tsconfig","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsFoo.json] +{"extends":"@foo/tsconfig","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsStrict.json] +{"extends":"config-box/strict","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsStrictExtension.json] +{"extends":"config-box/strict.json","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsUnStrict.json] +{"extends":"config-box/unstrict","files":["main.ts"]} + +//// [c:/dev/tsconfig.json] +{"extends":"./configs/base","files":["main.ts","supplemental.ts"]} + +//// [c:/dev/tsconfig.nostrictnull.json] +{"extends":"./tsconfig","compilerOptions":{"strictNullChecks":false}} + + +configFileName:: adds extendedSourceFiles from an array only once +ExtendedSourceFiles:: +c:/dev/configs/extendsArrayFirst.json +c:/dev/configs/extendsArraySecond.json +c:/dev/configs/extendsArrayThird.json +c:/dev/configs/extendsArrayFourth.json +After reusing sourceFile ExtendedSourceFiles:: +c:/dev/configs/extendsArrayFirst.json +c:/dev/configs/extendsArraySecond.json +c:/dev/configs/extendsArrayThird.json +c:/dev/configs/extendsArrayFourth.json \ No newline at end of file diff --git a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case sensitive host.js b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case sensitive host.js new file mode 100644 index 00000000000..8abed829c15 --- /dev/null +++ b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles from an array only once under a case sensitive host.js @@ -0,0 +1,157 @@ +Fs:: +//// [/dev/circular.json] +{"extends":"./circular2","compilerOptions":{"module":"amd"}} + +//// [/dev/circular2.json] +{"extends":"./circular","compilerOptions":{"module":"commonjs"}} + +//// [/dev/configs/base.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [/dev/configs/extendsArrayFifth.json] +{"extends":["./extendsArrayFirst","./extendsArraySecond","./extendsArrayThird","./extendsArrayFourth"],"files":[]} + +//// [/dev/configs/extendsArrayFirst.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [/dev/configs/extendsArrayFourth.json] +{"compilerOptions":{"module":"system","strictNullChecks":false},"include":null,"files":["../main.ts"]} + +//// [/dev/configs/extendsArraySecond.json] +{"compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [/dev/configs/extendsArrayThird.json] +{"compilerOptions":{"module":null,"noImplicitAny":false},"extends":"./extendsArrayFirst","include":["../supplemental.*"]} + +//// [/dev/configs/fifth.json] +{"extends":"./fourth","include":["../tests/utils.ts"],"files":[]} + +//// [/dev/configs/first.json] +{"extends":"./base","compilerOptions":{"module":"commonjs"},"files":["../main.ts"]} + +//// [/dev/configs/fourth.json] +{"extends":"./third","compilerOptions":{"module":"system"},"include":null,"files":["../main.ts"]} + +//// [/dev/configs/second.json] +{"extends":"./base","compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [/dev/configs/tests.json] +{"compilerOptions":{"preserveConstEnums":true,"removeComments":false,"sourceMap":true},"exclude":["../tests/baselines","../tests/scenarios"],"include":["../tests/**/*.ts"]} + +//// [/dev/configs/third.json] +{"extends":"./second","compilerOptions":{"module":null},"include":["../supplemental.*"]} + +//// [/dev/extends.json] +{"extends":42} + +//// [/dev/extends2.json] +{"extends":"configs/base"} + +//// [/dev/extends3.json] +{"extends":""} + +//// [/dev/extends4.json] +{"extends":[""]} + +//// [/dev/extendsArrayFails.json] +{"extends":["./missingFile"],"compilerOptions":{"types":[]}} + +//// [/dev/extendsArrayFails2.json] +{"extends":[42]} + +//// [/dev/failure.json] +{"extends":"./failure2.json","compilerOptions":{"typeRoots":[]}} + +//// [/dev/failure2.json] +{"excludes":["*.js"]} + +//// [/dev/main.ts] + + +//// [/dev/missing.json] +{"extends":"./missing2","compilerOptions":{"types":[]}} + +//// [/dev/node_modules/@foo/tsconfig/package.json] +{"name":"@foo/tsconfig","version":"1.0.0","exports":{".":"./src/tsconfig.json"}} + +//// [/dev/node_modules/@foo/tsconfig/src/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box/package.json] +{"name":"config-box","version":"1.0.0","tsconfig":"./strict.json"} + +//// [/dev/node_modules/config-box/strict.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box/unstrict.json] +{"compilerOptions":{"strict":false}} + +//// [/dev/node_modules/config-box-implied/package.json] +{"name":"config-box-implied","version":"1.0.0"} + +//// [/dev/node_modules/config-box-implied/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box-implied/unstrict/tsconfig.json] +{"compilerOptions":{"strict":false}} + +//// [/dev/supplemental.ts] + + +//// [/dev/tests/baselines/first/output.ts] + + +//// [/dev/tests/scenarios/first.json] + + +//// [/dev/tests/unit/spec.ts] + + +//// [/dev/tests/utils.ts] + + +//// [/dev/tsconfig.extendsBox.json] +{"extends":"config-box","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImplied.json] +{"extends":"config-box-implied","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedPath.json] +{"extends":"config-box-implied/tsconfig.json","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedUnstrict.json] +{"extends":"config-box-implied/unstrict","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json] +{"extends":"config-box-implied/unstrict/tsconfig","files":["main.ts"]} + +//// [/dev/tsconfig.extendsFoo.json] +{"extends":"@foo/tsconfig","files":["main.ts"]} + +//// [/dev/tsconfig.extendsStrict.json] +{"extends":"config-box/strict","files":["main.ts"]} + +//// [/dev/tsconfig.extendsStrictExtension.json] +{"extends":"config-box/strict.json","files":["main.ts"]} + +//// [/dev/tsconfig.extendsUnStrict.json] +{"extends":"config-box/unstrict","files":["main.ts"]} + +//// [/dev/tsconfig.json] +{"extends":"./configs/base","files":["main.ts","supplemental.ts"]} + +//// [/dev/tsconfig.nostrictnull.json] +{"extends":"./tsconfig","compilerOptions":{"strictNullChecks":false}} + + +configFileName:: adds extendedSourceFiles from an array only once +ExtendedSourceFiles:: +/dev/configs/extendsArrayFirst.json +/dev/configs/extendsArraySecond.json +/dev/configs/extendsArrayThird.json +/dev/configs/extendsArrayFourth.json +After reusing sourceFile ExtendedSourceFiles:: +/dev/configs/extendsArrayFirst.json +/dev/configs/extendsArraySecond.json +/dev/configs/extendsArrayThird.json +/dev/configs/extendsArrayFourth.json \ No newline at end of file diff --git a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case insensitive host.js b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case insensitive host.js new file mode 100644 index 00000000000..d65f68384f0 --- /dev/null +++ b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case insensitive host.js @@ -0,0 +1,155 @@ +Fs:: +//// [c:/dev/circular.json] +{"extends":"./circular2","compilerOptions":{"module":"amd"}} + +//// [c:/dev/circular2.json] +{"extends":"./circular","compilerOptions":{"module":"commonjs"}} + +//// [c:/dev/configs/base.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [c:/dev/configs/extendsArrayFifth.json] +{"extends":["./extendsArrayFirst","./extendsArraySecond","./extendsArrayThird","./extendsArrayFourth"],"files":[]} + +//// [c:/dev/configs/extendsArrayFirst.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [c:/dev/configs/extendsArrayFourth.json] +{"compilerOptions":{"module":"system","strictNullChecks":false},"include":null,"files":["../main.ts"]} + +//// [c:/dev/configs/extendsArraySecond.json] +{"compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [c:/dev/configs/extendsArrayThird.json] +{"compilerOptions":{"module":null,"noImplicitAny":false},"extends":"./extendsArrayFirst","include":["../supplemental.*"]} + +//// [c:/dev/configs/fifth.json] +{"extends":"./fourth","include":["../tests/utils.ts"],"files":[]} + +//// [c:/dev/configs/first.json] +{"extends":"./base","compilerOptions":{"module":"commonjs"},"files":["../main.ts"]} + +//// [c:/dev/configs/fourth.json] +{"extends":"./third","compilerOptions":{"module":"system"},"include":null,"files":["../main.ts"]} + +//// [c:/dev/configs/second.json] +{"extends":"./base","compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [c:/dev/configs/tests.json] +{"compilerOptions":{"preserveConstEnums":true,"removeComments":false,"sourceMap":true},"exclude":["../tests/baselines","../tests/scenarios"],"include":["../tests/**/*.ts"]} + +//// [c:/dev/configs/third.json] +{"extends":"./second","compilerOptions":{"module":null},"include":["../supplemental.*"]} + +//// [c:/dev/extends.json] +{"extends":42} + +//// [c:/dev/extends2.json] +{"extends":"configs/base"} + +//// [c:/dev/extends3.json] +{"extends":""} + +//// [c:/dev/extends4.json] +{"extends":[""]} + +//// [c:/dev/extendsArrayFails.json] +{"extends":["./missingFile"],"compilerOptions":{"types":[]}} + +//// [c:/dev/extendsArrayFails2.json] +{"extends":[42]} + +//// [c:/dev/failure.json] +{"extends":"./failure2.json","compilerOptions":{"typeRoots":[]}} + +//// [c:/dev/failure2.json] +{"excludes":["*.js"]} + +//// [c:/dev/main.ts] + + +//// [c:/dev/missing.json] +{"extends":"./missing2","compilerOptions":{"types":[]}} + +//// [c:/dev/node_modules/@foo/tsconfig/package.json] +{"name":"@foo/tsconfig","version":"1.0.0","exports":{".":"./src/tsconfig.json"}} + +//// [c:/dev/node_modules/@foo/tsconfig/src/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box/package.json] +{"name":"config-box","version":"1.0.0","tsconfig":"./strict.json"} + +//// [c:/dev/node_modules/config-box/strict.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box/unstrict.json] +{"compilerOptions":{"strict":false}} + +//// [c:/dev/node_modules/config-box-implied/package.json] +{"name":"config-box-implied","version":"1.0.0"} + +//// [c:/dev/node_modules/config-box-implied/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box-implied/unstrict/tsconfig.json] +{"compilerOptions":{"strict":false}} + +//// [c:/dev/supplemental.ts] + + +//// [c:/dev/tests/baselines/first/output.ts] + + +//// [c:/dev/tests/scenarios/first.json] + + +//// [c:/dev/tests/unit/spec.ts] + + +//// [c:/dev/tests/utils.ts] + + +//// [c:/dev/tsconfig.extendsBox.json] +{"extends":"config-box","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImplied.json] +{"extends":"config-box-implied","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedPath.json] +{"extends":"config-box-implied/tsconfig.json","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedUnstrict.json] +{"extends":"config-box-implied/unstrict","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json] +{"extends":"config-box-implied/unstrict/tsconfig","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsFoo.json] +{"extends":"@foo/tsconfig","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsStrict.json] +{"extends":"config-box/strict","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsStrictExtension.json] +{"extends":"config-box/strict.json","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsUnStrict.json] +{"extends":"config-box/unstrict","files":["main.ts"]} + +//// [c:/dev/tsconfig.json] +{"extends":"./configs/base","files":["main.ts","supplemental.ts"]} + +//// [c:/dev/tsconfig.nostrictnull.json] +{"extends":"./tsconfig","compilerOptions":{"strictNullChecks":false}} + + +configFileName:: adds extendedSourceFiles only once +ExtendedSourceFiles:: +c:/dev/configs/third.json +c:/dev/configs/second.json +c:/dev/configs/base.json +After reusing sourceFile ExtendedSourceFiles:: +c:/dev/configs/third.json +c:/dev/configs/second.json +c:/dev/configs/base.json \ No newline at end of file diff --git a/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case sensitive host.js b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case sensitive host.js new file mode 100644 index 00000000000..06001b27e98 --- /dev/null +++ b/tests/baselines/reference/config/configurationExtension/adds extendedSourceFiles only once under a case sensitive host.js @@ -0,0 +1,155 @@ +Fs:: +//// [/dev/circular.json] +{"extends":"./circular2","compilerOptions":{"module":"amd"}} + +//// [/dev/circular2.json] +{"extends":"./circular","compilerOptions":{"module":"commonjs"}} + +//// [/dev/configs/base.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [/dev/configs/extendsArrayFifth.json] +{"extends":["./extendsArrayFirst","./extendsArraySecond","./extendsArrayThird","./extendsArrayFourth"],"files":[]} + +//// [/dev/configs/extendsArrayFirst.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [/dev/configs/extendsArrayFourth.json] +{"compilerOptions":{"module":"system","strictNullChecks":false},"include":null,"files":["../main.ts"]} + +//// [/dev/configs/extendsArraySecond.json] +{"compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [/dev/configs/extendsArrayThird.json] +{"compilerOptions":{"module":null,"noImplicitAny":false},"extends":"./extendsArrayFirst","include":["../supplemental.*"]} + +//// [/dev/configs/fifth.json] +{"extends":"./fourth","include":["../tests/utils.ts"],"files":[]} + +//// [/dev/configs/first.json] +{"extends":"./base","compilerOptions":{"module":"commonjs"},"files":["../main.ts"]} + +//// [/dev/configs/fourth.json] +{"extends":"./third","compilerOptions":{"module":"system"},"include":null,"files":["../main.ts"]} + +//// [/dev/configs/second.json] +{"extends":"./base","compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [/dev/configs/tests.json] +{"compilerOptions":{"preserveConstEnums":true,"removeComments":false,"sourceMap":true},"exclude":["../tests/baselines","../tests/scenarios"],"include":["../tests/**/*.ts"]} + +//// [/dev/configs/third.json] +{"extends":"./second","compilerOptions":{"module":null},"include":["../supplemental.*"]} + +//// [/dev/extends.json] +{"extends":42} + +//// [/dev/extends2.json] +{"extends":"configs/base"} + +//// [/dev/extends3.json] +{"extends":""} + +//// [/dev/extends4.json] +{"extends":[""]} + +//// [/dev/extendsArrayFails.json] +{"extends":["./missingFile"],"compilerOptions":{"types":[]}} + +//// [/dev/extendsArrayFails2.json] +{"extends":[42]} + +//// [/dev/failure.json] +{"extends":"./failure2.json","compilerOptions":{"typeRoots":[]}} + +//// [/dev/failure2.json] +{"excludes":["*.js"]} + +//// [/dev/main.ts] + + +//// [/dev/missing.json] +{"extends":"./missing2","compilerOptions":{"types":[]}} + +//// [/dev/node_modules/@foo/tsconfig/package.json] +{"name":"@foo/tsconfig","version":"1.0.0","exports":{".":"./src/tsconfig.json"}} + +//// [/dev/node_modules/@foo/tsconfig/src/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box/package.json] +{"name":"config-box","version":"1.0.0","tsconfig":"./strict.json"} + +//// [/dev/node_modules/config-box/strict.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box/unstrict.json] +{"compilerOptions":{"strict":false}} + +//// [/dev/node_modules/config-box-implied/package.json] +{"name":"config-box-implied","version":"1.0.0"} + +//// [/dev/node_modules/config-box-implied/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box-implied/unstrict/tsconfig.json] +{"compilerOptions":{"strict":false}} + +//// [/dev/supplemental.ts] + + +//// [/dev/tests/baselines/first/output.ts] + + +//// [/dev/tests/scenarios/first.json] + + +//// [/dev/tests/unit/spec.ts] + + +//// [/dev/tests/utils.ts] + + +//// [/dev/tsconfig.extendsBox.json] +{"extends":"config-box","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImplied.json] +{"extends":"config-box-implied","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedPath.json] +{"extends":"config-box-implied/tsconfig.json","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedUnstrict.json] +{"extends":"config-box-implied/unstrict","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json] +{"extends":"config-box-implied/unstrict/tsconfig","files":["main.ts"]} + +//// [/dev/tsconfig.extendsFoo.json] +{"extends":"@foo/tsconfig","files":["main.ts"]} + +//// [/dev/tsconfig.extendsStrict.json] +{"extends":"config-box/strict","files":["main.ts"]} + +//// [/dev/tsconfig.extendsStrictExtension.json] +{"extends":"config-box/strict.json","files":["main.ts"]} + +//// [/dev/tsconfig.extendsUnStrict.json] +{"extends":"config-box/unstrict","files":["main.ts"]} + +//// [/dev/tsconfig.json] +{"extends":"./configs/base","files":["main.ts","supplemental.ts"]} + +//// [/dev/tsconfig.nostrictnull.json] +{"extends":"./tsconfig","compilerOptions":{"strictNullChecks":false}} + + +configFileName:: adds extendedSourceFiles only once +ExtendedSourceFiles:: +/dev/configs/third.json +/dev/configs/second.json +/dev/configs/base.json +After reusing sourceFile ExtendedSourceFiles:: +/dev/configs/third.json +/dev/configs/second.json +/dev/configs/base.json \ No newline at end of file diff --git a/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js new file mode 100644 index 00000000000..50a875b2cd8 --- /dev/null +++ b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with json api.js @@ -0,0 +1,443 @@ +Fs:: +//// [c:/dev/circular.json] +{"extends":"./circular2","compilerOptions":{"module":"amd"}} + +//// [c:/dev/circular2.json] +{"extends":"./circular","compilerOptions":{"module":"commonjs"}} + +//// [c:/dev/configs/base.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [c:/dev/configs/extendsArrayFifth.json] +{"extends":["./extendsArrayFirst","./extendsArraySecond","./extendsArrayThird","./extendsArrayFourth"],"files":[]} + +//// [c:/dev/configs/extendsArrayFirst.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [c:/dev/configs/extendsArrayFourth.json] +{"compilerOptions":{"module":"system","strictNullChecks":false},"include":null,"files":["../main.ts"]} + +//// [c:/dev/configs/extendsArraySecond.json] +{"compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [c:/dev/configs/extendsArrayThird.json] +{"compilerOptions":{"module":null,"noImplicitAny":false},"extends":"./extendsArrayFirst","include":["../supplemental.*"]} + +//// [c:/dev/configs/fifth.json] +{"extends":"./fourth","include":["../tests/utils.ts"],"files":[]} + +//// [c:/dev/configs/first.json] +{"extends":"./base","compilerOptions":{"module":"commonjs"},"files":["../main.ts"]} + +//// [c:/dev/configs/fourth.json] +{"extends":"./third","compilerOptions":{"module":"system"},"include":null,"files":["../main.ts"]} + +//// [c:/dev/configs/second.json] +{"extends":"./base","compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [c:/dev/configs/tests.json] +{"compilerOptions":{"preserveConstEnums":true,"removeComments":false,"sourceMap":true},"exclude":["../tests/baselines","../tests/scenarios"],"include":["../tests/**/*.ts"]} + +//// [c:/dev/configs/third.json] +{"extends":"./second","compilerOptions":{"module":null},"include":["../supplemental.*"]} + +//// [c:/dev/extends.json] +{"extends":42} + +//// [c:/dev/extends2.json] +{"extends":"configs/base"} + +//// [c:/dev/extends3.json] +{"extends":""} + +//// [c:/dev/extends4.json] +{"extends":[""]} + +//// [c:/dev/extendsArrayFails.json] +{"extends":["./missingFile"],"compilerOptions":{"types":[]}} + +//// [c:/dev/extendsArrayFails2.json] +{"extends":[42]} + +//// [c:/dev/failure.json] +{"extends":"./failure2.json","compilerOptions":{"typeRoots":[]}} + +//// [c:/dev/failure2.json] +{"excludes":["*.js"]} + +//// [c:/dev/main.ts] + + +//// [c:/dev/missing.json] +{"extends":"./missing2","compilerOptions":{"types":[]}} + +//// [c:/dev/node_modules/@foo/tsconfig/package.json] +{"name":"@foo/tsconfig","version":"1.0.0","exports":{".":"./src/tsconfig.json"}} + +//// [c:/dev/node_modules/@foo/tsconfig/src/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box/package.json] +{"name":"config-box","version":"1.0.0","tsconfig":"./strict.json"} + +//// [c:/dev/node_modules/config-box/strict.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box/unstrict.json] +{"compilerOptions":{"strict":false}} + +//// [c:/dev/node_modules/config-box-implied/package.json] +{"name":"config-box-implied","version":"1.0.0"} + +//// [c:/dev/node_modules/config-box-implied/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box-implied/unstrict/tsconfig.json] +{"compilerOptions":{"strict":false}} + +//// [c:/dev/supplemental.ts] + + +//// [c:/dev/tests/baselines/first/output.ts] + + +//// [c:/dev/tests/scenarios/first.json] + + +//// [c:/dev/tests/unit/spec.ts] + + +//// [c:/dev/tests/utils.ts] + + +//// [c:/dev/tsconfig.extendsBox.json] +{"extends":"config-box","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImplied.json] +{"extends":"config-box-implied","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedPath.json] +{"extends":"config-box-implied/tsconfig.json","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedUnstrict.json] +{"extends":"config-box-implied/unstrict","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json] +{"extends":"config-box-implied/unstrict/tsconfig","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsFoo.json] +{"extends":"@foo/tsconfig","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsStrict.json] +{"extends":"config-box/strict","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsStrictExtension.json] +{"extends":"config-box/strict.json","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsUnStrict.json] +{"extends":"config-box/unstrict","files":["main.ts"]} + +//// [c:/dev/tsconfig.json] +{"extends":"./configs/base","files":["main.ts","supplemental.ts"]} + +//// [c:/dev/tsconfig.nostrictnull.json] +{"extends":"./tsconfig","compilerOptions":{"strictNullChecks":false}} + + +can resolve an extension with a base extension +configFileName:: tsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "configFilePath": "tsconfig.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts +Errors:: + + +can resolve an extension with a base extension that overrides options +configFileName:: tsconfig.nostrictnull.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": false, + "configFilePath": "tsconfig.nostrictnull.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts +Errors:: + + +can report errors on circular imports +configFileName:: circular.json +CompilerOptions:: +{ + "module": 2, + "configFilePath": "circular.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +error TS18000: Circularity detected while resolving configuration: c:/dev/circular.json -> c:/dev/circular2.json -> c:/dev/circular.json + + +can report missing configurations +configFileName:: missing.json +CompilerOptions:: +{ + "types": [], + "configFilePath": "missing.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +error TS6053: File './missing2' not found. + + +can report errors in extended configs +configFileName:: failure.json +CompilerOptions:: +{ + "typeRoots": [], + "configFilePath": "failure.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +failure2.json:1:2 - error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? + +1 {"excludes":["*.js"]} +   ~~~~~~~~~~ + + +can error when 'extends' is not a string or Array +configFileName:: extends.json +CompilerOptions:: +{ + "configFilePath": "extends.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +error TS5024: Compiler option 'extends' requires a value of type string or Array. + + +can error when 'extends' is given an empty string +configFileName:: extends3.json +CompilerOptions:: +{ + "configFilePath": "extends3.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +error TS18051: Compiler option 'extends' cannot be given an empty string. + + +can error when 'extends' is given an empty string in an array +configFileName:: extends4.json +CompilerOptions:: +{ + "configFilePath": "extends4.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +error TS18051: Compiler option 'extends' cannot be given an empty string. + + +can overwrite compiler options using extended 'null' +configFileName:: configs/third.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "configFilePath": "configs/third.json" +} +FileNames:: +c:/dev/supplemental.ts +Errors:: + + +can overwrite top-level options using extended 'null' +configFileName:: configs/fourth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "module": 4, + "configFilePath": "configs/fourth.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can overwrite top-level files using extended [] +configFileName:: configs/fifth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "module": 4, + "configFilePath": "configs/fifth.json" +} +FileNames:: +c:/dev/tests/utils.ts +Errors:: + + +can lookup via tsconfig field +configFileName:: tsconfig.extendsBox.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBox.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via package-relative path +configFileName:: tsconfig.extendsStrict.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsStrict.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via non-redirected-to package-relative path +configFileName:: tsconfig.extendsUnStrict.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsUnStrict.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via package-relative path with extension +configFileName:: tsconfig.extendsStrictExtension.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsStrictExtension.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig +configFileName:: tsconfig.extendsBoxImplied.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBoxImplied.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory +configFileName:: tsconfig.extendsBoxImpliedUnstrict.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsBoxImpliedUnstrict.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory with name +configFileName:: tsconfig.extendsBoxImpliedUnstrictExtension.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsBoxImpliedUnstrictExtension.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory with extension +configFileName:: tsconfig.extendsBoxImpliedPath.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBoxImpliedPath.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via an package.json exports +configFileName:: tsconfig.extendsFoo.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsFoo.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can overwrite top-level compilerOptions +configFileName:: configs/extendsArrayFifth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": false, + "strictNullChecks": false, + "module": 4, + "configFilePath": "configs/extendsArrayFifth.json" +} +FileNames:: + +Errors:: + + +can report missing configurations +configFileName:: extendsArrayFails.json +CompilerOptions:: +{ + "types": [], + "configFilePath": "extendsArrayFails.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +error TS6053: File './missingFile' not found. + + +can error when 'extends' is not a string or Array2 +configFileName:: extendsArrayFails2.json +CompilerOptions:: +{ + "configFilePath": "extendsArrayFails2.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +error TS5024: Compiler option 'extends' requires a value of type string. + diff --git a/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js new file mode 100644 index 00000000000..9e7dad1da7c --- /dev/null +++ b/tests/baselines/reference/config/configurationExtension/under a case insensitive host with jsonSourceFile api.js @@ -0,0 +1,461 @@ +Fs:: +//// [c:/dev/circular.json] +{"extends":"./circular2","compilerOptions":{"module":"amd"}} + +//// [c:/dev/circular2.json] +{"extends":"./circular","compilerOptions":{"module":"commonjs"}} + +//// [c:/dev/configs/base.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [c:/dev/configs/extendsArrayFifth.json] +{"extends":["./extendsArrayFirst","./extendsArraySecond","./extendsArrayThird","./extendsArrayFourth"],"files":[]} + +//// [c:/dev/configs/extendsArrayFirst.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [c:/dev/configs/extendsArrayFourth.json] +{"compilerOptions":{"module":"system","strictNullChecks":false},"include":null,"files":["../main.ts"]} + +//// [c:/dev/configs/extendsArraySecond.json] +{"compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [c:/dev/configs/extendsArrayThird.json] +{"compilerOptions":{"module":null,"noImplicitAny":false},"extends":"./extendsArrayFirst","include":["../supplemental.*"]} + +//// [c:/dev/configs/fifth.json] +{"extends":"./fourth","include":["../tests/utils.ts"],"files":[]} + +//// [c:/dev/configs/first.json] +{"extends":"./base","compilerOptions":{"module":"commonjs"},"files":["../main.ts"]} + +//// [c:/dev/configs/fourth.json] +{"extends":"./third","compilerOptions":{"module":"system"},"include":null,"files":["../main.ts"]} + +//// [c:/dev/configs/second.json] +{"extends":"./base","compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [c:/dev/configs/tests.json] +{"compilerOptions":{"preserveConstEnums":true,"removeComments":false,"sourceMap":true},"exclude":["../tests/baselines","../tests/scenarios"],"include":["../tests/**/*.ts"]} + +//// [c:/dev/configs/third.json] +{"extends":"./second","compilerOptions":{"module":null},"include":["../supplemental.*"]} + +//// [c:/dev/extends.json] +{"extends":42} + +//// [c:/dev/extends2.json] +{"extends":"configs/base"} + +//// [c:/dev/extends3.json] +{"extends":""} + +//// [c:/dev/extends4.json] +{"extends":[""]} + +//// [c:/dev/extendsArrayFails.json] +{"extends":["./missingFile"],"compilerOptions":{"types":[]}} + +//// [c:/dev/extendsArrayFails2.json] +{"extends":[42]} + +//// [c:/dev/failure.json] +{"extends":"./failure2.json","compilerOptions":{"typeRoots":[]}} + +//// [c:/dev/failure2.json] +{"excludes":["*.js"]} + +//// [c:/dev/main.ts] + + +//// [c:/dev/missing.json] +{"extends":"./missing2","compilerOptions":{"types":[]}} + +//// [c:/dev/node_modules/@foo/tsconfig/package.json] +{"name":"@foo/tsconfig","version":"1.0.0","exports":{".":"./src/tsconfig.json"}} + +//// [c:/dev/node_modules/@foo/tsconfig/src/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box/package.json] +{"name":"config-box","version":"1.0.0","tsconfig":"./strict.json"} + +//// [c:/dev/node_modules/config-box/strict.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box/unstrict.json] +{"compilerOptions":{"strict":false}} + +//// [c:/dev/node_modules/config-box-implied/package.json] +{"name":"config-box-implied","version":"1.0.0"} + +//// [c:/dev/node_modules/config-box-implied/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [c:/dev/node_modules/config-box-implied/unstrict/tsconfig.json] +{"compilerOptions":{"strict":false}} + +//// [c:/dev/supplemental.ts] + + +//// [c:/dev/tests/baselines/first/output.ts] + + +//// [c:/dev/tests/scenarios/first.json] + + +//// [c:/dev/tests/unit/spec.ts] + + +//// [c:/dev/tests/utils.ts] + + +//// [c:/dev/tsconfig.extendsBox.json] +{"extends":"config-box","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImplied.json] +{"extends":"config-box-implied","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedPath.json] +{"extends":"config-box-implied/tsconfig.json","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedUnstrict.json] +{"extends":"config-box-implied/unstrict","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json] +{"extends":"config-box-implied/unstrict/tsconfig","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsFoo.json] +{"extends":"@foo/tsconfig","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsStrict.json] +{"extends":"config-box/strict","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsStrictExtension.json] +{"extends":"config-box/strict.json","files":["main.ts"]} + +//// [c:/dev/tsconfig.extendsUnStrict.json] +{"extends":"config-box/unstrict","files":["main.ts"]} + +//// [c:/dev/tsconfig.json] +{"extends":"./configs/base","files":["main.ts","supplemental.ts"]} + +//// [c:/dev/tsconfig.nostrictnull.json] +{"extends":"./tsconfig","compilerOptions":{"strictNullChecks":false}} + + +can resolve an extension with a base extension +configFileName:: tsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "configFilePath": "tsconfig.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts +Errors:: + + +can resolve an extension with a base extension that overrides options +configFileName:: tsconfig.nostrictnull.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": false, + "configFilePath": "tsconfig.nostrictnull.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts +Errors:: + + +can report errors on circular imports +configFileName:: circular.json +CompilerOptions:: +{ + "module": 2, + "configFilePath": "circular.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +error TS18000: Circularity detected while resolving configuration: c:/dev/circular.json -> c:/dev/circular2.json -> c:/dev/circular.json + + +can report missing configurations +configFileName:: missing.json +CompilerOptions:: +{ + "types": [], + "configFilePath": "missing.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +missing.json:1:12 - error TS6053: File './missing2' not found. + +1 {"extends":"./missing2","compilerOptions":{"types":[]}} +   ~~~~~~~~~~~~ + + +can report errors in extended configs +configFileName:: failure.json +CompilerOptions:: +{ + "typeRoots": [], + "configFilePath": "failure.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +failure2.json:1:2 - error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? + +1 {"excludes":["*.js"]} +   ~~~~~~~~~~ + + +can error when 'extends' is not a string or Array +configFileName:: extends.json +CompilerOptions:: +{ + "configFilePath": "extends.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +extends.json:1:12 - error TS5024: Compiler option 'extends' requires a value of type string or Array. + +1 {"extends":42} +   ~~ + + +can error when 'extends' is given an empty string +configFileName:: extends3.json +CompilerOptions:: +{ + "configFilePath": "extends3.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +extends3.json:1:12 - error TS18051: Compiler option 'extends' cannot be given an empty string. + +1 {"extends":""} +   ~~ + + +can error when 'extends' is given an empty string in an array +configFileName:: extends4.json +CompilerOptions:: +{ + "configFilePath": "extends4.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +extends4.json:1:13 - error TS18051: Compiler option 'extends' cannot be given an empty string. + +1 {"extends":[""]} +   ~~ + + +can overwrite compiler options using extended 'null' +configFileName:: configs/third.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "configFilePath": "configs/third.json" +} +FileNames:: +c:/dev/supplemental.ts +Errors:: + + +can overwrite top-level options using extended 'null' +configFileName:: configs/fourth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "module": 4, + "configFilePath": "configs/fourth.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can overwrite top-level files using extended [] +configFileName:: configs/fifth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "module": 4, + "configFilePath": "configs/fifth.json" +} +FileNames:: +c:/dev/tests/utils.ts +Errors:: + + +can lookup via tsconfig field +configFileName:: tsconfig.extendsBox.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBox.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via package-relative path +configFileName:: tsconfig.extendsStrict.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsStrict.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via non-redirected-to package-relative path +configFileName:: tsconfig.extendsUnStrict.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsUnStrict.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via package-relative path with extension +configFileName:: tsconfig.extendsStrictExtension.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsStrictExtension.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig +configFileName:: tsconfig.extendsBoxImplied.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBoxImplied.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory +configFileName:: tsconfig.extendsBoxImpliedUnstrict.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsBoxImpliedUnstrict.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory with name +configFileName:: tsconfig.extendsBoxImpliedUnstrictExtension.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsBoxImpliedUnstrictExtension.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory with extension +configFileName:: tsconfig.extendsBoxImpliedPath.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBoxImpliedPath.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can lookup via an package.json exports +configFileName:: tsconfig.extendsFoo.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsFoo.json" +} +FileNames:: +c:/dev/main.ts +Errors:: + + +can overwrite top-level compilerOptions +configFileName:: configs/extendsArrayFifth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": false, + "strictNullChecks": false, + "module": 4, + "configFilePath": "configs/extendsArrayFifth.json" +} +FileNames:: + +Errors:: + + +can report missing configurations +configFileName:: extendsArrayFails.json +CompilerOptions:: +{ + "types": [], + "configFilePath": "extendsArrayFails.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +extendsArrayFails.json:1:13 - error TS6053: File './missingFile' not found. + +1 {"extends":["./missingFile"],"compilerOptions":{"types":[]}} +   ~~~~~~~~~~~~~~~ + + +can error when 'extends' is not a string or Array2 +configFileName:: extendsArrayFails2.json +CompilerOptions:: +{ + "configFilePath": "extendsArrayFails2.json" +} +FileNames:: +c:/dev/main.ts,c:/dev/supplemental.ts,c:/dev/tests/utils.ts,c:/dev/tests/baselines/first/output.ts,c:/dev/tests/unit/spec.ts +Errors:: +extendsArrayFails2.json:1:13 - error TS5024: Compiler option 'extends' requires a value of type string. + +1 {"extends":[42]} +   ~~ + diff --git a/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js new file mode 100644 index 00000000000..4f0167c4cda --- /dev/null +++ b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with json api.js @@ -0,0 +1,443 @@ +Fs:: +//// [/dev/circular.json] +{"extends":"./circular2","compilerOptions":{"module":"amd"}} + +//// [/dev/circular2.json] +{"extends":"./circular","compilerOptions":{"module":"commonjs"}} + +//// [/dev/configs/base.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [/dev/configs/extendsArrayFifth.json] +{"extends":["./extendsArrayFirst","./extendsArraySecond","./extendsArrayThird","./extendsArrayFourth"],"files":[]} + +//// [/dev/configs/extendsArrayFirst.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [/dev/configs/extendsArrayFourth.json] +{"compilerOptions":{"module":"system","strictNullChecks":false},"include":null,"files":["../main.ts"]} + +//// [/dev/configs/extendsArraySecond.json] +{"compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [/dev/configs/extendsArrayThird.json] +{"compilerOptions":{"module":null,"noImplicitAny":false},"extends":"./extendsArrayFirst","include":["../supplemental.*"]} + +//// [/dev/configs/fifth.json] +{"extends":"./fourth","include":["../tests/utils.ts"],"files":[]} + +//// [/dev/configs/first.json] +{"extends":"./base","compilerOptions":{"module":"commonjs"},"files":["../main.ts"]} + +//// [/dev/configs/fourth.json] +{"extends":"./third","compilerOptions":{"module":"system"},"include":null,"files":["../main.ts"]} + +//// [/dev/configs/second.json] +{"extends":"./base","compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [/dev/configs/tests.json] +{"compilerOptions":{"preserveConstEnums":true,"removeComments":false,"sourceMap":true},"exclude":["../tests/baselines","../tests/scenarios"],"include":["../tests/**/*.ts"]} + +//// [/dev/configs/third.json] +{"extends":"./second","compilerOptions":{"module":null},"include":["../supplemental.*"]} + +//// [/dev/extends.json] +{"extends":42} + +//// [/dev/extends2.json] +{"extends":"configs/base"} + +//// [/dev/extends3.json] +{"extends":""} + +//// [/dev/extends4.json] +{"extends":[""]} + +//// [/dev/extendsArrayFails.json] +{"extends":["./missingFile"],"compilerOptions":{"types":[]}} + +//// [/dev/extendsArrayFails2.json] +{"extends":[42]} + +//// [/dev/failure.json] +{"extends":"./failure2.json","compilerOptions":{"typeRoots":[]}} + +//// [/dev/failure2.json] +{"excludes":["*.js"]} + +//// [/dev/main.ts] + + +//// [/dev/missing.json] +{"extends":"./missing2","compilerOptions":{"types":[]}} + +//// [/dev/node_modules/@foo/tsconfig/package.json] +{"name":"@foo/tsconfig","version":"1.0.0","exports":{".":"./src/tsconfig.json"}} + +//// [/dev/node_modules/@foo/tsconfig/src/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box/package.json] +{"name":"config-box","version":"1.0.0","tsconfig":"./strict.json"} + +//// [/dev/node_modules/config-box/strict.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box/unstrict.json] +{"compilerOptions":{"strict":false}} + +//// [/dev/node_modules/config-box-implied/package.json] +{"name":"config-box-implied","version":"1.0.0"} + +//// [/dev/node_modules/config-box-implied/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box-implied/unstrict/tsconfig.json] +{"compilerOptions":{"strict":false}} + +//// [/dev/supplemental.ts] + + +//// [/dev/tests/baselines/first/output.ts] + + +//// [/dev/tests/scenarios/first.json] + + +//// [/dev/tests/unit/spec.ts] + + +//// [/dev/tests/utils.ts] + + +//// [/dev/tsconfig.extendsBox.json] +{"extends":"config-box","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImplied.json] +{"extends":"config-box-implied","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedPath.json] +{"extends":"config-box-implied/tsconfig.json","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedUnstrict.json] +{"extends":"config-box-implied/unstrict","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json] +{"extends":"config-box-implied/unstrict/tsconfig","files":["main.ts"]} + +//// [/dev/tsconfig.extendsFoo.json] +{"extends":"@foo/tsconfig","files":["main.ts"]} + +//// [/dev/tsconfig.extendsStrict.json] +{"extends":"config-box/strict","files":["main.ts"]} + +//// [/dev/tsconfig.extendsStrictExtension.json] +{"extends":"config-box/strict.json","files":["main.ts"]} + +//// [/dev/tsconfig.extendsUnStrict.json] +{"extends":"config-box/unstrict","files":["main.ts"]} + +//// [/dev/tsconfig.json] +{"extends":"./configs/base","files":["main.ts","supplemental.ts"]} + +//// [/dev/tsconfig.nostrictnull.json] +{"extends":"./tsconfig","compilerOptions":{"strictNullChecks":false}} + + +can resolve an extension with a base extension +configFileName:: tsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "configFilePath": "tsconfig.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts +Errors:: + + +can resolve an extension with a base extension that overrides options +configFileName:: tsconfig.nostrictnull.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": false, + "configFilePath": "tsconfig.nostrictnull.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts +Errors:: + + +can report errors on circular imports +configFileName:: circular.json +CompilerOptions:: +{ + "module": 2, + "configFilePath": "circular.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +error TS18000: Circularity detected while resolving configuration: /dev/circular.json -> /dev/circular2.json -> /dev/circular.json + + +can report missing configurations +configFileName:: missing.json +CompilerOptions:: +{ + "types": [], + "configFilePath": "missing.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +error TS6053: File './missing2' not found. + + +can report errors in extended configs +configFileName:: failure.json +CompilerOptions:: +{ + "typeRoots": [], + "configFilePath": "failure.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +failure2.json:1:2 - error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? + +1 {"excludes":["*.js"]} +   ~~~~~~~~~~ + + +can error when 'extends' is not a string or Array +configFileName:: extends.json +CompilerOptions:: +{ + "configFilePath": "extends.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +error TS5024: Compiler option 'extends' requires a value of type string or Array. + + +can error when 'extends' is given an empty string +configFileName:: extends3.json +CompilerOptions:: +{ + "configFilePath": "extends3.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +error TS18051: Compiler option 'extends' cannot be given an empty string. + + +can error when 'extends' is given an empty string in an array +configFileName:: extends4.json +CompilerOptions:: +{ + "configFilePath": "extends4.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +error TS18051: Compiler option 'extends' cannot be given an empty string. + + +can overwrite compiler options using extended 'null' +configFileName:: configs/third.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "configFilePath": "configs/third.json" +} +FileNames:: +/dev/supplemental.ts +Errors:: + + +can overwrite top-level options using extended 'null' +configFileName:: configs/fourth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "module": 4, + "configFilePath": "configs/fourth.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can overwrite top-level files using extended [] +configFileName:: configs/fifth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "module": 4, + "configFilePath": "configs/fifth.json" +} +FileNames:: +/dev/tests/utils.ts +Errors:: + + +can lookup via tsconfig field +configFileName:: tsconfig.extendsBox.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBox.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via package-relative path +configFileName:: tsconfig.extendsStrict.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsStrict.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via non-redirected-to package-relative path +configFileName:: tsconfig.extendsUnStrict.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsUnStrict.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via package-relative path with extension +configFileName:: tsconfig.extendsStrictExtension.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsStrictExtension.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig +configFileName:: tsconfig.extendsBoxImplied.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBoxImplied.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory +configFileName:: tsconfig.extendsBoxImpliedUnstrict.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsBoxImpliedUnstrict.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory with name +configFileName:: tsconfig.extendsBoxImpliedUnstrictExtension.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsBoxImpliedUnstrictExtension.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory with extension +configFileName:: tsconfig.extendsBoxImpliedPath.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBoxImpliedPath.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via an package.json exports +configFileName:: tsconfig.extendsFoo.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsFoo.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can overwrite top-level compilerOptions +configFileName:: configs/extendsArrayFifth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": false, + "strictNullChecks": false, + "module": 4, + "configFilePath": "configs/extendsArrayFifth.json" +} +FileNames:: + +Errors:: + + +can report missing configurations +configFileName:: extendsArrayFails.json +CompilerOptions:: +{ + "types": [], + "configFilePath": "extendsArrayFails.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +error TS6053: File './missingFile' not found. + + +can error when 'extends' is not a string or Array2 +configFileName:: extendsArrayFails2.json +CompilerOptions:: +{ + "configFilePath": "extendsArrayFails2.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +error TS5024: Compiler option 'extends' requires a value of type string. + diff --git a/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js new file mode 100644 index 00000000000..d2aefd8f29b --- /dev/null +++ b/tests/baselines/reference/config/configurationExtension/under a case sensitive host with jsonSourceFile api.js @@ -0,0 +1,461 @@ +Fs:: +//// [/dev/circular.json] +{"extends":"./circular2","compilerOptions":{"module":"amd"}} + +//// [/dev/circular2.json] +{"extends":"./circular","compilerOptions":{"module":"commonjs"}} + +//// [/dev/configs/base.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [/dev/configs/extendsArrayFifth.json] +{"extends":["./extendsArrayFirst","./extendsArraySecond","./extendsArrayThird","./extendsArrayFourth"],"files":[]} + +//// [/dev/configs/extendsArrayFirst.json] +{"compilerOptions":{"allowJs":true,"noImplicitAny":true,"strictNullChecks":true}} + +//// [/dev/configs/extendsArrayFourth.json] +{"compilerOptions":{"module":"system","strictNullChecks":false},"include":null,"files":["../main.ts"]} + +//// [/dev/configs/extendsArraySecond.json] +{"compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [/dev/configs/extendsArrayThird.json] +{"compilerOptions":{"module":null,"noImplicitAny":false},"extends":"./extendsArrayFirst","include":["../supplemental.*"]} + +//// [/dev/configs/fifth.json] +{"extends":"./fourth","include":["../tests/utils.ts"],"files":[]} + +//// [/dev/configs/first.json] +{"extends":"./base","compilerOptions":{"module":"commonjs"},"files":["../main.ts"]} + +//// [/dev/configs/fourth.json] +{"extends":"./third","compilerOptions":{"module":"system"},"include":null,"files":["../main.ts"]} + +//// [/dev/configs/second.json] +{"extends":"./base","compilerOptions":{"module":"amd"},"include":["../supplemental.*"]} + +//// [/dev/configs/tests.json] +{"compilerOptions":{"preserveConstEnums":true,"removeComments":false,"sourceMap":true},"exclude":["../tests/baselines","../tests/scenarios"],"include":["../tests/**/*.ts"]} + +//// [/dev/configs/third.json] +{"extends":"./second","compilerOptions":{"module":null},"include":["../supplemental.*"]} + +//// [/dev/extends.json] +{"extends":42} + +//// [/dev/extends2.json] +{"extends":"configs/base"} + +//// [/dev/extends3.json] +{"extends":""} + +//// [/dev/extends4.json] +{"extends":[""]} + +//// [/dev/extendsArrayFails.json] +{"extends":["./missingFile"],"compilerOptions":{"types":[]}} + +//// [/dev/extendsArrayFails2.json] +{"extends":[42]} + +//// [/dev/failure.json] +{"extends":"./failure2.json","compilerOptions":{"typeRoots":[]}} + +//// [/dev/failure2.json] +{"excludes":["*.js"]} + +//// [/dev/main.ts] + + +//// [/dev/missing.json] +{"extends":"./missing2","compilerOptions":{"types":[]}} + +//// [/dev/node_modules/@foo/tsconfig/package.json] +{"name":"@foo/tsconfig","version":"1.0.0","exports":{".":"./src/tsconfig.json"}} + +//// [/dev/node_modules/@foo/tsconfig/src/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box/package.json] +{"name":"config-box","version":"1.0.0","tsconfig":"./strict.json"} + +//// [/dev/node_modules/config-box/strict.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box/unstrict.json] +{"compilerOptions":{"strict":false}} + +//// [/dev/node_modules/config-box-implied/package.json] +{"name":"config-box-implied","version":"1.0.0"} + +//// [/dev/node_modules/config-box-implied/tsconfig.json] +{"compilerOptions":{"strict":true}} + +//// [/dev/node_modules/config-box-implied/unstrict/tsconfig.json] +{"compilerOptions":{"strict":false}} + +//// [/dev/supplemental.ts] + + +//// [/dev/tests/baselines/first/output.ts] + + +//// [/dev/tests/scenarios/first.json] + + +//// [/dev/tests/unit/spec.ts] + + +//// [/dev/tests/utils.ts] + + +//// [/dev/tsconfig.extendsBox.json] +{"extends":"config-box","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImplied.json] +{"extends":"config-box-implied","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedPath.json] +{"extends":"config-box-implied/tsconfig.json","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedUnstrict.json] +{"extends":"config-box-implied/unstrict","files":["main.ts"]} + +//// [/dev/tsconfig.extendsBoxImpliedUnstrictExtension.json] +{"extends":"config-box-implied/unstrict/tsconfig","files":["main.ts"]} + +//// [/dev/tsconfig.extendsFoo.json] +{"extends":"@foo/tsconfig","files":["main.ts"]} + +//// [/dev/tsconfig.extendsStrict.json] +{"extends":"config-box/strict","files":["main.ts"]} + +//// [/dev/tsconfig.extendsStrictExtension.json] +{"extends":"config-box/strict.json","files":["main.ts"]} + +//// [/dev/tsconfig.extendsUnStrict.json] +{"extends":"config-box/unstrict","files":["main.ts"]} + +//// [/dev/tsconfig.json] +{"extends":"./configs/base","files":["main.ts","supplemental.ts"]} + +//// [/dev/tsconfig.nostrictnull.json] +{"extends":"./tsconfig","compilerOptions":{"strictNullChecks":false}} + + +can resolve an extension with a base extension +configFileName:: tsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "configFilePath": "tsconfig.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts +Errors:: + + +can resolve an extension with a base extension that overrides options +configFileName:: tsconfig.nostrictnull.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": false, + "configFilePath": "tsconfig.nostrictnull.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts +Errors:: + + +can report errors on circular imports +configFileName:: circular.json +CompilerOptions:: +{ + "module": 2, + "configFilePath": "circular.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +error TS18000: Circularity detected while resolving configuration: /dev/circular.json -> /dev/circular2.json -> /dev/circular.json + + +can report missing configurations +configFileName:: missing.json +CompilerOptions:: +{ + "types": [], + "configFilePath": "missing.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +missing.json:1:12 - error TS6053: File './missing2' not found. + +1 {"extends":"./missing2","compilerOptions":{"types":[]}} +   ~~~~~~~~~~~~ + + +can report errors in extended configs +configFileName:: failure.json +CompilerOptions:: +{ + "typeRoots": [], + "configFilePath": "failure.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +failure2.json:1:2 - error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? + +1 {"excludes":["*.js"]} +   ~~~~~~~~~~ + + +can error when 'extends' is not a string or Array +configFileName:: extends.json +CompilerOptions:: +{ + "configFilePath": "extends.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +extends.json:1:12 - error TS5024: Compiler option 'extends' requires a value of type string or Array. + +1 {"extends":42} +   ~~ + + +can error when 'extends' is given an empty string +configFileName:: extends3.json +CompilerOptions:: +{ + "configFilePath": "extends3.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +extends3.json:1:12 - error TS18051: Compiler option 'extends' cannot be given an empty string. + +1 {"extends":""} +   ~~ + + +can error when 'extends' is given an empty string in an array +configFileName:: extends4.json +CompilerOptions:: +{ + "configFilePath": "extends4.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +extends4.json:1:13 - error TS18051: Compiler option 'extends' cannot be given an empty string. + +1 {"extends":[""]} +   ~~ + + +can overwrite compiler options using extended 'null' +configFileName:: configs/third.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "configFilePath": "configs/third.json" +} +FileNames:: +/dev/supplemental.ts +Errors:: + + +can overwrite top-level options using extended 'null' +configFileName:: configs/fourth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "module": 4, + "configFilePath": "configs/fourth.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can overwrite top-level files using extended [] +configFileName:: configs/fifth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": true, + "strictNullChecks": true, + "module": 4, + "configFilePath": "configs/fifth.json" +} +FileNames:: +/dev/tests/utils.ts +Errors:: + + +can lookup via tsconfig field +configFileName:: tsconfig.extendsBox.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBox.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via package-relative path +configFileName:: tsconfig.extendsStrict.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsStrict.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via non-redirected-to package-relative path +configFileName:: tsconfig.extendsUnStrict.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsUnStrict.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via package-relative path with extension +configFileName:: tsconfig.extendsStrictExtension.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsStrictExtension.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig +configFileName:: tsconfig.extendsBoxImplied.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBoxImplied.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory +configFileName:: tsconfig.extendsBoxImpliedUnstrict.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsBoxImpliedUnstrict.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory with name +configFileName:: tsconfig.extendsBoxImpliedUnstrictExtension.json +CompilerOptions:: +{ + "strict": false, + "configFilePath": "tsconfig.extendsBoxImpliedUnstrictExtension.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via an implicit tsconfig in a package-relative directory with extension +configFileName:: tsconfig.extendsBoxImpliedPath.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsBoxImpliedPath.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can lookup via an package.json exports +configFileName:: tsconfig.extendsFoo.json +CompilerOptions:: +{ + "strict": true, + "configFilePath": "tsconfig.extendsFoo.json" +} +FileNames:: +/dev/main.ts +Errors:: + + +can overwrite top-level compilerOptions +configFileName:: configs/extendsArrayFifth.json +CompilerOptions:: +{ + "allowJs": true, + "noImplicitAny": false, + "strictNullChecks": false, + "module": 4, + "configFilePath": "configs/extendsArrayFifth.json" +} +FileNames:: + +Errors:: + + +can report missing configurations +configFileName:: extendsArrayFails.json +CompilerOptions:: +{ + "types": [], + "configFilePath": "extendsArrayFails.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +extendsArrayFails.json:1:13 - error TS6053: File './missingFile' not found. + +1 {"extends":["./missingFile"],"compilerOptions":{"types":[]}} +   ~~~~~~~~~~~~~~~ + + +can error when 'extends' is not a string or Array2 +configFileName:: extendsArrayFails2.json +CompilerOptions:: +{ + "configFilePath": "extendsArrayFails2.json" +} +FileNames:: +/dev/main.ts,/dev/supplemental.ts,/dev/tests/utils.ts,/dev/tests/baselines/first/output.ts,/dev/tests/unit/spec.ts +Errors:: +extendsArrayFails2.json:1:13 - error TS5024: Compiler option 'extends' requires a value of type string. + +1 {"extends":[42]} +   ~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Allow trailing comments with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Allow trailing comments with jsonSourceFile api.js new file mode 100644 index 00000000000..e2426e5f2c3 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Allow trailing comments with jsonSourceFile api.js @@ -0,0 +1,18 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{} // no options + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file as an array with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file as an array with jsonSourceFile api.js new file mode 100644 index 00000000000..8dd1abf9d21 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file as an array with jsonSourceFile api.js @@ -0,0 +1,34 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +[{ + "compilerOptions": { + "target": "esnext" + } + }] + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "target": 99, + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:1:1 - error TS5092: The root value of a 'tsconfig.json' file must be an object. + + 1 [{ +  ~~ + 2 "compilerOptions": { +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +... + 4 } +  ~~~~~~~~~~~~~ + 5 }] +  ~~~~~~~~~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray leading characters with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray leading characters with jsonSourceFile api.js new file mode 100644 index 00000000000..c279e51a5fb --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray leading characters with jsonSourceFile api.js @@ -0,0 +1,27 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +blah { + "compilerOptions": { + "target": "esnext" + } + } + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "target": 99, + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:1:1 - error TS1136: Property assignment expected. + +1 blah { +  ~~~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray trailing characters with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray trailing characters with jsonSourceFile api.js new file mode 100644 index 00000000000..576fd7db78e --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert a tsconfig file with stray trailing characters with jsonSourceFile api.js @@ -0,0 +1,34 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "target": "esnext" + } + } blah + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "target": 99, + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:1:1 - error TS5092: The root value of a 'tsconfig.json' file must be an object. + + 1 { +  ~ + 2 "compilerOptions": { +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +... + 4 } +  ~~~~~~~~~~~~~ + 5 } blah +  ~~~~~~~~~~~~~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with json api.js new file mode 100644 index 00000000000..1e8650209fa --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with json api.js @@ -0,0 +1,44 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "es5", + "es2015.core", + "es2015.symbol" + ] + } +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "lib.es5.d.ts", + "lib.es2015.core.d.ts", + "lib.es2015.symbol.d.ts" + ], + "configFilePath": "jsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..1e8650209fa --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json to compiler-options with jsonSourceFile api.js @@ -0,0 +1,44 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "es5", + "es2015.core", + "es2015.symbol" + ] + } +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "lib.es5.d.ts", + "lib.es2015.core.d.ts", + "lib.es2015.symbol.d.ts" + ], + "configFilePath": "jsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with json api.js new file mode 100644 index 00000000000..3c67eb6c08c --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with json api.js @@ -0,0 +1,45 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "allowJs": false, + "lib": [ + "es5", + "es2015.core", + "es2015.symbol" + ] + } +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": false, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "lib.es5.d.ts", + "lib.es2015.core.d.ts", + "lib.es2015.symbol.d.ts" + ], + "configFilePath": "jsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..3c67eb6c08c --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format jsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js @@ -0,0 +1,45 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "allowJs": false, + "lib": [ + "es5", + "es2015.core", + "es2015.symbol" + ] + } +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": false, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "lib.es5.d.ts", + "lib.es2015.core.d.ts", + "lib.es2015.symbol.d.ts" + ], + "configFilePath": "jsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with json api.js new file mode 100644 index 00000000000..4b35dd8cc8a --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with json api.js @@ -0,0 +1,39 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "es5", + "es2015.core", + "es2015.symbol" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "lib.es5.d.ts", + "lib.es2015.core.d.ts", + "lib.es2015.symbol.d.ts" + ], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..4b35dd8cc8a --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json to compiler-options with jsonSourceFile api.js @@ -0,0 +1,39 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "es5", + "es2015.core", + "es2015.symbol" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "lib.es5.d.ts", + "lib.es2015.core.d.ts", + "lib.es2015.symbol.d.ts" + ], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with json api.js new file mode 100644 index 00000000000..24bfd8aeed5 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with json api.js @@ -0,0 +1,41 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "allowJs": false, + "lib": [ + "es5", + "es2015.core", + "es2015.symbol" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "allowJs": false, + "lib": [ + "lib.es5.d.ts", + "lib.es2015.core.d.ts", + "lib.es2015.symbol.d.ts" + ], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..24bfd8aeed5 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert correctly format tsconfig.json with allowJs is false to compiler-options with jsonSourceFile api.js @@ -0,0 +1,41 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "allowJs": false, + "lib": [ + "es5", + "es2015.core", + "es2015.symbol" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "allowJs": false, + "lib": [ + "lib.es5.d.ts", + "lib.es2015.core.d.ts", + "lib.es2015.symbol.d.ts" + ], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with json api.js new file mode 100644 index 00000000000..02ee479e8cd --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with json api.js @@ -0,0 +1,23 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "configFilePath": "jsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..02ee479e8cd --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default jsconfig.json to compiler-options with jsonSourceFile api.js @@ -0,0 +1,23 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "configFilePath": "jsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with json api.js new file mode 100644 index 00000000000..0890fd95586 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with json api.js @@ -0,0 +1,18 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..0890fd95586 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert default tsconfig.json to compiler-options with jsonSourceFile api.js @@ -0,0 +1,18 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with json api.js new file mode 100644 index 00000000000..a11242e30a5 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with json api.js @@ -0,0 +1,31 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..a11242e30a5 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of libs to compiler-options with jsonSourceFile api.js @@ -0,0 +1,31 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with json api.js new file mode 100644 index 00000000000..93647f7bdea --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with json api.js @@ -0,0 +1,23 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "moduleSuffixes": [] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "moduleSuffixes": [], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..93647f7bdea --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty option of moduleSuffixes to compiler-options with jsonSourceFile api.js @@ -0,0 +1,23 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "moduleSuffixes": [] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "moduleSuffixes": [], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js new file mode 100644 index 00000000000..cfea7b850ca --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with json api.js @@ -0,0 +1,34 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [], + "configFilePath": "tsconfig.json" +} +Errors:: +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'decorators', 'decorators.legacy'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..e0895380981 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs array to compiler-options with jsonSourceFile api.js @@ -0,0 +1,37 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [], + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:8:4 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'decorators', 'decorators.legacy'. + +8 "" +   ~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js new file mode 100644 index 00000000000..021162067c7 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with json api.js @@ -0,0 +1,37 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "es5", + "" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "lib.es5.d.ts" + ], + "configFilePath": "tsconfig.json" +} +Errors:: +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'decorators', 'decorators.legacy'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..5800ae86e6b --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of libs to compiler-options with jsonSourceFile api.js @@ -0,0 +1,40 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "es5", + "" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "lib.es5.d.ts" + ], + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:9:4 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'decorators', 'decorators.legacy'. + +9 "" +   ~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with json api.js new file mode 100644 index 00000000000..08442f6d71d --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with json api.js @@ -0,0 +1,27 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "moduleSuffixes": [ + "" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "moduleSuffixes": [ + "" + ], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..08442f6d71d --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes single to compiler-options with jsonSourceFile api.js @@ -0,0 +1,27 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "moduleSuffixes": [ + "" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "moduleSuffixes": [ + "" + ], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with json api.js new file mode 100644 index 00000000000..52ced41a915 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with json api.js @@ -0,0 +1,29 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "moduleSuffixes": [ + ".ios", + "" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "moduleSuffixes": [ + ".ios", + "" + ], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..52ced41a915 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert empty string option of moduleSuffixes to compiler-options with jsonSourceFile api.js @@ -0,0 +1,29 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "moduleSuffixes": [ + ".ios", + "" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "moduleSuffixes": [ + ".ios", + "" + ], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with json api.js new file mode 100644 index 00000000000..cf59459a5d2 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with json api.js @@ -0,0 +1,31 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "jsx": "" + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "configFilePath": "tsconfig.json" +} +Errors:: +error TS6046: Argument for '--jsx' option must be: 'preserve', 'react-native', 'react', 'react-jsx', 'react-jsxdev'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..054fd964901 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of jsx to compiler-options with jsonSourceFile api.js @@ -0,0 +1,34 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "jsx": "" + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:7:10 - error TS6046: Argument for '--jsx' option must be: 'preserve', 'react-native', 'react', 'react-jsx', 'react-jsxdev'. + +7 "jsx": "" +   ~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js new file mode 100644 index 00000000000..df1ad098ca0 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with json api.js @@ -0,0 +1,39 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "es5", + "es2015.core", + "incorrectLib" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "lib.es5.d.ts", + "lib.es2015.core.d.ts" + ], + "configFilePath": "tsconfig.json" +} +Errors:: +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'decorators', 'decorators.legacy'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..5bffe79451e --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of libs to compiler-options with jsonSourceFile api.js @@ -0,0 +1,42 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "es5", + "es2015.core", + "incorrectLib" + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + "lib.es5.d.ts", + "lib.es2015.core.d.ts" + ], + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:10:4 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'decorators', 'decorators.legacy'. + +10 "incorrectLib" +   ~~~~~~~~~~~~~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js new file mode 100644 index 00000000000..3f98e115692 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with json api.js @@ -0,0 +1,29 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "configFilePath": "tsconfig.json" +} +Errors:: +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..cb967c5a0a3 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module to compiler-options with jsonSourceFile api.js @@ -0,0 +1,32 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:3:13 - error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. + +3 "module": "", +   ~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with json api.js new file mode 100644 index 00000000000..363c7ebffb6 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with json api.js @@ -0,0 +1,27 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "moduleResolution": "", + "noImplicitAny": false, + "sourceMap": false + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "noImplicitAny": false, + "sourceMap": false, + "configFilePath": "tsconfig.json" +} +Errors:: +error TS6046: Argument for '--moduleResolution' option must be: 'node10', 'classic', 'node16', 'nodenext', 'bundler'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..9085f8a5386 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of module-resolution to compiler-options with jsonSourceFile api.js @@ -0,0 +1,30 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "moduleResolution": "", + "noImplicitAny": false, + "sourceMap": false + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "noImplicitAny": false, + "sourceMap": false, + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:3:23 - error TS6046: Argument for '--moduleResolution' option must be: 'node10', 'classic', 'node16', 'nodenext', 'bundler'. + +3 "moduleResolution": "", +   ~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with json api.js new file mode 100644 index 00000000000..f30c5f75816 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with json api.js @@ -0,0 +1,29 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "newLine": "", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "configFilePath": "tsconfig.json" +} +Errors:: +error TS6046: Argument for '--newLine' option must be: 'crlf', 'lf'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..0e68f7a123d --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of newLine to compiler-options with jsonSourceFile api.js @@ -0,0 +1,32 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "newLine": "", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:3:14 - error TS6046: Argument for '--newLine' option must be: 'crlf', 'lf'. + +3 "newLine": "", +   ~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with json api.js new file mode 100644 index 00000000000..92a98d406fe --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with json api.js @@ -0,0 +1,27 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "target": "", + "noImplicitAny": false, + "sourceMap": false + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "noImplicitAny": false, + "sourceMap": false, + "configFilePath": "tsconfig.json" +} +Errors:: +error TS6046: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..6389e6a9a69 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrect option of target to compiler-options with jsonSourceFile api.js @@ -0,0 +1,30 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "target": "", + "noImplicitAny": false, + "sourceMap": false + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "noImplicitAny": false, + "sourceMap": false, + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:3:13 - error TS6046: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'. + +3 "target": "", +   ~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with json api.js new file mode 100644 index 00000000000..d83c6e50cd9 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with json api.js @@ -0,0 +1,28 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "compilerOptions": { + "modu": "commonjs" + } +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "configFilePath": "jsconfig.json" +} +Errors:: +error TS5023: Unknown compiler option 'modu'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..d20b5a97283 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format jsconfig.json to compiler-options with jsonSourceFile api.js @@ -0,0 +1,31 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "compilerOptions": { + "modu": "commonjs" + } +} + + +configFileName:: jsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true, + "configFilePath": "jsconfig.json" +} +Errors:: +jsconfig.json:3:3 - error TS5023: Unknown compiler option 'modu'. + +3 "modu": "commonjs" +   ~~~~~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with json api.js new file mode 100644 index 00000000000..34697eac42e --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with json api.js @@ -0,0 +1,23 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "modu": "commonjs" + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "tsconfig.json" +} +Errors:: +error TS5023: Unknown compiler option 'modu'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..15f0de5e8f9 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert incorrectly format tsconfig.json to compiler-options with jsonSourceFile api.js @@ -0,0 +1,26 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "modu": "commonjs" + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:3:3 - error TS5023: Unknown compiler option 'modu'. + +3 "modu": "commonjs" +   ~~~~~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with json api.js new file mode 100644 index 00000000000..814f4b9bf6d --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with json api.js @@ -0,0 +1,25 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "allowJs": true, + "maxNodeModuleJsDepth": -1 + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "maxNodeModuleJsDepth": -1, + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with jsonSourceFile api.js new file mode 100644 index 00000000000..814f4b9bf6d --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert negative numbers in tsconfig.json with jsonSourceFile api.js @@ -0,0 +1,25 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "allowJs": true, + "maxNodeModuleJsDepth": -1 + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "allowJs": true, + "maxNodeModuleJsDepth": -1, + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js new file mode 100644 index 00000000000..82972a45514 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with json api.js @@ -0,0 +1,34 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + " " + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [], + "configFilePath": "tsconfig.json" +} +Errors:: +error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'decorators', 'decorators.legacy'. + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..da2cbcca93d --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of libs to compiler-options with jsonSourceFile api.js @@ -0,0 +1,37 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": false, + "sourceMap": false, + "lib": [ + " " + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 1, + "target": 1, + "noImplicitAny": false, + "sourceMap": false, + "lib": [], + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:8:4 - error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.sharedmemory', 'es2022.string', 'es2022.regexp', 'es2023.array', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint', 'esnext.string', 'esnext.promise', 'esnext.weakref', 'decorators', 'decorators.legacy'. + +8 " " +   ~~~~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with json api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with json api.js new file mode 100644 index 00000000000..082ae9d08bd --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with json api.js @@ -0,0 +1,27 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "moduleSuffixes": [ + " " + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "moduleSuffixes": [ + " " + ], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with jsonSourceFile api.js new file mode 100644 index 00000000000..082ae9d08bd --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert trailing-whitespace string option of moduleSuffixes to compiler-options with jsonSourceFile api.js @@ -0,0 +1,27 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "moduleSuffixes": [ + " " + ] + } +} + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "moduleSuffixes": [ + " " + ], + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert tsconfig options when there are multiple invalid strings with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert tsconfig options when there are multiple invalid strings with jsonSourceFile api.js new file mode 100644 index 00000000000..d2a216a02e2 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Convert tsconfig options when there are multiple invalid strings with jsonSourceFile api.js @@ -0,0 +1,114 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "target": "<%- options.useTsWithBabel ? 'esnext' : 'es5' %>", + "module": "esnext", + <%_ if (options.classComponent) { _%> + "experimentalDecorators": true, + <%_ } _%> + "sourceMap": true, + "types": [ + "webpack-env"<% if (hasMocha || hasJest) { %>,<% } %> + <%_ if (hasMocha) { _%> + "mocha", + "chai" + <%_ } else if (hasJest) { _%> + "jest" + <%_ } _%> + ] + } +} + + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 99, + "experimentalDecorators": true, + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:1:1 - error TS5092: The root value of a 'tsconfig.json' file must be an object. + + 1 { +  ~ + 2 "compilerOptions": { +  ~~~~~~~~~~~~~~~~~~~~~~ +... + 18 } +  ~~~ + 19 } +  ~ +tsconfig.json:3:15 - error TS6046: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'. + +3 "target": "<%- options.useTsWithBabel ? 'esnext' : 'es5' %>", +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +tsconfig.json:5:7 - error TS1136: Property assignment expected. + +5 <%_ if (options.classComponent) { _%> +   ~ +tsconfig.json:5:9 - error TS1136: Property assignment expected. + +5 <%_ if (options.classComponent) { _%> +   ~~ +tsconfig.json:5:20 - error TS1327: String literal with double quotes expected. + +5 <%_ if (options.classComponent) { _%> +    +tsconfig.json:5:20 - error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal. + +5 <%_ if (options.classComponent) { _%> +   ~~~~~~~~~~~~~~~ +tsconfig.json:5:39 - error TS1136: Property assignment expected. + +5 <%_ if (options.classComponent) { _%> +   ~ +tsconfig.json:7:7 - error TS1136: Property assignment expected. + +7 <%_ } _%> +   ~ +tsconfig.json:7:11 - error TS1136: Property assignment expected. + +7 <%_ } _%> +   ~ +tsconfig.json:10:7 - error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal. + +10 "webpack-env"<% if (hasMocha || hasJest) { %>,<% } %> +   ~~~~~~~~~~~~~~~ +tsconfig.json:10:23 - error TS1136: Property assignment expected. + +10 "webpack-env"<% if (hasMocha || hasJest) { %>,<% } %> +   ~~ +tsconfig.json:11:9 - error TS1136: Property assignment expected. + +11 <%_ if (hasMocha) { _%> +   ~ +tsconfig.json:11:11 - error TS1136: Property assignment expected. + +11 <%_ if (hasMocha) { _%> +   ~~ +tsconfig.json:14:13 - error TS1327: String literal with double quotes expected. + +14 <%_ } else if (hasJest) { _%> +   ~~~~ +tsconfig.json:14:17 - error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal. + +14 <%_ } else if (hasJest) { _%> +    +tsconfig.json:14:18 - error TS1136: Property assignment expected. + +14 <%_ } else if (hasJest) { _%> +   ~~ +tsconfig.json:16:13 - error TS1136: Property assignment expected. + +16 <%_ } _%> +   ~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/Don't crash when root expression is not object at all with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Don't crash when root expression is not object at all with jsonSourceFile api.js new file mode 100644 index 00000000000..8ee271bbee8 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/Don't crash when root expression is not object at all with jsonSourceFile api.js @@ -0,0 +1,22 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +42 + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:1:1 - error TS5092: The root value of a 'tsconfig.json' file must be an object. + +1 42 +  ~~ + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/does not raise an error if you've set a compiler flag in the root when you have included 'compilerOptions' with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/does not raise an error if you've set a compiler flag in the root when you have included 'compilerOptions' with jsonSourceFile api.js new file mode 100644 index 00000000000..269283eb9d5 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/does not raise an error if you've set a compiler flag in the root when you have included 'compilerOptions' with jsonSourceFile api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "target": "esnext", + "compilerOptions": { + "module": "esnext" + } + } + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "module": 99, + "configFilePath": "tsconfig.json" +} +Errors:: + diff --git a/tests/baselines/reference/config/convertCompilerOptionsFromJson/raises an error if you've set a compiler flag in the root without including compilerOptions with jsonSourceFile api.js b/tests/baselines/reference/config/convertCompilerOptionsFromJson/raises an error if you've set a compiler flag in the root without including compilerOptions with jsonSourceFile api.js new file mode 100644 index 00000000000..64ecb5e2fc6 --- /dev/null +++ b/tests/baselines/reference/config/convertCompilerOptionsFromJson/raises an error if you've set a compiler flag in the root without including compilerOptions with jsonSourceFile api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "module": "esnext", + } + + +configFileName:: tsconfig.json +CompilerOptions:: +{ + "configFilePath": "tsconfig.json" +} +Errors:: +tsconfig.json:2:13 - error TS6258: 'module' should be set inside the 'compilerOptions' object of the config json file + +2 "module": "esnext", +   ~~~~~~~~ + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert correctly format tsconfig.json to typeAcquisition with json api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert correctly format tsconfig.json to typeAcquisition with json api.js new file mode 100644 index 00000000000..95ff0f2309a --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert correctly format tsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,38 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enable": true, + "include": [ + "0.d.ts", + "1.d.ts" + ], + "exclude": [ + "0.js", + "1.js" + ] + } +} + + +configFileName:: tsconfig.json +TypeAcquisition:: +{ + "enable": true, + "include": [ + "0.d.ts", + "1.d.ts" + ], + "exclude": [ + "0.js", + "1.js" + ] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert correctly format tsconfig.json to typeAcquisition with jsonSourceFile api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert correctly format tsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 00000000000..95ff0f2309a --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert correctly format tsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,38 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enable": true, + "include": [ + "0.d.ts", + "1.d.ts" + ], + "exclude": [ + "0.js", + "1.js" + ] + } +} + + +configFileName:: tsconfig.json +TypeAcquisition:: +{ + "enable": true, + "include": [ + "0.d.ts", + "1.d.ts" + ], + "exclude": [ + "0.js", + "1.js" + ] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default jsconfig.json to typeAcquisition with json api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default jsconfig.json to typeAcquisition with json api.js new file mode 100644 index 00000000000..868fb7743dd --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default jsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,20 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{} + + +configFileName:: jsconfig.json +TypeAcquisition:: +{ + "enable": true, + "include": [], + "exclude": [] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default jsconfig.json to typeAcquisition with jsonSourceFile api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default jsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 00000000000..868fb7743dd --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default jsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,20 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{} + + +configFileName:: jsconfig.json +TypeAcquisition:: +{ + "enable": true, + "include": [], + "exclude": [] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default tsconfig.json to typeAcquisition with json api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default tsconfig.json to typeAcquisition with json api.js new file mode 100644 index 00000000000..4b98a66335b --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default tsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,20 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{} + + +configFileName:: tsconfig.json +TypeAcquisition:: +{ + "enable": false, + "include": [], + "exclude": [] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default tsconfig.json to typeAcquisition with jsonSourceFile api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default tsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 00000000000..4b98a66335b --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert default tsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,20 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{} + + +configFileName:: tsconfig.json +TypeAcquisition:: +{ + "enable": false, + "include": [], + "exclude": [] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format jsconfig.json to typeAcquisition with json api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format jsconfig.json to typeAcquisition with json api.js new file mode 100644 index 00000000000..f93cdebf07d --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format jsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,25 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enableAutoDiscovy": true + } +} + + +configFileName:: jsconfig.json +TypeAcquisition:: +{ + "enable": true, + "include": [], + "exclude": [] +} +Errors:: +error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 00000000000..fdb27fee0f5 --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,28 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enableAutoDiscovy": true + } +} + + +configFileName:: jsconfig.json +TypeAcquisition:: +{ + "enable": true, + "include": [], + "exclude": [] +} +Errors:: +jsconfig.json:3:3 - error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. + +3 "enableAutoDiscovy": true +   ~~~~~~~~~~~~~~~~~~~ + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format tsconfig.json to typeAcquisition with json api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format tsconfig.json to typeAcquisition with json api.js new file mode 100644 index 00000000000..ec3afbb22ba --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format tsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,25 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enableAutoDiscovy": true + } +} + + +configFileName:: tsconfig.json +TypeAcquisition:: +{ + "enable": false, + "include": [], + "exclude": [] +} +Errors:: +error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 00000000000..b2e3f9703ca --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,28 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enableAutoDiscovy": true + } +} + + +configFileName:: tsconfig.json +TypeAcquisition:: +{ + "enable": false, + "include": [], + "exclude": [] +} +Errors:: +tsconfig.json:3:3 - error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. + +3 "enableAutoDiscovy": true +   ~~~~~~~~~~~~~~~~~~~ + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json to typeAcquisition with json api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json to typeAcquisition with json api.js new file mode 100644 index 00000000000..654798085f9 --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json to typeAcquisition with json api.js @@ -0,0 +1,34 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enable": false, + "include": [ + "0.d.ts" + ], + "exclude": [ + "0.js" + ] + } +} + + +configFileName:: jsconfig.json +TypeAcquisition:: +{ + "enable": false, + "include": [ + "0.d.ts" + ], + "exclude": [ + "0.js" + ] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json to typeAcquisition with jsonSourceFile api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 00000000000..654798085f9 --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,34 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enable": false, + "include": [ + "0.d.ts" + ], + "exclude": [ + "0.js" + ] + } +} + + +configFileName:: jsconfig.json +TypeAcquisition:: +{ + "enable": false, + "include": [ + "0.d.ts" + ], + "exclude": [ + "0.js" + ] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json with only enable property to typeAcquisition with json api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json with only enable property to typeAcquisition with json api.js new file mode 100644 index 00000000000..c5b848a23b5 --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json with only enable property to typeAcquisition with json api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enable": false + } +} + + +configFileName:: jsconfig.json +TypeAcquisition:: +{ + "enable": false, + "include": [], + "exclude": [] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 00000000000..c5b848a23b5 --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert jsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/jsconfig.json] +{ + "typeAcquisition": { + "enable": false + } +} + + +configFileName:: jsconfig.json +TypeAcquisition:: +{ + "enable": false, + "include": [], + "exclude": [] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert tsconfig.json with only enable property to typeAcquisition with json api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert tsconfig.json with only enable property to typeAcquisition with json api.js new file mode 100644 index 00000000000..e9cfcace7b5 --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert tsconfig.json with only enable property to typeAcquisition with json api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enable": true + } +} + + +configFileName:: tsconfig.json +TypeAcquisition:: +{ + "enable": true, + "include": [], + "exclude": [] +} +Errors:: + diff --git a/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert tsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert tsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js new file mode 100644 index 00000000000..e9cfcace7b5 --- /dev/null +++ b/tests/baselines/reference/config/convertTypeAcquisitionFromJson/Convert tsconfig.json with only enable property to typeAcquisition with jsonSourceFile api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/b.js] + + +//// [/apath/tsconfig.json] +{ + "typeAcquisition": { + "enable": true + } +} + + +configFileName:: tsconfig.json +TypeAcquisition:: +{ + "enable": true, + "include": [], + "exclude": [] +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/Expands z to z/starstart/star with json api.js b/tests/baselines/reference/config/matchFiles/Expands z to z/starstart/star with json api.js new file mode 100644 index 00000000000..3998377aab0 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/Expands z to z/starstart/star with json api.js @@ -0,0 +1,109 @@ +config: +{ + "include": [ + "z" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/z/a.ts", + "c:/dev/z/aba.ts", + "c:/dev/z/abz.ts", + "c:/dev/z/b.ts", + "c:/dev/z/bba.ts", + "c:/dev/z/bbz.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "z" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev/z": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/Expands z to z/starstart/star with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/Expands z to z/starstart/star with jsonSourceFile api.js new file mode 100644 index 00000000000..57ebdd5c647 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/Expands z to z/starstart/star with jsonSourceFile api.js @@ -0,0 +1,108 @@ +config: +{ + "include": [ + "z" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/z/a.ts", + "c:/dev/z/aba.ts", + "c:/dev/z/abz.ts", + "c:/dev/z/b.ts", + "c:/dev/z/bba.ts", + "c:/dev/z/bbz.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "z" + ] + }, + "wildcardDirectories": { + "c:/dev/z": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/always include literal files with json api.js b/tests/baselines/reference/config/matchFiles/always include literal files with json api.js new file mode 100644 index 00000000000..a80b94f9b68 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/always include literal files with json api.js @@ -0,0 +1,116 @@ +config: +{ + "files": [ + "a.ts" + ], + "include": [ + "*/z.ts" + ], + "exclude": [ + "**/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "files": [ + "a.ts" + ], + "include": [ + "*/z.ts" + ], + "exclude": [ + "**/a.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/always include literal files with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/always include literal files with jsonSourceFile api.js new file mode 100644 index 00000000000..1c730b32eb5 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/always include literal files with jsonSourceFile api.js @@ -0,0 +1,115 @@ +config: +{ + "files": [ + "a.ts" + ], + "include": [ + "*/z.ts" + ], + "exclude": [ + "**/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "files": [ + "a.ts" + ], + "include": [ + "*/z.ts" + ], + "exclude": [ + "**/a.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and empty exclude with json api.js b/tests/baselines/reference/config/matchFiles/and empty exclude with json api.js new file mode 100644 index 00000000000..1bee3c7ab69 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and empty exclude with json api.js @@ -0,0 +1,62 @@ +config: +{ + "include": [ + "**/a.ts" + ], + "exclude": [] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ], + "exclude": [], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and empty exclude with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/and empty exclude with jsonSourceFile api.js new file mode 100644 index 00000000000..d4ece58b81d --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and empty exclude with jsonSourceFile api.js @@ -0,0 +1,61 @@ +config: +{ + "include": [ + "**/a.ts" + ], + "exclude": [] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ], + "exclude": [] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and exclusions with json api.js b/tests/baselines/reference/config/matchFiles/and exclusions with json api.js new file mode 100644 index 00000000000..b32af48d227 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and exclusions with json api.js @@ -0,0 +1,66 @@ +config: +{ + "include": [ + "**/?.ts" + ], + "exclude": [ + "a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/b.ts", + "c:/dev/x/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/?.ts" + ], + "exclude": [ + "a.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and exclusions with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/and exclusions with jsonSourceFile api.js new file mode 100644 index 00000000000..2365e1a7903 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and exclusions with jsonSourceFile api.js @@ -0,0 +1,65 @@ +config: +{ + "include": [ + "**/?.ts" + ], + "exclude": [ + "a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/b.ts", + "c:/dev/x/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/?.ts" + ], + "exclude": [ + "a.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and explicit recursive include with json api.js b/tests/baselines/reference/config/matchFiles/and explicit recursive include with json api.js new file mode 100644 index 00000000000..1821e59ed23 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and explicit recursive include with json api.js @@ -0,0 +1,63 @@ +config: +{ + "include": [ + "**/a.ts", + "**/node_modules/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/node_modules/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts", + "**/node_modules/a.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and explicit recursive include with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/and explicit recursive include with jsonSourceFile api.js new file mode 100644 index 00000000000..3f47bed36a9 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and explicit recursive include with jsonSourceFile api.js @@ -0,0 +1,62 @@ +config: +{ + "include": [ + "**/a.ts", + "**/node_modules/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/node_modules/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts", + "**/node_modules/a.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and explicit wildcard include with json api.js b/tests/baselines/reference/config/matchFiles/and explicit wildcard include with json api.js new file mode 100644 index 00000000000..83bee1dabe6 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and explicit wildcard include with json api.js @@ -0,0 +1,62 @@ +config: +{ + "include": [ + "*/a.ts", + "node_modules/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/a.ts", + "c:/dev/node_modules/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*/a.ts", + "node_modules/a.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and explicit wildcard include with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/and explicit wildcard include with jsonSourceFile api.js new file mode 100644 index 00000000000..421e96679c6 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and explicit wildcard include with jsonSourceFile api.js @@ -0,0 +1,61 @@ +config: +{ + "include": [ + "*/a.ts", + "node_modules/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/a.ts", + "c:/dev/node_modules/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*/a.ts", + "node_modules/a.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and no exclusions with json api.js b/tests/baselines/reference/config/matchFiles/and no exclusions with json api.js new file mode 100644 index 00000000000..d731b74f840 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and no exclusions with json api.js @@ -0,0 +1,60 @@ +config: +{ + "include": [ + "**/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and no exclusions with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/and no exclusions with jsonSourceFile api.js new file mode 100644 index 00000000000..a5462b86bb3 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and no exclusions with jsonSourceFile api.js @@ -0,0 +1,59 @@ +config: +{ + "include": [ + "**/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and wildcard include with json api.js b/tests/baselines/reference/config/matchFiles/and wildcard include with json api.js new file mode 100644 index 00000000000..fe0804dc6a4 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and wildcard include with json api.js @@ -0,0 +1,59 @@ +config: +{ + "include": [ + "*/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*/a.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/and wildcard include with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/and wildcard include with jsonSourceFile api.js new file mode 100644 index 00000000000..7e28ff89961 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/and wildcard include with jsonSourceFile api.js @@ -0,0 +1,58 @@ +config: +{ + "include": [ + "*/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*/a.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/are not removed due to excludes with json api.js b/tests/baselines/reference/config/matchFiles/are not removed due to excludes with json api.js new file mode 100644 index 00000000000..2b5129a8a20 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/are not removed due to excludes with json api.js @@ -0,0 +1,111 @@ +config: +{ + "files": [ + "a.ts", + "b.ts" + ], + "exclude": [ + "b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "files": [ + "a.ts", + "b.ts" + ], + "exclude": [ + "b.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/are not removed due to excludes with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/are not removed due to excludes with jsonSourceFile api.js new file mode 100644 index 00000000000..db253ef243a --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/are not removed due to excludes with jsonSourceFile api.js @@ -0,0 +1,110 @@ +config: +{ + "files": [ + "a.ts", + "b.ts" + ], + "exclude": [ + "b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "files": [ + "a.ts", + "b.ts" + ], + "exclude": [ + "b.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/can exclude dirs whose pattern starts with starstar with json api.js b/tests/baselines/reference/config/matchFiles/can exclude dirs whose pattern starts with starstar with json api.js new file mode 100644 index 00000000000..98c1a4543d9 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/can exclude dirs whose pattern starts with starstar with json api.js @@ -0,0 +1,97 @@ +config: +{ + "exclude": [ + "**/x" + ] +} +Fs:: +//// [/dev/A.ts] + + +//// [/dev/B.ts] + + +//// [/dev/a.d.ts] + + +//// [/dev/a.js] + + +//// [/dev/a.ts] + + +//// [/dev/b.js] + + +//// [/dev/b.ts] + + +//// [/dev/c.d.ts] + + +//// [/dev/js/a.js] + + +//// [/dev/js/b.js] + + +//// [/dev/q/a/c/b/d.ts] + + +//// [/dev/x/a.ts] + + +//// [/dev/x/b.ts] + + +//// [/dev/x/y/a.ts] + + +//// [/dev/x/y/b.ts] + + +//// [/dev/z/a.ts] + + +//// [/dev/z/aba.ts] + + +//// [/dev/z/abz.ts] + + +//// [/dev/z/b.ts] + + +//// [/dev/z/bba.ts] + + +//// [/dev/z/bbz.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "exclude": [ + "**/x" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["**/x"]'. + diff --git a/tests/baselines/reference/config/matchFiles/can exclude dirs whose pattern starts with starstar with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/can exclude dirs whose pattern starts with starstar with jsonSourceFile api.js new file mode 100644 index 00000000000..c0cc715e610 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/can exclude dirs whose pattern starts with starstar with jsonSourceFile api.js @@ -0,0 +1,96 @@ +config: +{ + "exclude": [ + "**/x" + ] +} +Fs:: +//// [/dev/A.ts] + + +//// [/dev/B.ts] + + +//// [/dev/a.d.ts] + + +//// [/dev/a.js] + + +//// [/dev/a.ts] + + +//// [/dev/b.js] + + +//// [/dev/b.ts] + + +//// [/dev/c.d.ts] + + +//// [/dev/js/a.js] + + +//// [/dev/js/b.js] + + +//// [/dev/q/a/c/b/d.ts] + + +//// [/dev/x/a.ts] + + +//// [/dev/x/b.ts] + + +//// [/dev/x/y/a.ts] + + +//// [/dev/x/y/b.ts] + + +//// [/dev/z/a.ts] + + +//// [/dev/z/aba.ts] + + +//// [/dev/z/abz.ts] + + +//// [/dev/z/b.ts] + + +//// [/dev/z/bba.ts] + + +//// [/dev/z/bbz.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "exclude": [ + "**/x" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["**/x"]'. + diff --git a/tests/baselines/reference/config/matchFiles/can include dirs whose pattern starts with starstart with json api.js b/tests/baselines/reference/config/matchFiles/can include dirs whose pattern starts with starstart with json api.js new file mode 100644 index 00000000000..c0baf78d540 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/can include dirs whose pattern starts with starstart with json api.js @@ -0,0 +1,99 @@ +config: +{ + "include": [ + "**/x", + "**/a/**/b" + ] +} +Fs:: +//// [/dev/A.ts] + + +//// [/dev/B.ts] + + +//// [/dev/a.d.ts] + + +//// [/dev/a.js] + + +//// [/dev/a.ts] + + +//// [/dev/b.js] + + +//// [/dev/b.ts] + + +//// [/dev/c.d.ts] + + +//// [/dev/js/a.js] + + +//// [/dev/js/b.js] + + +//// [/dev/q/a/c/b/d.ts] + + +//// [/dev/x/a.ts] + + +//// [/dev/x/b.ts] + + +//// [/dev/x/y/a.ts] + + +//// [/dev/x/y/b.ts] + + +//// [/dev/z/a.ts] + + +//// [/dev/z/aba.ts] + + +//// [/dev/z/abz.ts] + + +//// [/dev/z/b.ts] + + +//// [/dev/z/bba.ts] + + +//// [/dev/z/bbz.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/x", + "**/a/**/b" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/x","**/a/**/b"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/can include dirs whose pattern starts with starstart with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/can include dirs whose pattern starts with starstart with jsonSourceFile api.js new file mode 100644 index 00000000000..16e9270262f --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/can include dirs whose pattern starts with starstart with jsonSourceFile api.js @@ -0,0 +1,98 @@ +config: +{ + "include": [ + "**/x", + "**/a/**/b" + ] +} +Fs:: +//// [/dev/A.ts] + + +//// [/dev/B.ts] + + +//// [/dev/a.d.ts] + + +//// [/dev/a.js] + + +//// [/dev/a.ts] + + +//// [/dev/b.js] + + +//// [/dev/b.ts] + + +//// [/dev/c.d.ts] + + +//// [/dev/js/a.js] + + +//// [/dev/js/b.js] + + +//// [/dev/q/a/c/b/d.ts] + + +//// [/dev/x/a.ts] + + +//// [/dev/x/b.ts] + + +//// [/dev/x/y/a.ts] + + +//// [/dev/x/y/b.ts] + + +//// [/dev/z/a.ts] + + +//// [/dev/z/aba.ts] + + +//// [/dev/z/abz.ts] + + +//// [/dev/z/b.ts] + + +//// [/dev/z/bba.ts] + + +//// [/dev/z/bbz.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/x", + "**/a/**/b" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/x","**/a/**/b"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case insensitive with json api.js b/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case insensitive with json api.js new file mode 100644 index 00000000000..7d4e7367994 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case insensitive with json api.js @@ -0,0 +1,39 @@ +config: +{} +Fs:: +//// [c:/dev/xylophone.ts] + + +//// [c:/dev/Yosemite.ts] + + +//// [c:/dev/zebra.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/Yosemite.ts", + "c:/dev/xylophone.ts", + "c:/dev/zebra.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case insensitive with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case insensitive with jsonSourceFile api.js new file mode 100644 index 00000000000..287a1a916dd --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case insensitive with jsonSourceFile api.js @@ -0,0 +1,37 @@ +config: +{} +Fs:: +//// [c:/dev/xylophone.ts] + + +//// [c:/dev/Yosemite.ts] + + +//// [c:/dev/zebra.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/Yosemite.ts", + "c:/dev/xylophone.ts", + "c:/dev/zebra.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": {}, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case sensitive with json api.js b/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case sensitive with json api.js new file mode 100644 index 00000000000..dcdf5cebde4 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case sensitive with json api.js @@ -0,0 +1,36 @@ +config: +{} +Fs:: +//// [/dev/Yosemite.ts] + + +//// [/dev/xylophone.ts] + + +//// [/dev/zebra.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case sensitive with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case sensitive with jsonSourceFile api.js new file mode 100644 index 00000000000..dc0755bf6f3 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/can include files in the same order on multiple platforms case sensitive with jsonSourceFile api.js @@ -0,0 +1,34 @@ +config: +{} +Fs:: +//// [/dev/Yosemite.ts] + + +//// [/dev/xylophone.ts] + + +//// [/dev/zebra.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": {}, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/case sensitive with json api.js b/tests/baselines/reference/config/matchFiles/case sensitive with json api.js new file mode 100644 index 00000000000..eacd16926c4 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/case sensitive with json api.js @@ -0,0 +1,97 @@ +config: +{ + "include": [ + "**/A.ts" + ] +} +Fs:: +//// [/dev/A.ts] + + +//// [/dev/B.ts] + + +//// [/dev/a.d.ts] + + +//// [/dev/a.js] + + +//// [/dev/a.ts] + + +//// [/dev/b.js] + + +//// [/dev/b.ts] + + +//// [/dev/c.d.ts] + + +//// [/dev/js/a.js] + + +//// [/dev/js/b.js] + + +//// [/dev/q/a/c/b/d.ts] + + +//// [/dev/x/a.ts] + + +//// [/dev/x/b.ts] + + +//// [/dev/x/y/a.ts] + + +//// [/dev/x/y/b.ts] + + +//// [/dev/z/a.ts] + + +//// [/dev/z/aba.ts] + + +//// [/dev/z/abz.ts] + + +//// [/dev/z/b.ts] + + +//// [/dev/z/bba.ts] + + +//// [/dev/z/bbz.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/A.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/A.ts"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/case sensitive with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/case sensitive with jsonSourceFile api.js new file mode 100644 index 00000000000..8354874b166 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/case sensitive with jsonSourceFile api.js @@ -0,0 +1,96 @@ +config: +{ + "include": [ + "**/A.ts" + ] +} +Fs:: +//// [/dev/A.ts] + + +//// [/dev/B.ts] + + +//// [/dev/a.d.ts] + + +//// [/dev/a.js] + + +//// [/dev/a.ts] + + +//// [/dev/b.js] + + +//// [/dev/b.ts] + + +//// [/dev/c.d.ts] + + +//// [/dev/js/a.js] + + +//// [/dev/js/b.js] + + +//// [/dev/q/a/c/b/d.ts] + + +//// [/dev/x/a.ts] + + +//// [/dev/x/b.ts] + + +//// [/dev/x/y/a.ts] + + +//// [/dev/x/y/b.ts] + + +//// [/dev/z/a.ts] + + +//// [/dev/z/aba.ts] + + +//// [/dev/z/abz.ts] + + +//// [/dev/z/b.ts] + + +//// [/dev/z/bba.ts] + + +//// [/dev/z/bbz.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/A.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/A.ts"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/exclude .js files when allowJs=false with json api.js b/tests/baselines/reference/config/matchFiles/exclude .js files when allowJs=false with json api.js new file mode 100644 index 00000000000..8abd00d303d --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/exclude .js files when allowJs=false with json api.js @@ -0,0 +1,110 @@ +config: +{ + "compilerOptions": { + "allowJs": false + }, + "include": [ + "js/*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": false, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": false + }, + "include": [ + "js/*" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev/js": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["js/*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/exclude .js files when allowJs=false with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/exclude .js files when allowJs=false with jsonSourceFile api.js new file mode 100644 index 00000000000..8abe45c57bd --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/exclude .js files when allowJs=false with jsonSourceFile api.js @@ -0,0 +1,109 @@ +config: +{ + "compilerOptions": { + "allowJs": false + }, + "include": [ + "js/*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": false, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": false + }, + "include": [ + "js/*" + ] + }, + "wildcardDirectories": { + "c:/dev/js": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["js/*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/exclude .min.js files using wildcards with json api.js b/tests/baselines/reference/config/matchFiles/exclude .min.js files using wildcards with json api.js new file mode 100644 index 00000000000..f2515327be3 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/exclude .min.js files using wildcards with json api.js @@ -0,0 +1,117 @@ +config: +{ + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*.min.js" + ], + "exclude": [ + "js/a*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/js/d.min.js" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*.min.js" + ], + "exclude": [ + "js/a*" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev/js": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/exclude .min.js files using wildcards with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/exclude .min.js files using wildcards with jsonSourceFile api.js new file mode 100644 index 00000000000..f4f481ce27a --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/exclude .min.js files using wildcards with jsonSourceFile api.js @@ -0,0 +1,116 @@ +config: +{ + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*.min.js" + ], + "exclude": [ + "js/a*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/js/d.min.js" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*.min.js" + ], + "exclude": [ + "js/a*" + ] + }, + "wildcardDirectories": { + "c:/dev/js": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/exclude files with .. in their name with json api.js b/tests/baselines/reference/config/matchFiles/exclude files with .. in their name with json api.js new file mode 100644 index 00000000000..2b8d54e5382 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/exclude files with .. in their name with json api.js @@ -0,0 +1,110 @@ +config: +{ + "include": [ + "c:/ext/**/*" + ], + "exclude": [ + "c:/ext/b/a..b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/ext/ext.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "c:/ext/**/*" + ], + "exclude": [ + "c:/ext/b/a..b.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/ext": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/exclude files with .. in their name with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/exclude files with .. in their name with jsonSourceFile api.js new file mode 100644 index 00000000000..3c749ba5aef --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/exclude files with .. in their name with jsonSourceFile api.js @@ -0,0 +1,109 @@ +config: +{ + "include": [ + "c:/ext/**/*" + ], + "exclude": [ + "c:/ext/b/a..b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/ext/ext.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "c:/ext/**/*" + ], + "exclude": [ + "c:/ext/b/a..b.ts" + ] + }, + "wildcardDirectories": { + "c:/ext": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/exclude folders with json api.js b/tests/baselines/reference/config/matchFiles/exclude folders with json api.js new file mode 100644 index 00000000000..bfbc9b3dc00 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/exclude folders with json api.js @@ -0,0 +1,114 @@ +config: +{ + "include": [ + "**/*" + ], + "exclude": [ + "z", + "x" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/c.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/*" + ], + "exclude": [ + "z", + "x" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/exclude folders with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/exclude folders with jsonSourceFile api.js new file mode 100644 index 00000000000..2345662ea47 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/exclude folders with jsonSourceFile api.js @@ -0,0 +1,113 @@ +config: +{ + "include": [ + "**/*" + ], + "exclude": [ + "z", + "x" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/c.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/*" + ], + "exclude": [ + "z", + "x" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/exclude paths outside of the project using relative paths with json api.js b/tests/baselines/reference/config/matchFiles/exclude paths outside of the project using relative paths with json api.js new file mode 100644 index 00000000000..373996f1495 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/exclude paths outside of the project using relative paths with json api.js @@ -0,0 +1,107 @@ +config: +{ + "include": [ + "c:/**/*" + ], + "exclude": [ + "../**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "c:/**/*" + ], + "exclude": [ + "../**" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["c:/**/*"]' and 'exclude' paths were '["../**"]'. + diff --git a/tests/baselines/reference/config/matchFiles/exclude paths outside of the project using relative paths with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/exclude paths outside of the project using relative paths with jsonSourceFile api.js new file mode 100644 index 00000000000..aacae1a8299 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/exclude paths outside of the project using relative paths with jsonSourceFile api.js @@ -0,0 +1,106 @@ +config: +{ + "include": [ + "c:/**/*" + ], + "exclude": [ + "../**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "c:/**/*" + ], + "exclude": [ + "../**" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["c:/**/*"]' and 'exclude' paths were '["../**"]'. + diff --git a/tests/baselines/reference/config/matchFiles/in excludes after a subdirectory with json api.js b/tests/baselines/reference/config/matchFiles/in excludes after a subdirectory with json api.js new file mode 100644 index 00000000000..3792b9bc78c --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in excludes after a subdirectory with json api.js @@ -0,0 +1,114 @@ +config: +{ + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/y/.." + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/x/y/a.ts", + "c:/dev/z/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/y/.." + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/y/..'. + diff --git a/tests/baselines/reference/config/matchFiles/in excludes after a subdirectory with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/in excludes after a subdirectory with jsonSourceFile api.js new file mode 100644 index 00000000000..5af1e5230aa --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in excludes after a subdirectory with jsonSourceFile api.js @@ -0,0 +1,116 @@ +config: +{ + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/y/.." + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/x/y/a.ts", + "c:/dev/z/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/y/.." + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +tsconfig.json:6:3 - error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/y/..'. + +6 "**/y/.." +   ~~~~~~~~~ + diff --git a/tests/baselines/reference/config/matchFiles/in excludes immediately after with json api.js b/tests/baselines/reference/config/matchFiles/in excludes immediately after with json api.js new file mode 100644 index 00000000000..eb4c641aef2 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in excludes immediately after with json api.js @@ -0,0 +1,114 @@ +config: +{ + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/.." + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/x/y/a.ts", + "c:/dev/z/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/.." + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/..'. + diff --git a/tests/baselines/reference/config/matchFiles/in excludes immediately after with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/in excludes immediately after with jsonSourceFile api.js new file mode 100644 index 00000000000..d0e3d6356e4 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in excludes immediately after with jsonSourceFile api.js @@ -0,0 +1,116 @@ +config: +{ + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/.." + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/x/y/a.ts", + "c:/dev/z/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/.." + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +tsconfig.json:6:3 - error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/..'. + +6 "**/.." +   ~~~~~~~ + diff --git a/tests/baselines/reference/config/matchFiles/in excludes with json api.js b/tests/baselines/reference/config/matchFiles/in excludes with json api.js new file mode 100644 index 00000000000..fdea974132a --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in excludes with json api.js @@ -0,0 +1,111 @@ +config: +{ + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/x/**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/z/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/x/**" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/in excludes with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/in excludes with jsonSourceFile api.js new file mode 100644 index 00000000000..2c35e4f366b --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in excludes with jsonSourceFile api.js @@ -0,0 +1,110 @@ +config: +{ + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/x/**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/z/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ], + "exclude": [ + "**/x/**" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/in excludes with trailing recursive directory with json api.js b/tests/baselines/reference/config/matchFiles/in excludes with trailing recursive directory with json api.js new file mode 100644 index 00000000000..989b631a68f --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in excludes with trailing recursive directory with json api.js @@ -0,0 +1,107 @@ +config: +{ + "include": [ + "**/*" + ], + "exclude": [ + "**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/*" + ], + "exclude": [ + "**" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["**"]'. + diff --git a/tests/baselines/reference/config/matchFiles/in excludes with trailing recursive directory with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/in excludes with trailing recursive directory with jsonSourceFile api.js new file mode 100644 index 00000000000..06b77203f52 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in excludes with trailing recursive directory with jsonSourceFile api.js @@ -0,0 +1,106 @@ +config: +{ + "include": [ + "**/*" + ], + "exclude": [ + "**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/*" + ], + "exclude": [ + "**" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["**"]'. + diff --git a/tests/baselines/reference/config/matchFiles/in includes after a subdirectory with json api.js b/tests/baselines/reference/config/matchFiles/in includes after a subdirectory with json api.js new file mode 100644 index 00000000000..85c93a0b484 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in includes after a subdirectory with json api.js @@ -0,0 +1,102 @@ +config: +{ + "include": [ + "**/y/../*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/y/../*" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/y/../*'. +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/y/../*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/in includes after a subdirectory with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/in includes after a subdirectory with jsonSourceFile api.js new file mode 100644 index 00000000000..b6cd1c33ddc --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in includes after a subdirectory with jsonSourceFile api.js @@ -0,0 +1,104 @@ +config: +{ + "include": [ + "**/y/../*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/y/../*" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +tsconfig.json:3:3 - error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/y/../*'. + +3 "**/y/../*" +   ~~~~~~~~~~~ +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/y/../*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/in includes immediately after with json api.js b/tests/baselines/reference/config/matchFiles/in includes immediately after with json api.js new file mode 100644 index 00000000000..ae93f65c99c --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in includes immediately after with json api.js @@ -0,0 +1,102 @@ +config: +{ + "include": [ + "**/../*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/../*" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*'. +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/../*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/in includes immediately after with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/in includes immediately after with jsonSourceFile api.js new file mode 100644 index 00000000000..c073e84ce2d --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in includes immediately after with jsonSourceFile api.js @@ -0,0 +1,104 @@ +config: +{ + "include": [ + "**/../*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/../*" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +tsconfig.json:3:3 - error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*'. + +3 "**/../*" +   ~~~~~~~~~ +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/../*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/in includes with multiple recursive directory patterns with json api.js b/tests/baselines/reference/config/matchFiles/in includes with multiple recursive directory patterns with json api.js new file mode 100644 index 00000000000..cf4673cab1b --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in includes with multiple recursive directory patterns with json api.js @@ -0,0 +1,108 @@ +config: +{ + "include": [ + "**/x/**/*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/a.ts", + "c:/dev/x/aa.ts", + "c:/dev/x/b.ts", + "c:/dev/x/y/a.ts", + "c:/dev/x/y/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/x/**/*" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/in includes with multiple recursive directory patterns with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/in includes with multiple recursive directory patterns with jsonSourceFile api.js new file mode 100644 index 00000000000..0ee0690bf7e --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in includes with multiple recursive directory patterns with jsonSourceFile api.js @@ -0,0 +1,107 @@ +config: +{ + "include": [ + "**/x/**/*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/a.ts", + "c:/dev/x/aa.ts", + "c:/dev/x/b.ts", + "c:/dev/x/y/a.ts", + "c:/dev/x/y/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/x/**/*" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/in includes with trailing recursive directory with json api.js b/tests/baselines/reference/config/matchFiles/in includes with trailing recursive directory with json api.js new file mode 100644 index 00000000000..2df0a02448b --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in includes with trailing recursive directory with json api.js @@ -0,0 +1,102 @@ +config: +{ + "include": [ + "**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS5010: File specification cannot end in a recursive directory wildcard ('**'): '**'. +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/in includes with trailing recursive directory with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/in includes with trailing recursive directory with jsonSourceFile api.js new file mode 100644 index 00000000000..59e50c45b49 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/in includes with trailing recursive directory with jsonSourceFile api.js @@ -0,0 +1,104 @@ +config: +{ + "include": [ + "**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +tsconfig.json:3:3 - error TS5010: File specification cannot end in a recursive directory wildcard ('**'): '**'. + +3 "**" +   ~~~~ +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/include .js files when allowJs=true with json api.js b/tests/baselines/reference/config/matchFiles/include .js files when allowJs=true with json api.js new file mode 100644 index 00000000000..e659849dc28 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/include .js files when allowJs=true with json api.js @@ -0,0 +1,112 @@ +config: +{ + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/js/a.js", + "c:/dev/js/b.js" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev/js": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/include .js files when allowJs=true with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/include .js files when allowJs=true with jsonSourceFile api.js new file mode 100644 index 00000000000..c64b0de13e8 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/include .js files when allowJs=true with jsonSourceFile api.js @@ -0,0 +1,111 @@ +config: +{ + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/js/a.js", + "c:/dev/js/b.js" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*" + ] + }, + "wildcardDirectories": { + "c:/dev/js": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/include explicitly listed .min.js files when allowJs=true with json api.js b/tests/baselines/reference/config/matchFiles/include explicitly listed .min.js files when allowJs=true with json api.js new file mode 100644 index 00000000000..245e50e95e7 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/include explicitly listed .min.js files when allowJs=true with json api.js @@ -0,0 +1,112 @@ +config: +{ + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*.min.js" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/js/ab.min.js", + "c:/dev/js/d.min.js" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*.min.js" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev/js": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/include explicitly listed .min.js files when allowJs=true with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/include explicitly listed .min.js files when allowJs=true with jsonSourceFile api.js new file mode 100644 index 00000000000..988d5a28c32 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/include explicitly listed .min.js files when allowJs=true with jsonSourceFile api.js @@ -0,0 +1,111 @@ +config: +{ + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*.min.js" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/js/ab.min.js", + "c:/dev/js/d.min.js" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": true + }, + "include": [ + "js/*.min.js" + ] + }, + "wildcardDirectories": { + "c:/dev/js": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/include files with .. in their name with json api.js b/tests/baselines/reference/config/matchFiles/include files with .. in their name with json api.js new file mode 100644 index 00000000000..f1131049a06 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/include files with .. in their name with json api.js @@ -0,0 +1,108 @@ +config: +{ + "include": [ + "c:/ext/b/a..b.ts" + ], + "exclude": [ + "**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/ext/b/a..b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "c:/ext/b/a..b.ts" + ], + "exclude": [ + "**" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/include files with .. in their name with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/include files with .. in their name with jsonSourceFile api.js new file mode 100644 index 00000000000..6230b48f3ed --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/include files with .. in their name with jsonSourceFile api.js @@ -0,0 +1,107 @@ +config: +{ + "include": [ + "c:/ext/b/a..b.ts" + ], + "exclude": [ + "**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/ext/b/a..b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "c:/ext/b/a..b.ts" + ], + "exclude": [ + "**" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/include paths outside of the project using relative paths with json api.js b/tests/baselines/reference/config/matchFiles/include paths outside of the project using relative paths with json api.js new file mode 100644 index 00000000000..0cff994f910 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/include paths outside of the project using relative paths with json api.js @@ -0,0 +1,112 @@ +config: +{ + "include": [ + "*", + "../ext/*" + ], + "exclude": [ + "**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/ext/ext.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*", + "../ext/*" + ], + "exclude": [ + "**" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/ext": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/include paths outside of the project using relative paths with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/include paths outside of the project using relative paths with jsonSourceFile api.js new file mode 100644 index 00000000000..35e261c5b2e --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/include paths outside of the project using relative paths with jsonSourceFile api.js @@ -0,0 +1,111 @@ +config: +{ + "include": [ + "*", + "../ext/*" + ], + "exclude": [ + "**" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/ext/ext.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*", + "../ext/*" + ], + "exclude": [ + "**" + ] + }, + "wildcardDirectories": { + "c:/ext": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/include paths outside of the project with json api.js b/tests/baselines/reference/config/matchFiles/include paths outside of the project with json api.js new file mode 100644 index 00000000000..168a943a715 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/include paths outside of the project with json api.js @@ -0,0 +1,110 @@ +config: +{ + "include": [ + "*", + "c:/ext/*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/c.d.ts", + "c:/ext/ext.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*", + "c:/ext/*" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None", + "c:/ext": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/include paths outside of the project with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/include paths outside of the project with jsonSourceFile api.js new file mode 100644 index 00000000000..9b5fc7cb68a --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/include paths outside of the project with jsonSourceFile api.js @@ -0,0 +1,109 @@ +config: +{ + "include": [ + "*", + "c:/ext/*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/c.d.ts", + "c:/ext/ext.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*", + "c:/ext/*" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None", + "c:/ext": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/is sorted in include order, then in alphabetical order with json api.js b/tests/baselines/reference/config/matchFiles/is sorted in include order, then in alphabetical order with json api.js new file mode 100644 index 00000000000..754659c9633 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/is sorted in include order, then in alphabetical order with json api.js @@ -0,0 +1,115 @@ +config: +{ + "include": [ + "z/*.ts", + "x/*.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/z/a.ts", + "c:/dev/z/aba.ts", + "c:/dev/z/abz.ts", + "c:/dev/z/b.ts", + "c:/dev/z/bba.ts", + "c:/dev/z/bbz.ts", + "c:/dev/x/a.ts", + "c:/dev/x/aa.ts", + "c:/dev/x/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "z/*.ts", + "x/*.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev/z": "WatchDirectoryFlags.None", + "c:/dev/x": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/is sorted in include order, then in alphabetical order with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/is sorted in include order, then in alphabetical order with jsonSourceFile api.js new file mode 100644 index 00000000000..4961455ad98 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/is sorted in include order, then in alphabetical order with jsonSourceFile api.js @@ -0,0 +1,114 @@ +config: +{ + "include": [ + "z/*.ts", + "x/*.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/z/a.ts", + "c:/dev/z/aba.ts", + "c:/dev/z/abz.ts", + "c:/dev/z/b.ts", + "c:/dev/z/bba.ts", + "c:/dev/z/bbz.ts", + "c:/dev/x/a.ts", + "c:/dev/x/aa.ts", + "c:/dev/x/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "z/*.ts", + "x/*.ts" + ] + }, + "wildcardDirectories": { + "c:/dev/z": "WatchDirectoryFlags.None", + "c:/dev/x": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/missing files are still present with json api.js b/tests/baselines/reference/config/matchFiles/missing files are still present with json api.js new file mode 100644 index 00000000000..0e856bcc8dd --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/missing files are still present with json api.js @@ -0,0 +1,105 @@ +config: +{ + "files": [ + "z.ts", + "x.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/z.ts", + "c:/dev/x.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "files": [ + "z.ts", + "x.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/missing files are still present with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/missing files are still present with jsonSourceFile api.js new file mode 100644 index 00000000000..0a8f3b90d49 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/missing files are still present with jsonSourceFile api.js @@ -0,0 +1,104 @@ +config: +{ + "files": [ + "z.ts", + "x.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/z.ts", + "c:/dev/x.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "files": [ + "z.ts", + "x.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/question matches only a single character with json api.js b/tests/baselines/reference/config/matchFiles/question matches only a single character with json api.js new file mode 100644 index 00000000000..ad593920384 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/question matches only a single character with json api.js @@ -0,0 +1,105 @@ +config: +{ + "include": [ + "x/?.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/a.ts", + "c:/dev/x/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "x/?.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev/x": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/question matches only a single character with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/question matches only a single character with jsonSourceFile api.js new file mode 100644 index 00000000000..19959f4698a --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/question matches only a single character with jsonSourceFile api.js @@ -0,0 +1,104 @@ +config: +{ + "include": [ + "x/?.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/a.ts", + "c:/dev/x/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "x/?.ts" + ] + }, + "wildcardDirectories": { + "c:/dev/x": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations are excluded with json api.js b/tests/baselines/reference/config/matchFiles/same named declarations are excluded with json api.js new file mode 100644 index 00000000000..91fcf3fc668 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations are excluded with json api.js @@ -0,0 +1,106 @@ +config: +{ + "include": [ + "*.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/c.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/same named declarations are excluded with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/same named declarations are excluded with jsonSourceFile api.js new file mode 100644 index 00000000000..d0a89f98e44 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/same named declarations are excluded with jsonSourceFile api.js @@ -0,0 +1,105 @@ +config: +{ + "include": [ + "*.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/c.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/star matches only ts files with json api.js b/tests/baselines/reference/config/matchFiles/star matches only ts files with json api.js new file mode 100644 index 00000000000..45e0d5ba496 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/star matches only ts files with json api.js @@ -0,0 +1,106 @@ +config: +{ + "include": [ + "*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/c.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/star matches only ts files with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/star matches only ts files with jsonSourceFile api.js new file mode 100644 index 00000000000..ce3a1bd8a0f --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/star matches only ts files with jsonSourceFile api.js @@ -0,0 +1,105 @@ +config: +{ + "include": [ + "*" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/c.d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.None" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/that are not explicitly included with json api.js b/tests/baselines/reference/config/matchFiles/that are not explicitly included with json api.js new file mode 100644 index 00000000000..c3f5e3710bd --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/that are not explicitly included with json api.js @@ -0,0 +1,63 @@ +config: +{ + "include": [ + "x/**/*", + "w/*/*" + ] +} +Fs:: +//// [c:/dev/.z/.b.ts] + + +//// [c:/dev/.z/c.ts] + + +//// [c:/dev/g.min.js/.g/g.ts] + + +//// [c:/dev/w/.u/e.ts] + + +//// [c:/dev/x/.y/a.ts] + + +//// [c:/dev/x/d.ts] + + +//// [c:/dev/x/y/.e.ts] + + +//// [c:/dev/x/y/d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/d.ts", + "c:/dev/x/y/d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "x/**/*", + "w/*/*" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev/x": "WatchDirectoryFlags.Recursive", + "c:/dev/w": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/that are not explicitly included with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/that are not explicitly included with jsonSourceFile api.js new file mode 100644 index 00000000000..0f817bc7e45 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/that are not explicitly included with jsonSourceFile api.js @@ -0,0 +1,62 @@ +config: +{ + "include": [ + "x/**/*", + "w/*/*" + ] +} +Fs:: +//// [c:/dev/.z/.b.ts] + + +//// [c:/dev/.z/c.ts] + + +//// [c:/dev/g.min.js/.g/g.ts] + + +//// [c:/dev/w/.u/e.ts] + + +//// [c:/dev/x/.y/a.ts] + + +//// [c:/dev/x/d.ts] + + +//// [c:/dev/x/y/.e.ts] + + +//// [c:/dev/x/y/d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/d.ts", + "c:/dev/x/y/d.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "x/**/*", + "w/*/*" + ] + }, + "wildcardDirectories": { + "c:/dev/x": "WatchDirectoryFlags.Recursive", + "c:/dev/w": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/when recursive symlinked directories are present with json api.js b/tests/baselines/reference/config/matchFiles/when recursive symlinked directories are present with json api.js new file mode 100644 index 00000000000..20c49780894 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/when recursive symlinked directories are present with json api.js @@ -0,0 +1,34 @@ +config: +{} +Fs:: +//// [c:/dev/a/b/c/grandparent] symlink(c:/dev/a) +//// [c:/dev/a/b/parent] symlink(c:/dev/a) +//// [c:/dev/a/self] symlink(c:/dev/A) +//// [c:/dev/index.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/index.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/when recursive symlinked directories are present with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/when recursive symlinked directories are present with jsonSourceFile api.js new file mode 100644 index 00000000000..f8fea8e6e3e --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/when recursive symlinked directories are present with jsonSourceFile api.js @@ -0,0 +1,32 @@ +config: +{} +Fs:: +//// [c:/dev/a/b/c/grandparent] symlink(c:/dev/a) +//// [c:/dev/a/b/parent] symlink(c:/dev/a) +//// [c:/dev/a/self] symlink(c:/dev/A) +//// [c:/dev/index.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/index.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": {}, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with case sensitive exclude with json api.js b/tests/baselines/reference/config/matchFiles/with case sensitive exclude with json api.js new file mode 100644 index 00000000000..893aa2d70bb --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with case sensitive exclude with json api.js @@ -0,0 +1,101 @@ +config: +{ + "include": [ + "B.ts" + ], + "exclude": [ + "**/b.ts" + ] +} +Fs:: +//// [/dev/A.ts] + + +//// [/dev/B.ts] + + +//// [/dev/a.d.ts] + + +//// [/dev/a.js] + + +//// [/dev/a.ts] + + +//// [/dev/b.js] + + +//// [/dev/b.ts] + + +//// [/dev/c.d.ts] + + +//// [/dev/js/a.js] + + +//// [/dev/js/b.js] + + +//// [/dev/q/a/c/b/d.ts] + + +//// [/dev/x/a.ts] + + +//// [/dev/x/b.ts] + + +//// [/dev/x/y/a.ts] + + +//// [/dev/x/y/b.ts] + + +//// [/dev/z/a.ts] + + +//// [/dev/z/aba.ts] + + +//// [/dev/z/abz.ts] + + +//// [/dev/z/b.ts] + + +//// [/dev/z/bba.ts] + + +//// [/dev/z/bbz.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "B.ts" + ], + "exclude": [ + "**/b.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["B.ts"]' and 'exclude' paths were '["**/b.ts"]'. + diff --git a/tests/baselines/reference/config/matchFiles/with case sensitive exclude with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with case sensitive exclude with jsonSourceFile api.js new file mode 100644 index 00000000000..e7b11727e4a --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with case sensitive exclude with jsonSourceFile api.js @@ -0,0 +1,100 @@ +config: +{ + "include": [ + "B.ts" + ], + "exclude": [ + "**/b.ts" + ] +} +Fs:: +//// [/dev/A.ts] + + +//// [/dev/B.ts] + + +//// [/dev/a.d.ts] + + +//// [/dev/a.js] + + +//// [/dev/a.ts] + + +//// [/dev/b.js] + + +//// [/dev/b.ts] + + +//// [/dev/c.d.ts] + + +//// [/dev/js/a.js] + + +//// [/dev/js/b.js] + + +//// [/dev/q/a/c/b/d.ts] + + +//// [/dev/x/a.ts] + + +//// [/dev/x/b.ts] + + +//// [/dev/x/y/a.ts] + + +//// [/dev/x/y/b.ts] + + +//// [/dev/z/a.ts] + + +//// [/dev/z/aba.ts] + + +//// [/dev/z/abz.ts] + + +//// [/dev/z/b.ts] + + +//// [/dev/z/bba.ts] + + +//// [/dev/z/bbz.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "B.ts" + ], + "exclude": [ + "**/b.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["B.ts"]' and 'exclude' paths were '["**/b.ts"]'. + diff --git a/tests/baselines/reference/config/matchFiles/with common package folders and empty exclude with json api.js b/tests/baselines/reference/config/matchFiles/with common package folders and empty exclude with json api.js new file mode 100644 index 00000000000..2f4f9bda3d3 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with common package folders and empty exclude with json api.js @@ -0,0 +1,69 @@ +config: +{ + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/node_modules/a.ts", + "c:/dev/bower_components/a.ts", + "c:/dev/jspm_packages/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with common package folders and empty exclude with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with common package folders and empty exclude with jsonSourceFile api.js new file mode 100644 index 00000000000..544280641d1 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with common package folders and empty exclude with jsonSourceFile api.js @@ -0,0 +1,68 @@ +config: +{ + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/node_modules/a.ts", + "c:/dev/bower_components/a.ts", + "c:/dev/jspm_packages/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with common package folders and exclusions with json api.js b/tests/baselines/reference/config/matchFiles/with common package folders and exclusions with json api.js new file mode 100644 index 00000000000..be9925b06f4 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with common package folders and exclusions with json api.js @@ -0,0 +1,75 @@ +config: +{ + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ], + "exclude": [ + "a.ts", + "b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/node_modules/a.ts", + "c:/dev/bower_components/a.ts", + "c:/dev/jspm_packages/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ], + "exclude": [ + "a.ts", + "b.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with common package folders and exclusions with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with common package folders and exclusions with jsonSourceFile api.js new file mode 100644 index 00000000000..b01acd4b9f9 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with common package folders and exclusions with jsonSourceFile api.js @@ -0,0 +1,74 @@ +config: +{ + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ], + "exclude": [ + "a.ts", + "b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/node_modules/a.ts", + "c:/dev/bower_components/a.ts", + "c:/dev/jspm_packages/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ], + "exclude": [ + "a.ts", + "b.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with common package folders and no exclusions with json api.js b/tests/baselines/reference/config/matchFiles/with common package folders and no exclusions with json api.js new file mode 100644 index 00000000000..2f4f9bda3d3 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with common package folders and no exclusions with json api.js @@ -0,0 +1,69 @@ +config: +{ + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/node_modules/a.ts", + "c:/dev/bower_components/a.ts", + "c:/dev/jspm_packages/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with common package folders and no exclusions with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with common package folders and no exclusions with jsonSourceFile api.js new file mode 100644 index 00000000000..544280641d1 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with common package folders and no exclusions with jsonSourceFile api.js @@ -0,0 +1,68 @@ +config: +{ + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/node_modules/a.ts", + "c:/dev/bower_components/a.ts", + "c:/dev/jspm_packages/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts", + "node_modules/a.ts", + "bower_components/a.ts", + "jspm_packages/a.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with defaults with json api.js b/tests/baselines/reference/config/matchFiles/with defaults with json api.js new file mode 100644 index 00000000000..a91a4e7b5a2 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with defaults with json api.js @@ -0,0 +1,54 @@ +config: +{} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/x/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with defaults with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with defaults with jsonSourceFile api.js new file mode 100644 index 00000000000..f4101c99717 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with defaults with jsonSourceFile api.js @@ -0,0 +1,52 @@ +config: +{} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/bower_components/a.ts] + + +//// [c:/dev/jspm_packages/a.ts] + + +//// [c:/dev/node_modules/a.ts] + + +//// [c:/dev/x/a.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts", + "c:/dev/x/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": {}, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=false with json api.js b/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=false with json api.js new file mode 100644 index 00000000000..ff009e69f0c --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=false with json api.js @@ -0,0 +1,71 @@ +config: +{ + "compilerOptions": { + "allowJs": false + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": false, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": false + }, + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=false with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=false with jsonSourceFile api.js new file mode 100644 index 00000000000..9ffe7842131 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=false with jsonSourceFile api.js @@ -0,0 +1,70 @@ +config: +{ + "compilerOptions": { + "allowJs": false + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": false, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": false + } + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=true with json api.js b/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=true with json api.js new file mode 100644 index 00000000000..fbcef69799d --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=true with json api.js @@ -0,0 +1,73 @@ +config: +{ + "compilerOptions": { + "allowJs": true + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/d.js", + "c:/dev/e.jsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": true + }, + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=true with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=true with jsonSourceFile api.js new file mode 100644 index 00000000000..fab75bbcc11 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=none, allowJs=true with jsonSourceFile api.js @@ -0,0 +1,72 @@ +config: +{ + "compilerOptions": { + "allowJs": true + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/d.js", + "c:/dev/e.jsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "allowJs": true + } + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=false with json api.js b/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=false with json api.js new file mode 100644 index 00000000000..d9ec43f454a --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=false with json api.js @@ -0,0 +1,74 @@ +config: +{ + "compilerOptions": { + "jsx": "preserve", + "allowJs": false + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "jsx": 1, + "allowJs": false, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "jsx": "preserve", + "allowJs": false + }, + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=false with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=false with jsonSourceFile api.js new file mode 100644 index 00000000000..a5d7cb2bd44 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=false with jsonSourceFile api.js @@ -0,0 +1,73 @@ +config: +{ + "compilerOptions": { + "jsx": "preserve", + "allowJs": false + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "jsx": 1, + "allowJs": false, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "jsx": "preserve", + "allowJs": false + } + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=true with json api.js b/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=true with json api.js new file mode 100644 index 00000000000..99c17534127 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=true with json api.js @@ -0,0 +1,76 @@ +config: +{ + "compilerOptions": { + "jsx": "preserve", + "allowJs": true + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "jsx": 1, + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/d.js", + "c:/dev/e.jsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "jsx": "preserve", + "allowJs": true + }, + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=true with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=true with jsonSourceFile api.js new file mode 100644 index 00000000000..ecd1e44fde1 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=preserve, allowJs=true with jsonSourceFile api.js @@ -0,0 +1,75 @@ +config: +{ + "compilerOptions": { + "jsx": "preserve", + "allowJs": true + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "jsx": 1, + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/d.js", + "c:/dev/e.jsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "jsx": "preserve", + "allowJs": true + } + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=false with json api.js b/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=false with json api.js new file mode 100644 index 00000000000..e74950607a6 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=false with json api.js @@ -0,0 +1,74 @@ +config: +{ + "compilerOptions": { + "jsx": "react-native", + "allowJs": false + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "jsx": 3, + "allowJs": false, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "jsx": "react-native", + "allowJs": false + }, + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=false with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=false with jsonSourceFile api.js new file mode 100644 index 00000000000..8148573f9ef --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=false with jsonSourceFile api.js @@ -0,0 +1,73 @@ +config: +{ + "compilerOptions": { + "jsx": "react-native", + "allowJs": false + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "jsx": 3, + "allowJs": false, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "jsx": "react-native", + "allowJs": false + } + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=true with json api.js b/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=true with json api.js new file mode 100644 index 00000000000..46acb795c50 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=true with json api.js @@ -0,0 +1,76 @@ +config: +{ + "compilerOptions": { + "jsx": "react-native", + "allowJs": true + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "jsx": 3, + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/d.js", + "c:/dev/e.jsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "jsx": "react-native", + "allowJs": true + }, + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=true with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=true with jsonSourceFile api.js new file mode 100644 index 00000000000..c53d583a5e7 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with jsx=react-native, allowJs=true with jsonSourceFile api.js @@ -0,0 +1,75 @@ +config: +{ + "compilerOptions": { + "jsx": "react-native", + "allowJs": true + } +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.d.ts] + + +//// [c:/dev/b.jsx] + + +//// [c:/dev/b.tsx] + + +//// [c:/dev/c.js] + + +//// [c:/dev/c.tsx] + + +//// [c:/dev/d.js] + + +//// [c:/dev/e.jsx] + + +//// [c:/dev/f.other] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "jsx": 3, + "allowJs": true, + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.tsx", + "c:/dev/c.tsx", + "c:/dev/d.js", + "c:/dev/e.jsx" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "compilerOptions": { + "jsx": "react-native", + "allowJs": true + } + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with literal excludes with json api.js b/tests/baselines/reference/config/matchFiles/with literal excludes with json api.js new file mode 100644 index 00000000000..5440c5aa65c --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with literal excludes with json api.js @@ -0,0 +1,110 @@ +config: +{ + "include": [ + "a.ts", + "b.ts" + ], + "exclude": [ + "b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts" + ], + "exclude": [ + "b.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with literal excludes with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with literal excludes with jsonSourceFile api.js new file mode 100644 index 00000000000..5c8401da57e --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with literal excludes with jsonSourceFile api.js @@ -0,0 +1,109 @@ +config: +{ + "include": [ + "a.ts", + "b.ts" + ], + "exclude": [ + "b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts" + ], + "exclude": [ + "b.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with missing files are excluded with literal include list with json api.js b/tests/baselines/reference/config/matchFiles/with missing files are excluded with literal include list with json api.js new file mode 100644 index 00000000000..b067af459a6 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with missing files are excluded with literal include list with json api.js @@ -0,0 +1,103 @@ +config: +{ + "include": [ + "z.ts", + "x.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "z.ts", + "x.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["z.ts","x.ts"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/with missing files are excluded with literal include list with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with missing files are excluded with literal include list with jsonSourceFile api.js new file mode 100644 index 00000000000..f534765db3f --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with missing files are excluded with literal include list with jsonSourceFile api.js @@ -0,0 +1,102 @@ +config: +{ + "include": [ + "z.ts", + "x.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "z.ts", + "x.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["z.ts","x.ts"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/with missing files are excluded with wildcard include list with json api.js b/tests/baselines/reference/config/matchFiles/with missing files are excluded with wildcard include list with json api.js new file mode 100644 index 00000000000..bbf8b64c14f --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with missing files are excluded with wildcard include list with json api.js @@ -0,0 +1,103 @@ +config: +{ + "include": [ + "*/z.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*/z.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["*/z.ts"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/with missing files are excluded with wildcard include list with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with missing files are excluded with wildcard include list with jsonSourceFile api.js new file mode 100644 index 00000000000..3396b3630e0 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with missing files are excluded with wildcard include list with jsonSourceFile api.js @@ -0,0 +1,102 @@ +config: +{ + "include": [ + "*/z.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "*/z.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["*/z.ts"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/with multiple recursive directories with json api.js b/tests/baselines/reference/config/matchFiles/with multiple recursive directories with json api.js new file mode 100644 index 00000000000..7c863e1c544 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with multiple recursive directories with json api.js @@ -0,0 +1,111 @@ +config: +{ + "include": [ + "x/y/**/a.ts", + "x/**/a.ts", + "z/**/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/y/a.ts", + "c:/dev/x/a.ts", + "c:/dev/z/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "x/y/**/a.ts", + "x/**/a.ts", + "z/**/a.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev/x": "WatchDirectoryFlags.Recursive", + "c:/dev/z": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with multiple recursive directories with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with multiple recursive directories with jsonSourceFile api.js new file mode 100644 index 00000000000..0f79bd98983 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with multiple recursive directories with jsonSourceFile api.js @@ -0,0 +1,110 @@ +config: +{ + "include": [ + "x/y/**/a.ts", + "x/**/a.ts", + "z/**/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/y/a.ts", + "c:/dev/x/a.ts", + "c:/dev/z/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "x/y/**/a.ts", + "x/**/a.ts", + "z/**/a.ts" + ] + }, + "wildcardDirectories": { + "c:/dev/x": "WatchDirectoryFlags.Recursive", + "c:/dev/z": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with non .ts file extensions are excluded with json api.js b/tests/baselines/reference/config/matchFiles/with non .ts file extensions are excluded with json api.js new file mode 100644 index 00000000000..0f84295e12d --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with non .ts file extensions are excluded with json api.js @@ -0,0 +1,103 @@ +config: +{ + "include": [ + "a.js", + "b.js" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.js", + "b.js" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["a.js","b.js"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/with non .ts file extensions are excluded with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with non .ts file extensions are excluded with jsonSourceFile api.js new file mode 100644 index 00000000000..18c0e0efa9a --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with non .ts file extensions are excluded with jsonSourceFile api.js @@ -0,0 +1,102 @@ +config: +{ + "include": [ + "a.js", + "b.js" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.js", + "b.js" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["a.js","b.js"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/matchFiles/with recursive directory with json api.js b/tests/baselines/reference/config/matchFiles/with recursive directory with json api.js new file mode 100644 index 00000000000..db2d570e6ce --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with recursive directory with json api.js @@ -0,0 +1,107 @@ +config: +{ + "include": [ + "**/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/x/y/a.ts", + "c:/dev/z/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with recursive directory with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with recursive directory with jsonSourceFile api.js new file mode 100644 index 00000000000..d2aedb139a5 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with recursive directory with jsonSourceFile api.js @@ -0,0 +1,106 @@ +config: +{ + "include": [ + "**/a.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/x/y/a.ts", + "c:/dev/z/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/a.ts" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with recursive excludes with json api.js b/tests/baselines/reference/config/matchFiles/with recursive excludes with json api.js new file mode 100644 index 00000000000..fe44fe81307 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with recursive excludes with json api.js @@ -0,0 +1,120 @@ +config: +{ + "include": [ + "a.ts", + "b.ts", + "x/a.ts", + "x/b.ts", + "x/y/a.ts", + "x/y/b.ts" + ], + "exclude": [ + "**/b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/x/y/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts", + "x/a.ts", + "x/b.ts", + "x/y/a.ts", + "x/y/b.ts" + ], + "exclude": [ + "**/b.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with recursive excludes with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with recursive excludes with jsonSourceFile api.js new file mode 100644 index 00000000000..ba00ddf5f9f --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with recursive excludes with jsonSourceFile api.js @@ -0,0 +1,119 @@ +config: +{ + "include": [ + "a.ts", + "b.ts", + "x/a.ts", + "x/b.ts", + "x/y/a.ts", + "x/y/b.ts" + ], + "exclude": [ + "**/b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/x/a.ts", + "c:/dev/x/y/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts", + "x/a.ts", + "x/b.ts", + "x/y/a.ts", + "x/y/b.ts" + ], + "exclude": [ + "**/b.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with recursive wildcards that match directories with json api.js b/tests/baselines/reference/config/matchFiles/with recursive wildcards that match directories with json api.js new file mode 100644 index 00000000000..bc489887e96 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with recursive wildcards that match directories with json api.js @@ -0,0 +1,62 @@ +config: +{ + "include": [ + "**/.*/*" + ] +} +Fs:: +//// [c:/dev/.z/.b.ts] + + +//// [c:/dev/.z/c.ts] + + +//// [c:/dev/g.min.js/.g/g.ts] + + +//// [c:/dev/w/.u/e.ts] + + +//// [c:/dev/x/.y/a.ts] + + +//// [c:/dev/x/d.ts] + + +//// [c:/dev/x/y/.e.ts] + + +//// [c:/dev/x/y/d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/.z/c.ts", + "c:/dev/g.min.js/.g/g.ts", + "c:/dev/w/.u/e.ts", + "c:/dev/x/.y/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/.*/*" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with recursive wildcards that match directories with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with recursive wildcards that match directories with jsonSourceFile api.js new file mode 100644 index 00000000000..94906639802 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with recursive wildcards that match directories with jsonSourceFile api.js @@ -0,0 +1,61 @@ +config: +{ + "include": [ + "**/.*/*" + ] +} +Fs:: +//// [c:/dev/.z/.b.ts] + + +//// [c:/dev/.z/c.ts] + + +//// [c:/dev/g.min.js/.g/g.ts] + + +//// [c:/dev/w/.u/e.ts] + + +//// [c:/dev/x/.y/a.ts] + + +//// [c:/dev/x/d.ts] + + +//// [c:/dev/x/y/.e.ts] + + +//// [c:/dev/x/y/d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/.z/c.ts", + "c:/dev/g.min.js/.g/g.ts", + "c:/dev/w/.u/e.ts", + "c:/dev/x/.y/a.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/.*/*" + ] + }, + "wildcardDirectories": { + "c:/dev": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with recursive wildcards that match nothing with json api.js b/tests/baselines/reference/config/matchFiles/with recursive wildcards that match nothing with json api.js new file mode 100644 index 00000000000..a2f4a468a14 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with recursive wildcards that match nothing with json api.js @@ -0,0 +1,63 @@ +config: +{ + "include": [ + "x/**/.y/*", + ".z/**/.*" + ] +} +Fs:: +//// [c:/dev/.z/.b.ts] + + +//// [c:/dev/.z/c.ts] + + +//// [c:/dev/g.min.js/.g/g.ts] + + +//// [c:/dev/w/.u/e.ts] + + +//// [c:/dev/x/.y/a.ts] + + +//// [c:/dev/x/d.ts] + + +//// [c:/dev/x/y/.e.ts] + + +//// [c:/dev/x/y/d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/.y/a.ts", + "c:/dev/.z/.b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "x/**/.y/*", + ".z/**/.*" + ], + "compileOnSave": false + }, + "wildcardDirectories": { + "c:/dev/x": "WatchDirectoryFlags.Recursive", + "c:/dev/.z": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with recursive wildcards that match nothing with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with recursive wildcards that match nothing with jsonSourceFile api.js new file mode 100644 index 00000000000..e30f906e18d --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with recursive wildcards that match nothing with jsonSourceFile api.js @@ -0,0 +1,62 @@ +config: +{ + "include": [ + "x/**/.y/*", + ".z/**/.*" + ] +} +Fs:: +//// [c:/dev/.z/.b.ts] + + +//// [c:/dev/.z/c.ts] + + +//// [c:/dev/g.min.js/.g/g.ts] + + +//// [c:/dev/w/.u/e.ts] + + +//// [c:/dev/x/.y/a.ts] + + +//// [c:/dev/x/d.ts] + + +//// [c:/dev/x/y/.e.ts] + + +//// [c:/dev/x/y/d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/.y/a.ts", + "c:/dev/.z/.b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "x/**/.y/*", + ".z/**/.*" + ] + }, + "wildcardDirectories": { + "c:/dev/x": "WatchDirectoryFlags.Recursive", + "c:/dev/.z": "WatchDirectoryFlags.Recursive" + }, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with wildcard excludes that implicitly exclude dotted files with json api.js b/tests/baselines/reference/config/matchFiles/with wildcard excludes that implicitly exclude dotted files with json api.js new file mode 100644 index 00000000000..63be05aeba9 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with wildcard excludes that implicitly exclude dotted files with json api.js @@ -0,0 +1,62 @@ +config: +{ + "include": [ + "**/.*/*" + ], + "exclude": [ + "**/*" + ] +} +Fs:: +//// [c:/dev/.z/.b.ts] + + +//// [c:/dev/.z/c.ts] + + +//// [c:/dev/g.min.js/.g/g.ts] + + +//// [c:/dev/w/.u/e.ts] + + +//// [c:/dev/x/.y/a.ts] + + +//// [c:/dev/x/d.ts] + + +//// [c:/dev/x/y/.e.ts] + + +//// [c:/dev/x/y/d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/.*/*" + ], + "exclude": [ + "**/*" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/.*/*"]' and 'exclude' paths were '["**/*"]'. + diff --git a/tests/baselines/reference/config/matchFiles/with wildcard excludes that implicitly exclude dotted files with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with wildcard excludes that implicitly exclude dotted files with jsonSourceFile api.js new file mode 100644 index 00000000000..226284fe14f --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with wildcard excludes that implicitly exclude dotted files with jsonSourceFile api.js @@ -0,0 +1,61 @@ +config: +{ + "include": [ + "**/.*/*" + ], + "exclude": [ + "**/*" + ] +} +Fs:: +//// [c:/dev/.z/.b.ts] + + +//// [c:/dev/.z/c.ts] + + +//// [c:/dev/g.min.js/.g/g.ts] + + +//// [c:/dev/w/.u/e.ts] + + +//// [c:/dev/x/.y/a.ts] + + +//// [c:/dev/x/d.ts] + + +//// [c:/dev/x/y/.e.ts] + + +//// [c:/dev/x/y/d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "**/.*/*" + ], + "exclude": [ + "**/*" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: +error TS18003: No inputs were found in config file 'c:/dev/tsconfig.json'. Specified 'include' paths were '["**/.*/*"]' and 'exclude' paths were '["**/*"]'. + diff --git a/tests/baselines/reference/config/matchFiles/with wildcard excludes with json api.js b/tests/baselines/reference/config/matchFiles/with wildcard excludes with json api.js new file mode 100644 index 00000000000..c5711d8d642 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with wildcard excludes with json api.js @@ -0,0 +1,123 @@ +config: +{ + "include": [ + "a.ts", + "b.ts", + "z/a.ts", + "z/abz.ts", + "z/aba.ts", + "x/b.ts" + ], + "exclude": [ + "*.ts", + "z/??z.ts", + "*/b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/z/a.ts", + "c:/dev/z/aba.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts", + "z/a.ts", + "z/abz.ts", + "z/aba.ts", + "x/b.ts" + ], + "exclude": [ + "*.ts", + "z/??z.ts", + "*/b.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/with wildcard excludes with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/with wildcard excludes with jsonSourceFile api.js new file mode 100644 index 00000000000..689aac8dba5 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/with wildcard excludes with jsonSourceFile api.js @@ -0,0 +1,122 @@ +config: +{ + "include": [ + "a.ts", + "b.ts", + "z/a.ts", + "z/abz.ts", + "z/aba.ts", + "x/b.ts" + ], + "exclude": [ + "*.ts", + "z/??z.ts", + "*/b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/z/a.ts", + "c:/dev/z/aba.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts", + "z/a.ts", + "z/abz.ts", + "z/aba.ts", + "x/b.ts" + ], + "exclude": [ + "*.ts", + "z/??z.ts", + "*/b.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/without exclusions with literal file list with json api.js b/tests/baselines/reference/config/matchFiles/without exclusions with literal file list with json api.js new file mode 100644 index 00000000000..c3e7aa29953 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/without exclusions with literal file list with json api.js @@ -0,0 +1,105 @@ +config: +{ + "files": [ + "a.ts", + "b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "files": [ + "a.ts", + "b.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/without exclusions with literal file list with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/without exclusions with literal file list with jsonSourceFile api.js new file mode 100644 index 00000000000..10fe1fcd3ae --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/without exclusions with literal file list with jsonSourceFile api.js @@ -0,0 +1,104 @@ +config: +{ + "files": [ + "a.ts", + "b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "files": [ + "a.ts", + "b.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/without exclusions with literal include list with json api.js b/tests/baselines/reference/config/matchFiles/without exclusions with literal include list with json api.js new file mode 100644 index 00000000000..7bd60f518d5 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/without exclusions with literal include list with json api.js @@ -0,0 +1,105 @@ +config: +{ + "include": [ + "a.ts", + "b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/without exclusions with literal include list with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/without exclusions with literal include list with jsonSourceFile api.js new file mode 100644 index 00000000000..69c1aa6c265 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/without exclusions with literal include list with jsonSourceFile api.js @@ -0,0 +1,104 @@ +config: +{ + "include": [ + "a.ts", + "b.ts" + ] +} +Fs:: +//// [c:/dev/a.d.ts] + + +//// [c:/dev/a.js] + + +//// [c:/dev/a.ts] + + +//// [c:/dev/b.js] + + +//// [c:/dev/b.ts] + + +//// [c:/dev/c.d.ts] + + +//// [c:/dev/js/a.js] + + +//// [c:/dev/js/ab.min.js] + + +//// [c:/dev/js/b.js] + + +//// [c:/dev/js/d.min.js] + + +//// [c:/dev/x/a.ts] + + +//// [c:/dev/x/aa.ts] + + +//// [c:/dev/x/b.ts] + + +//// [c:/dev/x/y/a.ts] + + +//// [c:/dev/x/y/b.ts] + + +//// [c:/dev/z/a.ts] + + +//// [c:/dev/z/aba.ts] + + +//// [c:/dev/z/abz.ts] + + +//// [c:/dev/z/b.ts] + + +//// [c:/dev/z/bba.ts] + + +//// [c:/dev/z/bbz.ts] + + +//// [c:/ext/b/a..b.ts] + + +//// [c:/ext/ext.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/a.ts", + "c:/dev/b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "a.ts", + "b.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/without wildcards with json api.js b/tests/baselines/reference/config/matchFiles/without wildcards with json api.js new file mode 100644 index 00000000000..04924a1e9fa --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/without wildcards with json api.js @@ -0,0 +1,60 @@ +config: +{ + "include": [ + "x/.y/a.ts", + "c:/dev/.z/.b.ts" + ] +} +Fs:: +//// [c:/dev/.z/.b.ts] + + +//// [c:/dev/.z/c.ts] + + +//// [c:/dev/g.min.js/.g/g.ts] + + +//// [c:/dev/w/.u/e.ts] + + +//// [c:/dev/x/.y/a.ts] + + +//// [c:/dev/x/d.ts] + + +//// [c:/dev/x/y/.e.ts] + + +//// [c:/dev/x/y/d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/.y/a.ts", + "c:/dev/.z/.b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "x/.y/a.ts", + "c:/dev/.z/.b.ts" + ], + "compileOnSave": false + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/matchFiles/without wildcards with jsonSourceFile api.js b/tests/baselines/reference/config/matchFiles/without wildcards with jsonSourceFile api.js new file mode 100644 index 00000000000..5798a483fb3 --- /dev/null +++ b/tests/baselines/reference/config/matchFiles/without wildcards with jsonSourceFile api.js @@ -0,0 +1,59 @@ +config: +{ + "include": [ + "x/.y/a.ts", + "c:/dev/.z/.b.ts" + ] +} +Fs:: +//// [c:/dev/.z/.b.ts] + + +//// [c:/dev/.z/c.ts] + + +//// [c:/dev/g.min.js/.g/g.ts] + + +//// [c:/dev/w/.u/e.ts] + + +//// [c:/dev/x/.y/a.ts] + + +//// [c:/dev/x/d.ts] + + +//// [c:/dev/x/y/.e.ts] + + +//// [c:/dev/x/y/d.ts] + + + +configFileName:: c:/dev/tsconfig.json +Result +{ + "options": { + "configFilePath": "c:/dev/tsconfig.json" + }, + "fileNames": [ + "c:/dev/x/.y/a.ts", + "c:/dev/.z/.b.ts" + ], + "typeAcquisition": { + "enable": false, + "include": [], + "exclude": [] + }, + "raw": { + "include": [ + "x/.y/a.ts", + "c:/dev/.z/.b.ts" + ] + }, + "wildcardDirectories": {}, + "compileOnSave": false +} +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with json api.js b/tests/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with json api.js new file mode 100644 index 00000000000..b423b711346 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with json api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/..c.ts] + + +//// [/apath/.b.ts] + + +//// [/apath/.git/a.ts] + + +//// [/apath/test.ts] + + +//// [/apath/tsconfig.json] +{ + "files": ["/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"] + } + + +configFileName:: tsconfig.json +FileNames:: +/apath/.git/a.ts,/apath/.b.ts,/apath/..c.ts +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with jsonSourceFile api.js new file mode 100644 index 00000000000..b423b711346 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/allow dotted files and folders when explicitly requested with jsonSourceFile api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/..c.ts] + + +//// [/apath/.b.ts] + + +//// [/apath/.git/a.ts] + + +//// [/apath/test.ts] + + +//// [/apath/tsconfig.json] +{ + "files": ["/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"] + } + + +configFileName:: tsconfig.json +FileNames:: +/apath/.git/a.ts,/apath/.b.ts,/apath/..c.ts +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/correctly parses wild card directories from implicit glob when two keys differ only in directory seperator with json api.js b/tests/baselines/reference/config/tsconfigParsing/correctly parses wild card directories from implicit glob when two keys differ only in directory seperator with json api.js new file mode 100644 index 00000000000..9dde48a11b4 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/correctly parses wild card directories from implicit glob when two keys differ only in directory seperator with json api.js @@ -0,0 +1,8 @@ +Fs:: +//// [/foo.bar/tsconfig.json] +{"include":["./","./**/*.json"]} + + +configFileName:: /foo.bar/tsconfig.json +Wildcards:: +/foo.bar: WatchDirectoryFlags.Recursive diff --git a/tests/baselines/reference/config/tsconfigParsing/correctly parses wild card directories from implicit glob when two keys differ only in directory seperator with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/correctly parses wild card directories from implicit glob when two keys differ only in directory seperator with jsonSourceFile api.js new file mode 100644 index 00000000000..9dde48a11b4 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/correctly parses wild card directories from implicit glob when two keys differ only in directory seperator with jsonSourceFile api.js @@ -0,0 +1,8 @@ +Fs:: +//// [/foo.bar/tsconfig.json] +{"include":["./","./**/*.json"]} + + +configFileName:: /foo.bar/tsconfig.json +Wildcards:: +/foo.bar: WatchDirectoryFlags.Recursive diff --git a/tests/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with json api.js b/tests/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with json api.js new file mode 100644 index 00000000000..b294e38156d --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with json api.js @@ -0,0 +1,16 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "files": [], + "references": [{ "path": "/apath" }] + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with jsonSourceFile api.js new file mode 100644 index 00000000000..b294e38156d --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/does not generate errors for empty files list when one or more references are provided with jsonSourceFile api.js @@ -0,0 +1,16 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "files": [], + "references": [{ "path": "/apath" }] + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with json api.js b/tests/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with json api.js new file mode 100644 index 00000000000..bcb7a1296f4 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with json api.js @@ -0,0 +1,42 @@ +Fs:: +//// [/a.ts] + + +//// [/declarations/a.d.ts] + + +//// [/tsconfig.json] +{ + "compilerOptions": { + "declarationDir": "declarations" + } + } + + +configFileName:: tsconfig.json +FileNames:: +/a.ts +Errors:: + + +Fs:: +//// [/a.ts] + + +//// [/declarations/a.d.ts] + + +//// [/tsconfig.json] +{ + "compilerOptions": { + "declarationDir": "declarations" + }, + "exclude": [ "types" ] + } + + +configFileName:: tsconfig.json +FileNames:: +/a.ts,/declarations/a.d.ts +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with jsonSourceFile api.js new file mode 100644 index 00000000000..bcb7a1296f4 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/exclude declarationDir unless overridden with jsonSourceFile api.js @@ -0,0 +1,42 @@ +Fs:: +//// [/a.ts] + + +//// [/declarations/a.d.ts] + + +//// [/tsconfig.json] +{ + "compilerOptions": { + "declarationDir": "declarations" + } + } + + +configFileName:: tsconfig.json +FileNames:: +/a.ts +Errors:: + + +Fs:: +//// [/a.ts] + + +//// [/declarations/a.d.ts] + + +//// [/tsconfig.json] +{ + "compilerOptions": { + "declarationDir": "declarations" + }, + "exclude": [ "types" ] + } + + +configFileName:: tsconfig.json +FileNames:: +/a.ts,/declarations/a.d.ts +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with json api.js b/tests/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with json api.js new file mode 100644 index 00000000000..7f94ebf06e2 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with json api.js @@ -0,0 +1,42 @@ +Fs:: +//// [/b.ts] + + +//// [/bin/a.ts] + + +//// [/tsconfig.json] +{ + "compilerOptions": { + "outDir": "bin" + } + } + + +configFileName:: tsconfig.json +FileNames:: +/b.ts +Errors:: + + +Fs:: +//// [/b.ts] + + +//// [/bin/a.ts] + + +//// [/tsconfig.json] +{ + "compilerOptions": { + "outDir": "bin" + }, + "exclude": [ "obj" ] + } + + +configFileName:: tsconfig.json +FileNames:: +/b.ts,/bin/a.ts +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with jsonSourceFile api.js new file mode 100644 index 00000000000..7f94ebf06e2 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/exclude outDir unless overridden with jsonSourceFile api.js @@ -0,0 +1,42 @@ +Fs:: +//// [/b.ts] + + +//// [/bin/a.ts] + + +//// [/tsconfig.json] +{ + "compilerOptions": { + "outDir": "bin" + } + } + + +configFileName:: tsconfig.json +FileNames:: +/b.ts +Errors:: + + +Fs:: +//// [/b.ts] + + +//// [/bin/a.ts] + + +//// [/tsconfig.json] +{ + "compilerOptions": { + "outDir": "bin" + }, + "exclude": [ "obj" ] + } + + +configFileName:: tsconfig.json +FileNames:: +/b.ts,/bin/a.ts +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js new file mode 100644 index 00000000000..997bf7716e2 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js @@ -0,0 +1,15 @@ +Fs:: +//// [/apath/a.js] + + +//// [/apath/tsconfig.json] +{ + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js new file mode 100644 index 00000000000..997bf7716e2 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js @@ -0,0 +1,15 @@ +Fs:: +//// [/apath/a.js] + + +//// [/apath/tsconfig.json] +{ + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js new file mode 100644 index 00000000000..30621abe105 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js @@ -0,0 +1,15 @@ +Fs:: +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "allowJs": true + } + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js new file mode 100644 index 00000000000..30621abe105 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js @@ -0,0 +1,15 @@ +Fs:: +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "allowJs": true + } + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js new file mode 100644 index 00000000000..9f5abbd52f4 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js @@ -0,0 +1,17 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "files": [], + "references": [] + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js new file mode 100644 index 00000000000..f906df49bab --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js @@ -0,0 +1,20 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "files": [], + "references": [] + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +/apath/tsconfig.json:2:26 - error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. + +2 "files": [], +   ~~ + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js new file mode 100644 index 00000000000..ae92900487d --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js @@ -0,0 +1,16 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "files": [] + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js new file mode 100644 index 00000000000..2381889cf47 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js @@ -0,0 +1,19 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "files": [] + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +/apath/tsconfig.json:2:26 - error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. + +2 "files": [] +   ~~ + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js new file mode 100644 index 00000000000..b22486c178a --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js @@ -0,0 +1,16 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "include": [] + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js new file mode 100644 index 00000000000..b22486c178a --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js @@ -0,0 +1,16 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "include": [] + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js new file mode 100644 index 00000000000..005596ba660 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js @@ -0,0 +1,19 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./" + }, + "include": ["**/*"] + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["./"]'. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js new file mode 100644 index 00000000000..005596ba660 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js @@ -0,0 +1,19 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./" + }, + "include": ["**/*"] + } + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["./"]'. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors for when invalid comment type present in tsconfig with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors for when invalid comment type present in tsconfig with jsonSourceFile api.js new file mode 100644 index 00000000000..de2ce52a49a --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors for when invalid comment type present in tsconfig with jsonSourceFile api.js @@ -0,0 +1,55 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + ## this comment does cause issues + "types" : [ + ] + } + } + + +configFileName:: /apath/tsconfig.json +FileNames:: +/apath/a.ts +Errors:: +/apath/tsconfig.json:3:17 - error TS1327: String literal with double quotes expected. + +3 ## this comment does cause issues +   ~ +/apath/tsconfig.json:3:17 - error TS5023: Unknown compiler option '#'. + +3 ## this comment does cause issues +   ~ +/apath/tsconfig.json:3:18 - error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal. + +3 ## this comment does cause issues +   ~ +/apath/tsconfig.json:3:20 - error TS1327: String literal with double quotes expected. + +3 ## this comment does cause issues +   ~~~~ +/apath/tsconfig.json:3:20 - error TS5023: Unknown compiler option 'this'. + +3 ## this comment does cause issues +   ~~~~ +/apath/tsconfig.json:3:25 - error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal. + +3 ## this comment does cause issues +   ~~~~~~~ +/apath/tsconfig.json:3:33 - error TS1136: Property assignment expected. + +3 ## this comment does cause issues +   ~~~~ +/apath/tsconfig.json:3:38 - error TS1136: Property assignment expected. + +3 ## this comment does cause issues +   ~~~~~ +/apath/tsconfig.json:3:44 - error TS1136: Property assignment expected. + +3 ## this comment does cause issues +   ~~~~~~ + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js new file mode 100644 index 00000000000..9e9aa45cb02 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js @@ -0,0 +1,14 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{"files":[{"compilerOptions":{"experimentalDecorators":true,"allowJs":true}}]} + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS5024: Compiler option 'files' requires a value of type string. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js new file mode 100644 index 00000000000..5b0a30c38f4 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js @@ -0,0 +1,17 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{"files":[{"compilerOptions":{"experimentalDecorators":true,"allowJs":true}}]} + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +/apath/tsconfig.json:1:11 - error TS5024: Compiler option 'files' requires a value of type string. + +1 {"files":[{"compilerOptions":{"experimentalDecorators":true,"allowJs":true}}]} +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js new file mode 100644 index 00000000000..b4e1615120a --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js @@ -0,0 +1,15 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{"include":[["./**/*.ts"]]} + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +error TS5024: Compiler option 'include' requires a value of type string. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js new file mode 100644 index 00000000000..2f9c86b9a82 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js @@ -0,0 +1,18 @@ +Fs:: +//// [/apath/a.ts] + + +//// [/apath/tsconfig.json] +{"include":[["./**/*.ts"]]} + + +configFileName:: /apath/tsconfig.json +FileNames:: + +Errors:: +/apath/tsconfig.json:1:13 - error TS5024: Compiler option 'include' requires a value of type string. + +1 {"include":[["./**/*.ts"]]} +   ~~~~~~~~~~~~~ +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. + diff --git a/tests/baselines/reference/config/tsconfigParsing/handles escaped characters in strings correctly jsonParse.js b/tests/baselines/reference/config/tsconfigParsing/handles escaped characters in strings correctly jsonParse.js new file mode 100644 index 00000000000..03adeb8b825 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/handles escaped characters in strings correctly jsonParse.js @@ -0,0 +1,29 @@ +Input:: +{ + "exclude": [ + "xx\"//files" + ] + } +Config:: +{ + "exclude": [ + "xx\"//files" + ] +} +Errors:: + + +Input:: +{ + "exclude": [ + "xx\\" // end of line comment + ] + } +Config:: +{ + "exclude": [ + "xx\\" + ] +} +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with json api.js b/tests/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with json api.js new file mode 100644 index 00000000000..8909e3dcbfe --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with json api.js @@ -0,0 +1,22 @@ +Fs:: +//// [/apath/..c.ts] + + +//// [/apath/.b.ts] + + +//// [/apath/.git/a.ts] + + +//// [/apath/test.ts] + + +//// [/apath/tsconfig.json] +{} + + +configFileName:: tsconfig.json +FileNames:: +/apath/test.ts +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with jsonSourceFile api.js new file mode 100644 index 00000000000..8909e3dcbfe --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/ignore dotted files and folders with jsonSourceFile api.js @@ -0,0 +1,22 @@ +Fs:: +//// [/apath/..c.ts] + + +//// [/apath/.b.ts] + + +//// [/apath/.git/a.ts] + + +//// [/apath/test.ts] + + +//// [/apath/tsconfig.json] +{} + + +configFileName:: tsconfig.json +FileNames:: +/apath/test.ts +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with json api.js b/tests/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with json api.js new file mode 100644 index 00000000000..30c9607be16 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with json api.js @@ -0,0 +1,25 @@ +Fs:: +//// [/bower_components/b.ts] + + +//// [/d.ts] + + +//// [/folder/e.ts] + + +//// [/jspm_packages/c.ts] + + +//// [/node_modules/a.ts] + + +//// [/tsconfig.json] +{} + + +configFileName:: tsconfig.json +FileNames:: +/d.ts,/folder/e.ts +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with jsonSourceFile api.js new file mode 100644 index 00000000000..30c9607be16 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/implicitly exclude common package folders with jsonSourceFile api.js @@ -0,0 +1,25 @@ +Fs:: +//// [/bower_components/b.ts] + + +//// [/d.ts] + + +//// [/folder/e.ts] + + +//// [/jspm_packages/c.ts] + + +//// [/node_modules/a.ts] + + +//// [/tsconfig.json] +{} + + +configFileName:: tsconfig.json +FileNames:: +/d.ts,/folder/e.ts +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/keeps string content untouched jsonParse.js b/tests/baselines/reference/config/tsconfigParsing/keeps string content untouched jsonParse.js new file mode 100644 index 00000000000..93db9affa44 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/keeps string content untouched jsonParse.js @@ -0,0 +1,29 @@ +Input:: +{ + "exclude": [ + "xx//file.d.ts" + ] + } +Config:: +{ + "exclude": [ + "xx//file.d.ts" + ] +} +Errors:: + + +Input:: +{ + "exclude": [ + "xx/*file.d.ts*/" + ] + } +Config:: +{ + "exclude": [ + "xx/*file.d.ts*/" + ] +} +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/parse and re-emit tsconfig.json file with diagnostics.js b/tests/baselines/reference/config/tsconfigParsing/parse and re-emit tsconfig.json file with diagnostics.js new file mode 100644 index 00000000000..dc6be67e56c --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/parse and re-emit tsconfig.json file with diagnostics.js @@ -0,0 +1,28 @@ +Initial:: +{ + "compilerOptions": { + "allowJs": true + // Some comments + "outDir": "bin" + } + "files": ["file1.ts"] + } +Result:: +{ + "compilerOptions": { + "allowJs": true, + "outDir": "bin" + }, + "files": [ + "file1.ts" + ] +} +Errors:: +config.json:5:21 - error TS1005: ',' expected. + +5 "outDir": "bin" +   ~~~~~~~~ +config.json:7:17 - error TS1005: ',' expected. + +7 "files": ["file1.ts"] +   ~~~~~~~ diff --git a/tests/baselines/reference/config/tsconfigParsing/parses wildcard directories even when parent directories have dots with json api.js b/tests/baselines/reference/config/tsconfigParsing/parses wildcard directories even when parent directories have dots with json api.js new file mode 100644 index 00000000000..77f4867a42f --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/parses wildcard directories even when parent directories have dots with json api.js @@ -0,0 +1,8 @@ +Fs:: +//// [/foo.bar/tsconfig.json] +{"include":["src"]} + + +configFileName:: /foo.bar/tsconfig.json +Wildcards:: +/foo.bar/src: WatchDirectoryFlags.Recursive diff --git a/tests/baselines/reference/config/tsconfigParsing/parses wildcard directories even when parent directories have dots with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/parses wildcard directories even when parent directories have dots with jsonSourceFile api.js new file mode 100644 index 00000000000..77f4867a42f --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/parses wildcard directories even when parent directories have dots with jsonSourceFile api.js @@ -0,0 +1,8 @@ +Fs:: +//// [/foo.bar/tsconfig.json] +{"include":["src"]} + + +configFileName:: /foo.bar/tsconfig.json +Wildcards:: +/foo.bar/src: WatchDirectoryFlags.Recursive diff --git a/tests/baselines/reference/config/tsconfigParsing/returns config object without comments jsonParse.js b/tests/baselines/reference/config/tsconfigParsing/returns config object without comments jsonParse.js new file mode 100644 index 00000000000..af0aa1822f9 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/returns config object without comments jsonParse.js @@ -0,0 +1,33 @@ +Input:: +{ // Excluded files + "exclude": [ + // Exclude d.ts + "file.d.ts" + ] + } +Config:: +{ + "exclude": [ + "file.d.ts" + ] +} +Errors:: + + +Input:: +{ + /* Excluded + Files + */ + "exclude": [ + /* multiline comments can be in the middle of a line */"file.d.ts" + ] + } +Config:: +{ + "exclude": [ + "file.d.ts" + ] +} +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/returns empty config for file with comments only jsonParse.js b/tests/baselines/reference/config/tsconfigParsing/returns empty config for file with comments only jsonParse.js new file mode 100644 index 00000000000..40357b1339b --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/returns empty config for file with comments only jsonParse.js @@ -0,0 +1,13 @@ +Input:: +// Comment +Config:: +{} +Errors:: + + +Input:: +/* Comment*/ +Config:: +{} +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/returns empty config for file with only whitespaces jsonParse.js b/tests/baselines/reference/config/tsconfigParsing/returns empty config for file with only whitespaces jsonParse.js new file mode 100644 index 00000000000..4c9fe24ded5 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/returns empty config for file with only whitespaces jsonParse.js @@ -0,0 +1,13 @@ +Input:: + +Config:: +{} +Errors:: + + +Input:: + +Config:: +{} +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/returns empty config when config is empty object jsonParse.js b/tests/baselines/reference/config/tsconfigParsing/returns empty config when config is empty object jsonParse.js new file mode 100644 index 00000000000..7e40d9f45dc --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/returns empty config when config is empty object jsonParse.js @@ -0,0 +1,6 @@ +Input:: +{} +Config:: +{} +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js b/tests/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js new file mode 100644 index 00000000000..eb0f0e1d547 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js @@ -0,0 +1,24 @@ +Fs:: +//// [/apath/foge.ts] + + +//// [/apath/test.ts] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "lib": ["es5"] + }, + "excludes": [ + "foge.ts" + ] + } + + +configFileName:: tsconfig.json +FileNames:: +/apath/foge.ts,/apath/test.ts +Errors:: +error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? + diff --git a/tests/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js new file mode 100644 index 00000000000..7e0de849d67 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js @@ -0,0 +1,27 @@ +Fs:: +//// [/apath/foge.ts] + + +//// [/apath/test.ts] + + +//// [/apath/tsconfig.json] +{ + "compilerOptions": { + "lib": ["es5"] + }, + "excludes": [ + "foge.ts" + ] + } + + +configFileName:: tsconfig.json +FileNames:: +/apath/foge.ts,/apath/test.ts +Errors:: +tsconfig.json:5:21 - error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? + +5 "excludes": [ +   ~~~~~~~~~~ + diff --git a/tests/baselines/reference/config/tsconfigParsing/returns object when users correctly specify library jsonParse.js b/tests/baselines/reference/config/tsconfigParsing/returns object when users correctly specify library jsonParse.js new file mode 100644 index 00000000000..da573d50493 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/returns object when users correctly specify library jsonParse.js @@ -0,0 +1,34 @@ +Input:: +{ + "compilerOptions": { + "lib": ["es5"] + } + } +Config:: +{ + "compilerOptions": { + "lib": [ + "es5" + ] + } +} +Errors:: + + +Input:: +{ + "compilerOptions": { + "lib": ["es5", "es6"] + } + } +Config:: +{ + "compilerOptions": { + "lib": [ + "es5", + "es6" + ] + } +} +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsing/returns object with error when json is invalid jsonParse.js b/tests/baselines/reference/config/tsconfigParsing/returns object with error when json is invalid jsonParse.js new file mode 100644 index 00000000000..8e8b752c475 --- /dev/null +++ b/tests/baselines/reference/config/tsconfigParsing/returns object with error when json is invalid jsonParse.js @@ -0,0 +1,10 @@ +Input:: +invalid +Config:: +{} +Errors:: +apath/tsconfig.json:1:1 - error TS1005: '{' expected. + +1 invalid +  ~~~~~~~ + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/different options with json api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/different options with json api.js index cc94977b4a1..10368b04e7c 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/different options with json api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/different options with json api.js @@ -1,109 +1,173 @@ -Input:: { +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "watchFile": "UseFsEvents" - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchFile": 4 } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "watchDirectory": "UseFsEvents" - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchDirectory": 0 } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "fallbackPolling": "DynamicPriority" - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "fallbackPolling": 2 } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "synchronousWatchDirectory": true - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "synchronousWatchDirectory": true } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "excludeDirectories": [ "**/temp" ] - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "excludeDirectories": [ "/**/temp" ] } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "excludeFiles": [ "**/temp/*.ts" ] - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "excludeFiles": [ "/**/temp/*.ts" ] } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "excludeDirectories": [ "**/../*" ] - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "excludeDirectories": [] } -Result: Errors:: -error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*'. +Errors:: +error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*'. -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "excludeFiles": [ "**/../*" ] - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "excludeFiles": [] } -Result: Errors:: -error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*'. +Errors:: +error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*'. + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/different options with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/different options with jsonSourceFile api.js index c335b45b794..7748786348f 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/different options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/different options with jsonSourceFile api.js @@ -1,107 +1,179 @@ -Input:: { +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "watchFile": "UseFsEvents" } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchFile": 4 } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "watchDirectory": "UseFsEvents" } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchDirectory": 0 } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "fallbackPolling": "DynamicPriority" } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "fallbackPolling": 2 } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "synchronousWatchDirectory": true } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "synchronousWatchDirectory": true } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "excludeDirectories": [ "**/temp" ] } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "excludeDirectories": [ "/**/temp" ] } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "excludeFiles": [ "**/temp/*.ts" ] } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "excludeFiles": [ "/**/temp/*.ts" ] } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "excludeDirectories": [ "**/../*" ] } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "excludeDirectories": [] } -Result: Errors:: -tsconfig.json:1:40 - error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*'. +Errors:: +tsconfig.json:4:4 - error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*'. + +4 "**/../*" +   ~~~~~~~~~ -1 {"watchOptions":{"excludeDirectories":["**/../*"]}} -   ~~~~~~~~~ -Input:: { +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "excludeFiles": [ "**/../*" ] } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "excludeFiles": [] } -Result: Errors:: -tsconfig.json:1:34 - error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*'. +Errors:: +tsconfig.json:4:4 - error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*'. + +4 "**/../*" +   ~~~~~~~~~ -1 {"watchOptions":{"excludeFiles":["**/../*"]}} -   ~~~~~~~~~ diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/empty watchOptions specified option with json api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/empty watchOptions specified option with json api.js index 2087b9e744a..f74ac086ed4 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/empty watchOptions specified option with json api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/empty watchOptions specified option with json api.js @@ -1,7 +1,15 @@ -Input:: { - "watchOptions": {}, - "compileOnSave": false -} +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ + "watchOptions": {} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: -Result: Errors:: +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/empty watchOptions specified option with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/empty watchOptions specified option with jsonSourceFile api.js index a25c30df65e..f74ac086ed4 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/empty watchOptions specified option with jsonSourceFile api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/empty watchOptions specified option with jsonSourceFile api.js @@ -1,6 +1,15 @@ -Input:: { +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": {} -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: -Result: Errors:: +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/no watchOptions specified option with json api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/no watchOptions specified option with json api.js index b37ccbed5fd..9bca31fc72a 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/no watchOptions specified option with json api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/no watchOptions specified option with json api.js @@ -1,6 +1,13 @@ -Input:: { - "compileOnSave": false -} +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{} + + +configFileName:: tsconfig.json Result: WatchOptions:: -Result: Errors:: +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/no watchOptions specified option with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/no watchOptions specified option with jsonSourceFile api.js index 4c0e952e8ea..9bca31fc72a 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/no watchOptions specified option with jsonSourceFile api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/no watchOptions specified option with jsonSourceFile api.js @@ -1,4 +1,13 @@ -Input:: {} +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{} + + +configFileName:: tsconfig.json Result: WatchOptions:: -Result: Errors:: +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/watch options extending passed in watch options with json api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/watch options extending passed in watch options with json api.js index 8d535837e9f..ecbeed86993 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/watch options extending passed in watch options with json api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/watch options extending passed in watch options with json api.js @@ -1,18 +1,33 @@ -Input:: { +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "watchFile": "UseFsEvents" - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchFile": 4 } -Result: Errors:: +Errors:: -Input:: { - "compileOnSave": false -} + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{} + + +configFileName:: tsconfig.json Result: WatchOptions:: -Result: Errors:: +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/watch options extending passed in watch options with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/watch options extending passed in watch options with jsonSourceFile api.js index 3cef381ecb2..ecbeed86993 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/watch options extending passed in watch options with jsonSourceFile api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/watch options extending passed in watch options with jsonSourceFile api.js @@ -1,15 +1,33 @@ -Input:: { +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{ "watchOptions": { "watchFile": "UseFsEvents" } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchFile": 4 } -Result: Errors:: +Errors:: -Input:: {} + +Fs:: +//// [/a.ts] + + +//// [/tsconfig.json] +{} + + +configFileName:: tsconfig.json Result: WatchOptions:: -Result: Errors:: +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with json api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with json api.js index 919753d60db..92ed497816a 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with json api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with json api.js @@ -1,24 +1,46 @@ -Input:: { +Fs:: +//// [/a.ts] + + +//// [/base.json] +{"watchOptions":{"watchFile":"UseFsEventsOnParentDirectory","watchDirectory":"FixedPollingInterval"}} + +//// [/tsconfig.json] +{ "extends": "./base.json", "watchOptions": { "watchFile": "UseFsEvents" - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchFile": 4, "watchDirectory": 1 } -Result: Errors:: +Errors:: -Input:: { - "extends": "./base.json", - "compileOnSave": false -} + +Fs:: +//// [/a.ts] + + +//// [/base.json] +{"watchOptions":{"watchFile":"UseFsEventsOnParentDirectory","watchDirectory":"FixedPollingInterval"}} + +//// [/tsconfig.json] +{ + "extends": "./base.json" +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchFile": 5, "watchDirectory": 1 } -Result: Errors:: +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with jsonSourceFile api.js index 9e02dd51739..92ed497816a 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with jsonSourceFile api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file with watchOptions with jsonSourceFile api.js @@ -1,22 +1,46 @@ -Input:: { +Fs:: +//// [/a.ts] + + +//// [/base.json] +{"watchOptions":{"watchFile":"UseFsEventsOnParentDirectory","watchDirectory":"FixedPollingInterval"}} + +//// [/tsconfig.json] +{ "extends": "./base.json", "watchOptions": { "watchFile": "UseFsEvents" } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchFile": 4, "watchDirectory": 1 } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/base.json] +{"watchOptions":{"watchFile":"UseFsEventsOnParentDirectory","watchDirectory":"FixedPollingInterval"}} + +//// [/tsconfig.json] +{ "extends": "./base.json" -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchFile": 5, "watchDirectory": 1 } -Result: Errors:: +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file without watchOptions with json api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file without watchOptions with json api.js index 24140819764..e08330e344f 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file without watchOptions with json api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file without watchOptions with json api.js @@ -1,20 +1,42 @@ -Input:: { +Fs:: +//// [/a.ts] + + +//// [/base.json] +{} + +//// [/tsconfig.json] +{ "extends": "./base.json", "watchOptions": { "watchFile": "UseFsEvents" - }, - "compileOnSave": false -} + } +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchFile": 4 } -Result: Errors:: +Errors:: -Input:: { - "extends": "./base.json", - "compileOnSave": false -} + +Fs:: +//// [/a.ts] + + +//// [/base.json] +{} + +//// [/tsconfig.json] +{ + "extends": "./base.json" +} + + +configFileName:: tsconfig.json Result: WatchOptions:: -Result: Errors:: +Errors:: + diff --git a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file without watchOptions with jsonSourceFile api.js b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file without watchOptions with jsonSourceFile api.js index 476bc99e4d8..e08330e344f 100644 --- a/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file without watchOptions with jsonSourceFile api.js +++ b/tests/baselines/reference/config/tsconfigParsingWatchOptions/when extending config file without watchOptions with jsonSourceFile api.js @@ -1,18 +1,42 @@ -Input:: { +Fs:: +//// [/a.ts] + + +//// [/base.json] +{} + +//// [/tsconfig.json] +{ "extends": "./base.json", "watchOptions": { "watchFile": "UseFsEvents" } -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: { "watchFile": 4 } -Result: Errors:: +Errors:: -Input:: { + +Fs:: +//// [/a.ts] + + +//// [/base.json] +{} + +//// [/tsconfig.json] +{ "extends": "./base.json" -} +} + + +configFileName:: tsconfig.json Result: WatchOptions:: -Result: Errors:: +Errors:: + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/default-setup-was-created-correctly.js b/tests/baselines/reference/tsc/projectReferencesConfig/default-setup-was-created-correctly.js new file mode 100644 index 00000000000..78de2be6d29 --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/default-setup-was-created-correctly.js @@ -0,0 +1,111 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/primary/a.ts] +export { }; + +//// [/primary/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [] +} + +//// [/secondary/b.ts] +import * as mod_0 from "../primary/a" + +//// [/secondary/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [ + { + "path": "../primary" + } + ] +} + + + +Output:: +/lib/tsc --p /primary/tsconfig.json +exitCode:: ExitStatus.Success + + +//// [/primary/bin/a.d.ts] +export {}; + + +//// [/primary/bin/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/primary/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3531955686-export { };","signature":"-3531856636-export {};\n"}],"root":[2],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2],"latestChangedDtsFile":"./a.d.ts"},"version":"FakeTSVersion"} + +//// [/primary/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../a.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../a.ts": { + "original": { + "version": "-3531955686-export { };", + "signature": "-3531856636-export {};\n" + }, + "version": "-3531955686-export { };", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + 2, + "../a.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../a.ts" + ], + "latestChangedDtsFile": "./a.d.ts" + }, + "version": "FakeTSVersion", + "size": 820 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/does-not-error-when-the-referenced-project-doesnt-have-composite-if-its-a-container-project.js b/tests/baselines/reference/tsc/projectReferencesConfig/does-not-error-when-the-referenced-project-doesnt-have-composite-if-its-a-container-project.js new file mode 100644 index 00000000000..563543266e9 --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/does-not-error-when-the-referenced-project-doesnt-have-composite-if-its-a-container-project.js @@ -0,0 +1,72 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/primary/a.ts] +export { }; + +//// [/primary/tsconfig.json] +{ + "compilerOptions": { + "composite": false, + "outDir": "bin" + }, + "references": [] +} + +//// [/reference/b.ts] +import * as mod_0 from "../primary/a" + +//// [/reference/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [ + { + "path": "../primary" + } + ], + "files": [] +} + + + +Output:: +/lib/tsc --p /reference/tsconfig.json +exitCode:: ExitStatus.Success + + +//// [/reference/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":[],"fileInfos":[],"root":[],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[]},"version":"FakeTSVersion"} + +//// [/reference/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [], + "fileInfos": {}, + "root": [], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": {}, + "exportedModulesMap": {} + }, + "version": "FakeTSVersion", + "size": 165 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/doesnt-infer-the-rootDir-from-source-paths.js b/tests/baselines/reference/tsc/projectReferencesConfig/doesnt-infer-the-rootDir-from-source-paths.js new file mode 100644 index 00000000000..dac29432d5d --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/doesnt-infer-the-rootDir-from-source-paths.js @@ -0,0 +1,97 @@ +Input:: +//// [/alpha/src/a.ts] +export const m: number = 3; + +//// [/alpha/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [] +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --p /alpha/tsconfig.json +exitCode:: ExitStatus.Success + + +//// [/alpha/bin/src/a.d.ts] +export declare const m: number; + + +//// [/alpha/bin/src/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.m = void 0; +exports.m = 3; + + +//// [/alpha/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../src/a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-12181672471-export const m: number = 3;","signature":"-6260611917-export declare const m: number;\n"}],"root":[2],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,1],"latestChangedDtsFile":"./src/a.d.ts"},"version":"FakeTSVersion"} + +//// [/alpha/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../src/a.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../src/a.ts": { + "original": { + "version": "-12181672471-export const m: number = 3;", + "signature": "-6260611917-export declare const m: number;\n" + }, + "version": "-12181672471-export const m: number = 3;", + "signature": "-6260611917-export declare const m: number;\n" + } + }, + "root": [ + [ + 2, + "../src/a.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../src/a.ts", + "../../lib/lib.d.ts" + ], + "latestChangedDtsFile": "./src/a.d.ts" + }, + "version": "FakeTSVersion", + "size": 866 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-file-is-outside-the-rootdir.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-file-is-outside-the-rootdir.js new file mode 100644 index 00000000000..32027721c8c --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-file-is-outside-the-rootdir.js @@ -0,0 +1,139 @@ +Input:: +//// [/alpha/src/a.ts] +import * as b from '../../beta/b' + +//// [/alpha/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [] +} + +//// [/beta/b.ts] +export { } + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --p /alpha/tsconfig.json +alpha/src/a.ts:1:20 - error TS6059: File '/beta/b.ts' is not under 'rootDir' '/alpha'. 'rootDir' is expected to contain all source files. + +1 import * as b from '../../beta/b' +   ~~~~~~~~~~~~~~ + +alpha/src/a.ts:1:20 - error TS6307: File '/beta/b.ts' is not listed within the file list of project '/alpha/tsconfig.json'. Projects must list all files or use an 'include' pattern. + +1 import * as b from '../../beta/b' +   ~~~~~~~~~~~~~~ + + +Found 2 errors in the same file, starting at: alpha/src/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/alpha/bin/src/a.d.ts] +export {}; + + +//// [/alpha/bin/src/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/alpha/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../../beta/b.ts","../src/a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3360792065-export { }","signature":"-3531856636-export {};\n"},{"version":"-5654511483-import * as b from '../../beta/b'","signature":"-3531856636-export {};\n"}],"root":[3],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[3,2,1],"latestChangedDtsFile":"./src/a.d.ts"},"version":"FakeTSVersion"} + +//// [/alpha/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../../beta/b.ts", + "../src/a.ts" + ], + "fileNamesList": [ + [ + "../../beta/b.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../beta/b.ts": { + "original": { + "version": "-3360792065-export { }", + "signature": "-3531856636-export {};\n" + }, + "version": "-3360792065-export { }", + "signature": "-3531856636-export {};\n" + }, + "../src/a.ts": { + "original": { + "version": "-5654511483-import * as b from '../../beta/b'", + "signature": "-3531856636-export {};\n" + }, + "version": "-5654511483-import * as b from '../../beta/b'", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + 3, + "../src/a.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../src/a.ts": [ + "../../beta/b.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../src/a.ts", + "../../beta/b.ts", + "../../lib/lib.d.ts" + ], + "latestChangedDtsFile": "./src/a.d.ts" + }, + "version": "FakeTSVersion", + "size": 971 +} + +//// [/beta/b.d.ts] +export {}; + + +//// [/beta/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-prepended-project-reference-doesnt-set-outFile.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-prepended-project-reference-doesnt-set-outFile.js new file mode 100644 index 00000000000..ab4a988b13d --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-prepended-project-reference-doesnt-set-outFile.js @@ -0,0 +1,122 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/primary/a.ts] +export { }; + +//// [/primary/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [ + { + "path": "../someProj", + "prepend": true + } + ] +} + +//// [/someProj/b.ts] +const x = 100; + +//// [/someProj/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [] +} + + + +Output:: +/lib/tsc --p /primary/tsconfig.json --ignoreDeprecations 5.0 +primary/tsconfig.json:7:3 - error TS6308: Cannot prepend project '/someProj' because it does not have 'outFile' set + + 7 { +   ~ + 8 "path": "../someProj", +  ~~~~~~~~~~~~~~~~~~~~~~~~~ + 9 "prepend": true +  ~~~~~~~~~~~~~~~~~~ +10 } +  ~~~ + + +Found 1 error in primary/tsconfig.json:7 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/primary/bin/a.d.ts] +export {}; + + +//// [/primary/bin/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/primary/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3531955686-export { };","signature":"-3531856636-export {};\n"}],"root":[2],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"latestChangedDtsFile":"./a.d.ts"},"version":"FakeTSVersion"} + +//// [/primary/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../a.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../a.ts": { + "original": { + "version": "-3531955686-export { };", + "signature": "-3531856636-export {};\n" + }, + "version": "-3531955686-export { };", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + 2, + "../a.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "latestChangedDtsFile": "./a.d.ts" + }, + "version": "FakeTSVersion", + "size": 785 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-prepended-project-reference-output-doesnt-exist.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-prepended-project-reference-output-doesnt-exist.js new file mode 100644 index 00000000000..023ef4bfd92 --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-a-prepended-project-reference-output-doesnt-exist.js @@ -0,0 +1,139 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/primary/a.ts] +const y = x; + +//// [/primary/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [ + { + "path": "../someProj", + "prepend": true + } + ] +} + +//// [/someProj/b.ts] +const x = 100; + +//// [/someProj/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + "outFile": "foo.js" + }, + "references": [] +} + + + +Output:: +/lib/tsc --p /primary/tsconfig.json --ignoreDeprecations 5.0 +error TS6053: File '/someProj/foo.d.ts' not found. + The file is in the program because: + Output from referenced project '/someProj/tsconfig.json' included because '--module' is specified as 'none' + + primary/tsconfig.json:7:3 +  7 { +    ~ +  8 "path": "../someProj", +   ~~~~~~~~~~~~~~~~~~~~~~~~~ +  9 "prepend": true +   ~~~~~~~~~~~~~~~~~~ + 10 } +   ~~~ + File is output from referenced project specified here. + +primary/tsconfig.json:7:3 - error TS6309: Output file '/someProj/foo.js' from project '/someProj' does not exist + + 7 { +   ~ + 8 "path": "../someProj", +  ~~~~~~~~~~~~~~~~~~~~~~~~~ + 9 "prepend": true +  ~~~~~~~~~~~~~~~~~~ +10 } +  ~~~ + + +Found 2 errors in the same file, starting at: primary/tsconfig.json:7 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/primary/bin/a.d.ts] +declare const y: any; + + +//// [/primary/bin/a.js] +var y = x; + + +//// [/primary/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4096062741-const y = x;","signature":"-1874842468-declare const y: any;\n","affectsGlobalScope":true}],"root":[2],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"latestChangedDtsFile":"./a.d.ts"},"version":"FakeTSVersion"} + +//// [/primary/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../a.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../a.ts": { + "original": { + "version": "4096062741-const y = x;", + "signature": "-1874842468-declare const y: any;\n", + "affectsGlobalScope": true + }, + "version": "4096062741-const y = x;", + "signature": "-1874842468-declare const y: any;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "../a.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "latestChangedDtsFile": "./a.d.ts" + }, + "version": "FakeTSVersion", + "size": 822 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js new file mode 100644 index 00000000000..01ebab507ac --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js @@ -0,0 +1,101 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/primary/a.ts] +export { }; + +//// [/primary/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + "declaration": false + }, + "references": [] +} + + + +Output:: +/lib/tsc --p /primary/tsconfig.json +primary/tsconfig.json:5:3 - error TS6304: Composite projects may not disable declaration emit. + +5 "declaration": false +   ~~~~~~~~~~~~~ + + +Found 1 error in primary/tsconfig.json:5 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/primary/bin/a.d.ts] +export {}; + + +//// [/primary/bin/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/primary/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3531955686-export { };","signature":"-3531856636-export {};\n"}],"root":[2],"options":{"composite":true,"declaration":false,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"latestChangedDtsFile":"./a.d.ts"},"version":"FakeTSVersion"} + +//// [/primary/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../a.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../a.ts": { + "original": { + "version": "-3531955686-export { };", + "signature": "-3531856636-export {};\n" + }, + "version": "-3531955686-export { };", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + 2, + "../a.ts" + ] + ], + "options": { + "composite": true, + "declaration": false, + "outDir": "./" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "latestChangedDtsFile": "./a.d.ts" + }, + "version": "FakeTSVersion", + "size": 805 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-file-list-is-not-exhaustive.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-file-list-is-not-exhaustive.js new file mode 100644 index 00000000000..3f601b9987e --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-file-list-is-not-exhaustive.js @@ -0,0 +1,137 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/primary/a.ts] +import * as b from './b' + +//// [/primary/b.ts] +export {} + +//// [/primary/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [], + "files": [ + "a.ts" + ] +} + + + +Output:: +/lib/tsc --p /primary/tsconfig.json +primary/a.ts:1:20 - error TS6307: File '/primary/b.ts' is not listed within the file list of project '/primary/tsconfig.json'. Projects must list all files or use an 'include' pattern. + +1 import * as b from './b' +   ~~~~~ + + +Found 1 error in primary/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/primary/bin/a.d.ts] +export {}; + + +//// [/primary/bin/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/primary/bin/b.d.ts] +export {}; + + +//// [/primary/bin/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/primary/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../b.ts","../a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2704852577-export {}","signature":"-3531856636-export {};\n"},{"version":"-4190788607-import * as b from './b'","signature":"-3531856636-export {};\n"}],"root":[3],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2],"latestChangedDtsFile":"./a.d.ts"},"version":"FakeTSVersion"} + +//// [/primary/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../b.ts", + "../a.ts" + ], + "fileNamesList": [ + [ + "../b.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../b.ts": { + "original": { + "version": "-2704852577-export {}", + "signature": "-3531856636-export {};\n" + }, + "version": "-2704852577-export {}", + "signature": "-3531856636-export {};\n" + }, + "../a.ts": { + "original": { + "version": "-4190788607-import * as b from './b'", + "signature": "-3531856636-export {};\n" + }, + "version": "-4190788607-import * as b from './b'", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + 3, + "../a.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../a.ts": [ + "../b.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../a.ts", + "../b.ts" + ], + "latestChangedDtsFile": "./a.d.ts" + }, + "version": "FakeTSVersion", + "size": 945 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js new file mode 100644 index 00000000000..101c82a67c7 --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js @@ -0,0 +1,107 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/primary/a.ts] +export { }; + +//// [/primary/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [ + { + "path": "../foo" + } + ] +} + + + +Output:: +/lib/tsc --p /primary/tsconfig.json +primary/tsconfig.json:7:3 - error TS6053: File '/foo' not found. + +7 { +   ~ +8 "path": "../foo" +  ~~~~~~~~~~~~~~~~~~~ +9 } +  ~~~ + + +Found 1 error in primary/tsconfig.json:7 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/primary/bin/a.d.ts] +export {}; + + +//// [/primary/bin/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/primary/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3531955686-export { };","signature":"-3531856636-export {};\n"}],"root":[2],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"latestChangedDtsFile":"./a.d.ts"},"version":"FakeTSVersion"} + +//// [/primary/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../a.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../a.ts": { + "original": { + "version": "-3531955686-export { };", + "signature": "-3531856636-export {};\n" + }, + "version": "-3531955686-export { };", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + 2, + "../a.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "latestChangedDtsFile": "./a.d.ts" + }, + "version": "FakeTSVersion", + "size": 785 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js new file mode 100644 index 00000000000..596e2f9278a --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js @@ -0,0 +1,122 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/primary/a.ts] +export { }; + +//// [/primary/tsconfig.json] +{ + "compilerOptions": { + "composite": false, + "outDir": "bin" + }, + "references": [] +} + +//// [/reference/b.ts] +import * as mod_0 from "../primary/a" + +//// [/reference/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [ + { + "path": "../primary" + } + ], + "files": [ + "b.ts" + ] +} + + + +Output:: +/lib/tsc --p /reference/tsconfig.json +reference/tsconfig.json:7:3 - error TS6306: Referenced project '/primary' must have setting "composite": true. + +7 { +   ~ +8 "path": "../primary" +  ~~~~~~~~~~~~~~~~~~~~~~~ +9 } +  ~~~ + + +Found 1 error in reference/tsconfig.json:7 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/reference/bin/b.d.ts] +export {}; + + +//// [/reference/bin/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/reference/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9543969340-import * as mod_0 from \"../primary/a\"","signature":"-3531856636-export {};\n"}],"root":[2],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"latestChangedDtsFile":"./b.d.ts"},"version":"FakeTSVersion"} + +//// [/reference/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../b.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../b.ts": { + "original": { + "version": "-9543969340-import * as mod_0 from \"../primary/a\"", + "signature": "-3531856636-export {};\n" + }, + "version": "-9543969340-import * as mod_0 from \"../primary/a\"", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + 2, + "../b.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "latestChangedDtsFile": "./b.d.ts" + }, + "version": "FakeTSVersion", + "size": 813 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js b/tests/baselines/reference/tsc/projectReferencesConfig/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js new file mode 100644 index 00000000000..c041e1c2bd1 --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js @@ -0,0 +1,137 @@ +Input:: +//// [/alpha/a.ts] +export const m: number = 3; + +//// [/alpha/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [] +} + +//// [/beta/b.ts] +import { m } from '@alpha/a' + +//// [/beta/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin", + "baseUrl": "./", + "paths": { + "@alpha/*": [ + "/alpha/*" + ] + } + }, + "references": [ + { + "path": "../alpha" + } + ] +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --p /beta/tsconfig.json +beta/b.ts:1:19 - error TS6305: Output file '/alpha/bin/a.d.ts' has not been built from source file '/alpha/a.ts'. + +1 import { m } from '@alpha/a' +   ~~~~~~~~~~ + + +Found 1 error in beta/b.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/beta/bin/b.d.ts] +export {}; + + +//// [/beta/bin/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/beta/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"2892088637-import { m } from '@alpha/a'","signature":"-3531856636-export {};\n"}],"root":[2],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[[2,[{"file":"../b.ts","start":18,"length":10,"messageText":"Output file '/alpha/bin/a.d.ts' has not been built from source file '/alpha/a.ts'.","category":1,"code":6305}]],1],"latestChangedDtsFile":"./b.d.ts"},"version":"FakeTSVersion"} + +//// [/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../b.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../b.ts": { + "original": { + "version": "2892088637-import { m } from '@alpha/a'", + "signature": "-3531856636-export {};\n" + }, + "version": "2892088637-import { m } from '@alpha/a'", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + 2, + "../b.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + [ + "../b.ts", + [ + { + "file": "../b.ts", + "start": 18, + "length": 10, + "messageText": "Output file '/alpha/bin/a.d.ts' has not been built from source file '/alpha/a.ts'.", + "category": 1, + "code": 6305 + } + ] + ], + "../../lib/lib.d.ts" + ], + "latestChangedDtsFile": "./b.d.ts" + }, + "version": "FakeTSVersion", + "size": 1006 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/issues-a-nice-error-when-the-input-file-is-missing.js b/tests/baselines/reference/tsc/projectReferencesConfig/issues-a-nice-error-when-the-input-file-is-missing.js new file mode 100644 index 00000000000..0a41fbe611f --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/issues-a-nice-error-when-the-input-file-is-missing.js @@ -0,0 +1,131 @@ +Input:: +//// [/alpha/a.ts] +export const m: number = 3; + +//// [/alpha/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [] +} + +//// [/beta/b.ts] +import { m } from '../alpha/a' + +//// [/beta/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [ + { + "path": "../alpha" + } + ] +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --p /beta/tsconfig.json +beta/b.ts:1:19 - error TS6305: Output file '/alpha/bin/a.d.ts' has not been built from source file '/alpha/a.ts'. + +1 import { m } from '../alpha/a' +   ~~~~~~~~~~~~ + + +Found 1 error in beta/b.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/beta/bin/b.d.ts] +export {}; + + +//// [/beta/bin/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/beta/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-4853599800-import { m } from '../alpha/a'","signature":"-3531856636-export {};\n"}],"root":[2],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[[2,[{"file":"../b.ts","start":18,"length":12,"messageText":"Output file '/alpha/bin/a.d.ts' has not been built from source file '/alpha/a.ts'.","category":1,"code":6305}]],1],"latestChangedDtsFile":"./b.d.ts"},"version":"FakeTSVersion"} + +//// [/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../b.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../b.ts": { + "original": { + "version": "-4853599800-import { m } from '../alpha/a'", + "signature": "-3531856636-export {};\n" + }, + "version": "-4853599800-import { m } from '../alpha/a'", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + 2, + "../b.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + [ + "../b.ts", + [ + { + "file": "../b.ts", + "start": 18, + "length": 12, + "messageText": "Output file '/alpha/bin/a.d.ts' has not been built from source file '/alpha/a.ts'.", + "category": 1, + "code": 6305 + } + ] + ], + "../../lib/lib.d.ts" + ], + "latestChangedDtsFile": "./b.d.ts" + }, + "version": "FakeTSVersion", + "size": 1009 +} + diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/redirects-to-the-output-dts-file.js b/tests/baselines/reference/tsc/projectReferencesConfig/redirects-to-the-output-dts-file.js new file mode 100644 index 00000000000..238f144190a --- /dev/null +++ b/tests/baselines/reference/tsc/projectReferencesConfig/redirects-to-the-output-dts-file.js @@ -0,0 +1,156 @@ +Input:: +//// [/alpha/a.ts] +export const m: number = 3; + +//// [/alpha/bin/a.d.ts] +export { }; + +//// [/alpha/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [] +} + +//// [/beta/b.ts] +import { m } from '../alpha/a' + +//// [/beta/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outDir": "bin" + }, + "references": [ + { + "path": "../alpha" + } + ] +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --p /beta/tsconfig.json --explainFiles +beta/b.ts:1:10 - error TS2305: Module '"../alpha/a"' has no exported member 'm'. + +1 import { m } from '../alpha/a' +   ~ + +lib/lib.d.ts + Default library for target 'es5' +alpha/bin/a.d.ts + Imported via '../alpha/a' from file 'beta/b.ts' + File is output of project reference source 'alpha/a.ts' +beta/b.ts + Matched by default include pattern '**/*' + +Found 1 error in beta/b.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/beta/bin/b.d.ts] +export {}; + + +//// [/beta/bin/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/beta/bin/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../../alpha/bin/a.d.ts","../b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-3531955686-export { };",{"version":"-4853599800-import { m } from '../alpha/a'","signature":"-3531856636-export {};\n"}],"root":[3],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,[3,[{"file":"../b.ts","start":9,"length":1,"messageText":"Module '\"../alpha/a\"' has no exported member 'm'.","category":1,"code":2305}]],1],"latestChangedDtsFile":"./b.d.ts"},"version":"FakeTSVersion"} + +//// [/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../../alpha/bin/a.d.ts", + "../b.ts" + ], + "fileNamesList": [ + [ + "../../alpha/bin/a.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../alpha/bin/a.d.ts": { + "version": "-3531955686-export { };", + "signature": "-3531955686-export { };" + }, + "../b.ts": { + "original": { + "version": "-4853599800-import { m } from '../alpha/a'", + "signature": "-3531856636-export {};\n" + }, + "version": "-4853599800-import { m } from '../alpha/a'", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + 3, + "../b.ts" + ] + ], + "options": { + "composite": true, + "outDir": "./" + }, + "referencedMap": { + "../b.ts": [ + "../../alpha/bin/a.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../alpha/bin/a.d.ts", + [ + "../b.ts", + [ + { + "file": "../b.ts", + "start": 9, + "length": 1, + "messageText": "Module '\"../alpha/a\"' has no exported member 'm'.", + "category": 1, + "code": 2305 + } + ] + ], + "../../lib/lib.d.ts" + ], + "latestChangedDtsFile": "./b.d.ts" + }, + "version": "FakeTSVersion", + "size": 1054 +} +