YAMLResume

測試

為了擁有流暢的開發體驗,擁有可靠的測試策略非常重要。這包括單元測試、整合測試和端到端測試,以確保應用程式的所有方面都按預期運行。

單元測試

您可以使用以下命令運行單元測試:

# run tests for yamlresume/cli package
pnpm cli test

# run tests for yamlresume/core package
pnpm core test

# run tests for all packages
pnpm test

如果您正在開發新功能,可以在文件變化時運行測試:

# watch and test for changes in yamlresume/cli package
pnpm cli test:watch

# watch and test for changes in yamlresume/core package
pnpm core test:watch

# watch and test for changes in all packages
pnpm test:watch

如果您正在開發依賴於 yamlresume/core 包的 CLI 功能,不要忘記構建 yamlresume/core 包。

測試覆蓋率

YAMLResume 保持 100% 單元測試覆蓋率 以追求高程式碼品質並防止回歸。您可以通過運行以下命令檢查測試覆蓋率報告:

# check test coverage for yamlresume/cli package
pnpm cli test:cov

# check test coverage for yamlresume/core package
pnpm core test:cov

# check test coverage for all packages
pnpm test:cov
Edit on GitHub

Last updated on