草庐IT

microsoft-test-manager

全部标签

javascript - 不允许在 Microsoft Edge 中加载 blob pdf 资源

这个问题在这里已经有了答案:OpenlinksmadebycreateObjectURLinIE11(5个答案)关闭5年前。此应用程序用于从数据库收集信息并从中生成.pdf文件。this.reportsService.getTelerikReport({reportId:this.selectReportId,startDate:this.startDate,endDate:this.endDate,ReportItems:listCheckItems}).then(response=>{this.fileLoading=false;varfile=newBlob([response]

javascript - Node/npm : How to manage globally installed devDependencies

我正在构建一个带有应该全局安装的devDependencies的Node模块,例如jasmine-node和jshint。我本质上需要的是能够在我的makefile/npm脚本部分引用它们的二进制文件以运行测试、lint等。换句话说,我不希望以编程方式require()它们。在四处挖掘之后,我仍然对如何处理这个问题感到困惑:1)我的第一个方法是假设这些模块将全局安装,在我的模块文档中阐明这一点并将它们的二进制文件引用为全局变量——即期望它们全局可用。这与这条建议冲突Makesureyouavoidreferencinggloballyinstalledbinaries.Instead,

javascript - 使用 Chutzpah 运行 QUnit (TypeScript) 测试给出 "Called start() outside of a test context while already started"

我有一个相当简单的重现,结果我不明白。确保安装了Chutpah测试适配器4.0.3。使用VisualStudio2013执行以下步骤:创建一个新的.NET4.5.1类库项目;添加NuGet包qunit.TypeScript.DefinitelyTyped0.1.7;将TypeScript文件file1.ts添加到项目中,内容如下:///QUnit.test("QUnitisworking",assert=>assert.ok(true));在该文件内右键单击并从上下文菜单中选择“运行JS测试”。我可以确认file1.js是按预期生成的。结果是没有运行任何测试,测试资源管理器没有显示测试

javascript - 如何在规范文件中注入(inject)服务 Angular Testing (Jasmine/karma)

我刚开始编写Angular单元测试用例。我在我的Controller文件(.ts)中注入(inject)一项服务。我将如何在规范文件中注入(inject)服务文件。代码如下:app.component.tsgetSortData(){this.sortService.sortNumberData(this.data,'name','asce');}sort.service.tssortNumberData(data,rendererKey,type){//data.sort((elem1,elem2)=>{////ifnumberisundefined,thenassigning`MA

javascript - '错误 : Unexpected request' during Karma Angular Unit Test

运行gruntkarma时,其中一个指令的测试在尝试获取模板时失败。我使用ng-html2js作为预处理器。这是我的一些karma.conf.jsplugins:['karma-chrome-launcher','karma-jasmine','ng-html2js','karma-ng-html2js-preprocessor'],preprocessors:{'app/scripts/directives/**/*.html':'ng-html2js'},ngHtml2JsPreprocessor:{moduleName:'templates'}在我的测试中,我有以下内容:'use

javascript - Microsoft JScript 运行时错误 : Function expected

我有以下javascript函数,其中包含一些jquery。当我调用createAppointmentConfirm函数时,它尝试调用SendMail(id)函数但抛出错误:"MicrosoftJScriptruntimeerror:Functionexpected"Firefox调试器抛出一个错误:SendMailisnotafunction[BreakOnThisError]SendMail(data.Message);这是代码。感谢您的帮助。functioncreateAppointmentConfirm(data){if(data.Error){alert(data.Messa

javascript - 使用 Jest 时防止 "test/expect/etc is not defined"错误

Facebook的Jest测试框架很容易getstartedwith,butthedocumentation俯瞰一个annoyingaspect:任何试图警告undefinedsymbol的编辑器都会将测试语句突出显示为错误,因为未定义test、expect和所有匹配器方法。同样,尝试直接使用node运行测试文件将失败并显示ReferenceError:testisnotdefined。需要添加哪些require/import语句才能消除这些错误? 最佳答案 节点如果您想直接通过节点运行它们,请尝试要求jest和/或jest-run

javascript - RegExp.test 不工作?

我试图在javascript中使用Regex.test验证年份,但无法弄清楚为什么它返回false。varregEx=newRegExp("^(19|20)[\d]{2,2}$");regEx.test(inputValue)对于输入值1981、2007返回false谢谢 最佳答案 当您使用字符串表达式创建RegExp对象时,您需要加倍反斜杠以便它们正确转义。另外[\d]{2,2}可以简化为\d\d:varregEx=newRegExp("^(19|20)\\d\\d$");或者更好的是使用正则表达式文字来避免双反斜杠:varreg

javascript - meteor JS : How to stub validated method in unit test

我正在使用经过验证的方法(mdg:validated-method)和LoggedInMixin(tunifight:loggedin-mixin)。现在我的单元测试出现了问题,因为它们因notLogged错误而失败,因为在单元测试中当然没有登录用户。我怎么必须stub呢?方法constresetEdit=newValidatedMethod({name:'reset',mixins:[LoggedInMixin],checkLoggedInError:{error:'notLogged'},//单元测试describe('resetEdit',()=>{it('shouldreset

javascript - 在另一个项目中使用 marble testing rxjs5 方法

我有一个webapp项目,它使用rxjs5来实现flux我目前正在寻找为其编写单元测试的解决方案。其实我已经在里面实现了自定义的observables,例如:functiongetActivityObservable(events,timeout){returnObservable.create((observer)=>{constdeb=debounce(()=>observer.next(false),timeout||DEFAULT_TIMEOUT);constsub=events.subscribe((e)=>{if(!e){deb.cancel();observer.next