2017-08-30 6 views
0

私は、私のプロジェクトをtypescriptでテストするためにchutzpahとJasmineをセットアップするつもりです。現在のプロジェクトでchutzpahを使用する方法

私はnpmを使ってJasmineをインストールしましたが、ビジュアルスタジオコードにchutzpahを含める方法はかなり混乱しています。

私はこのGitHubのに行ってきましたが、何も私には明らかではありません: -

https://github.com/mmanela/chutzpah

はまた、私はソースの下からVisual Studioのコード用のファイルをダウンロード: -

https://marketplace.visualstudio.com/items?itemName=vs-publisher-2795.ChutzpahTestRunnerContextMenuExtension

https://marketplace.visualstudio.com/items?itemName=vs-publisher-2795.ChutzpahTestAdapterfortheTestExplorer

上記のダウンロードしたファイルを拡張子としてv私はエラーが表示されます: -

拡張子/パッケージ.jsonが見つかりません。

私のプロジェクトにchutzpahを組み込み、インストールしてchutzpah.jsonファイルを使用するにはどうすればいいですか?

ありがとうございます。より

npm init 

これはpackage.json

を作成します:

+0

の一環として、あなたのユニットテストを実行するためにcommangラインと大胆ランナーを使用することができます。 – Adrian

答えて

1

コマンドラインから最初の位置を予測してください、あなたに行く は、あなたが手動で作成およびVisual Studioから最初に実行することができますchuzpah.json右クリックで、プラグインが正しくインストールされていれば、ユニットテストを実行するオプションが表示されます。 chutzpah.jsonの設定は難しい部分です。 here is template for setup

{   
"Framework": "qunit|jasmine|mocha", 

"FrameworkVersion": "", 

"EnableTestFileBatching": "true|false", 

"InheritFromParent": "true|false", 

"InheritFromPtah": "<Path to another chutzpah.json>", 

"IgnoreResourceLoadingErrors": "true|false" 

"TestFileTimeout": "<Timeout in milliseconds>", 

"TestHarnessLocationMode": "TestFileAdjacent|SettingsFileAdjacent|Custom", 

"TestHarnessDirectory": "<Path to a folder>", 

"TestHarnessReferenceMode": "Normal|AMD", 

"RootReferencePathMode":"DriveRoot|SettingsFileDirectory", 

"CodeCoverageIncludes": [], 

"CodeCoverageExcludes": [], 

"CodeCoverageIgnores": [], 

"CodeCoverageExecutionMode": "Manual|Always|Never", 

"CodeCoverageSuccessPercentage": <Number from 0 to 100>, 

"CodeCoverageTimeout": <Timeout in milliseconds> 

"References": [], 

"Tests": [], 

"CustomTestHarnessPath": "<Path to custom test harness file>", 

"Compile": <A compile configuration object>, 

"Server": <A server configuration object>, 

"TestPattern": "<Regex test name pattern>", 

"AMDBaseUrl": "<Path to same location that your Require.js config baseurl points to>", 

"AMDAppDirectory": "<The root folder for your AMD paths>", 

"UserAgent": "<Custom user agent to use during testing>", 

"Transforms": [], 

"EnableTracing": true|false, 

"TraceFilePath": "<Path to log file. Defaults to %temp%/chutzpah.log>", 

"Parallelism": "<Max degree of parallelism for Chutzpah. Defaults to number of CPUs>", 

"BrowserArguments": <A map of browser name (keys) to corresponding browser arguments (values), i.e.; { 'chrome': '--allow-file-access-from-files' }.> 
} 

結局のところ、あなたはCIの拡張機能は、VSのためVSCodeではありません

関連する問題