2

我在生成模拟时面临以下问题SwiftyMocky

╔════════════════════════╗
║ SwiftyMocky CLI v3.5.0 ║
╚════════════════════════╝

Running at: <path-to-project>SomeProject
Processing mock: SomeTests ...
❌  Error: ShellOut encountered an error
Status code: 1
Message: "Unknown Arguments: <path>/.mocky/.config.yml.tmp

Options:
    --watch [default: false] - Watch template for changes and regenerate as needed.
    --disableCache [default: false] - Stops using cache.
    --verbose [default: false] - Turn on verbose logging
    --quiet [default: false] - Turn off any logging, only emmit errors.
    --prune [default: false] - Remove empty generated files
    --sources - Path to a source swift files. File or Directory.
    --exclude-sources - Path to a source swift files to exclude. File or Directory.
    --templates - Path to templates. File or Directory.
    --exclude-templates - Path to templates to exclude. File or Directory.
    --output - Path to output. File or Directory. Default is current path.
    --config - Path to config file. File or Directory. Default is current path.
    --force-parse - File extensions that Sourcery will be forced to parse, even if they were generated by Sourcery.
    --args - Custom values to pass to templates.
    --ejsPath - Path to EJS file for JavaScript templates."
Output: ""

我已经尝试sourcery将版本更新到 0.18.0 并卸载两者sourcerySwiftyMocky重新安装。

任何帮助,将不胜感激。

更新SwiftyMocky doctor日志

✗ SwiftyMocky doctor
╔════════════════════════╗
║ SwiftyMocky CLI v3.5.0 ║
╚════════════════════════╝


1. Inspecting tools dependencies:
  ✅  Mint available
  ✅  Sourcery is available through Mint

2. Inspecting Mockfile:
  ✅  Mockfile exists
  ✅  Mockfile contains mocks definitions

3. Linting 'ServicingTests' mock:
  ✅  Output file exists
  Targets:
  ✅  Mock defines targets correctly
  ✅  All targets include 
'./<project>/ServicingTests/ServicingTests.Mock.generated.swift' file.
  Sources:
  ✅  Sources are defined correctly
  Imports:
  ✅  Testable imports are defined
  ✅  Imports are defined

此外,我的一位同事能够生成模拟。他说当他运行SwiftyMocky generate命令时它不会生成<path>/.mocky/.config.yml.tmp.

唯一的区别是macOS版本。我在跑10.15.4,他在跑10.15.3

4

1 回答 1

3

我终于解决了这个问题,这是一件愚蠢的事情。我space在项目路径中有一个。我所需要的只是space从项目路径中删除它,它就像一个魅力。

于 2020-05-20T04:59:50.077 回答