我是Angular的新手。我在我当前的项目中使用Angular 4.我正在学习使用angular进行单元测试,只是想知道我是否可以单独测试一个特定的spec.ts文件。
感谢任何帮助。
由于
答案 0 :(得分:0)
使用describe
f
作为fdescribe
的前缀,例如BindingContext="{x:Reference viewmodel}
答案 1 :(得分:-1)
使用System.Security.Cryptography.SHA256 sha = System.Security.Cryptography.SHA256.Create();
byte[] hash = sha.ComputeHash(Encoding.UTF8.GetBytes("<wsse:BinarySecurityToken xmlns=\"\" xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" ValueType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3\">MIIF...2A8=</wsse:BinarySecurityToken>"));
string digestValue = Convert.ToBase64String(hash);
代替select ceiling(price)
-------------------------------------------------------------------------
| test following numbers as inputted price value | Is my desired Output |
| INPUT | OUTPUT |
-------------------------------------------------------------------------
| 879999.51357924604783137 | 880000 |
| 879999.50720242608036391 | 880000 |
| 879999.47819604919865821 | 880000 |
| 879999.49455676516329704 | 880000 |
| 880000.5 | 880000 |
-------------------------------------------------------------------------
,它只会运行此fdescribe
块内的测试。 IntelliJ / Webstorm还允许您从上下文菜单中测试单个文件
答案 2 :(得分:-1)
首先将组件转到组件的spec.ts文件中。
然后将f放在it
和describe
的前面,这样就可以得到fdescribe
和fit
。
然后转到控制台或终端,然后执行ng test
。
上述命令将仅执行fdescribe
和fit
测试用例,其他测试用例将被忽略。