首页 \ 问答 \ 实习生 - 创建本地隧道以运行功能测试(Intern - Create local tunnel to run functional tests)

实习生 - 创建本地隧道以运行功能测试(Intern - Create local tunnel to run functional tests)

所以我开始使用Intern进行功能测试,到目前为止我做得很好,单元和功能测试。

我按照他们的实习教程

每当您需要针对所有平台运行完整测试时,请使用测试运行器。 当您正在编写测试并希望更快地检查它们的正确性时,您可以只使用Node.js客户端(仅用于单元测试)或创建仅针对单个本地平台进行测试的备用配置文件,就像您的本地Chrome或Firefox 副本一样 (适用于所有测试,包括功能测试)。

我搜索了他们的文档,但我没有找到任何关于本地“隧道”的确切内容。

我正在使用Gulp实习生,我的本地主机是localhost:3000,我想在Mac上测试我的Chrome 54。

谢谢


So i'm starting use Intern for functional tests, so far so good I did it all, unit and functional tests.

I followed their intern-tutorial

Whenever you need to run a full test against all platforms, use the test runner. When you are in the process of writing your tests and want to check them for correctness more quickly, you can either use just the Node.js client (for unit tests only) or create an alternate configuration file that only tests against a single local platform, like your local copy of Chrome or Firefox (for all tests, including functional tests).

I searched on their documentation, but I didn't find anything exactly about local "tunnels".

I'm using Intern with Gulp, my localhost is localhost:3000 and I want to test on my Chrome 54 on Mac.

Thank you


原文:https://stackoverflow.com/questions/40850257
更新时间:2023-12-29 08:12

最满意答案

首先,您应该有一个计划尽快远离ASIHTTPRequest。 它自2011年9月停产 。 如果你正在开始一个新项目,你现在应该切换到别的东西。 我建议AFNetworking ; 这里有一个介绍。

但是,如果您正在尝试维护较旧的项目,请继续阅读。

您在此处遇到的编译器错误是因为ASIHTTPRequest代码早于2011年引入的自动引用计数(ARC)。您可以在Apple的文档中阅读有关ARC转换的信息 。 使用ARC,编译器会在适当的位置插入等效的retainreleaseautorelease 。 不允许在代码中调用这些函数。

确实有将MRR代码迁移到ARC的工具,但是没有必要改变这个库。 只需在ASIHTTPRequest源的Compile Sources构建阶段设置-fno-objc-arc即可。 更多细节在这里

但是,如果您真的复活了2011年或更早的项目,那么您的整个项目很可能不是ARC准备好的。 在这种情况下,您可以为整个目标设置关闭ARC; 你可以在这里找到更多关于如何做到这一点的细节。

但是,如果你没有复活一个旧项目,你可能应该只使用AFNetworking。 它很现代,很活跃,而且很有效。


First, you should probably have a plan to get away from ASIHTTPRequest as soon as possible. It's been discontinued since September 2011. If you're starting a new project, you should just switch to something else now. I suggest AFNetworking; there's an introduction here.

If you're trying to maintain an older project, though, read on.

The compiler error you're hitting here is because the ASIHTTPRequest code predates Automatic Reference Counting (ARC), also introduced in 2011. You can read about the ARC transition in Apple's documentation. With ARC, the compiler inserts the equivalent of retain, release and autorelease where appropriate. Calling these functions in code is not allowed.

There are indeed tools to migrate MRR code to ARC, but there's no need to mutate this library. Just set -fno-objc-arc in the Compile Sources build phase for ASIHTTPRequest sources. More details here.

If you're really resurrecting a 2011 or earlier project, though, it's likely that your entire project is not ARC ready. In this case, you can turn off ARC for the entire in target settings; you can find more details on how to do that here.

Again, though, if you're not resurrecting an old project you should probably just use AFNetworking. It's modern, it's active, and it works.

相关问答

更多
  • 区别是微妙的,但您应该选择autorelease版本。 首先,你的代码更加可读。 其次,在检查优化的装配输出时, autorelease版本稍微更优化。 autorelease版本, - (NSString *)hello:(NSString *)name { return [NSString stringWithFormat:@"Hello, %@", name]; } 翻译成 "-[SGCAppDelegate hello:]": push {r7, lr} movw ...
  • 这是一个所有权问题。 让我们先谈谈你自己分配的NSString。 当你分配一个对象时,堆中的内存是为该对象保留的(除非你将allocWithZone:分配给另一个位置)。 保留计数隐含1,并且您拥有该对象,即您完成后负责释放它。 如果您要返回指向该对象的指针,即返回该对象,则不会完全放弃确保该对象不泄漏的责任。 你不能释放它,因为保留计数将变为0,并且该对象将被处理。 您可以自动释放它,确保在运行循环结束时(或更早),该对象将被释放并可能涉及。 如果返回的对象需要存活更长时间,调用函数负责保留返回的对象。 ...
  • NSString __weak *string; @autoreleasepool { string = [NSString stringWithFormat:@"%@", @"AAA"]; } NSLog(@"string: %@", string); 它输出如下你想要的。 string: (null) 从而, string = [NSString stringWithString:@"AAA"]; 与...相同 string = @"AAA"; 在堆中未分配的常量字符串文字。 ...
  • 自动释放池在ARC之前约15年。 Cocoa使用一个引用计数的内存管理方案,其中(概念上至少)对象是以引用计数1创建的, retain将其增加1并且release将计数减1,并且当计数达到时该对象被销毁0。 这个方案的一个问题是,它返回一个对象很尴尬,因为在你返回它之前你不能释放这个对象 - 如果你这样做了,它可能会在另一个方法使用它之前被销毁 - 不想要另一种方法来释放对象。 这是autorelease池的用武之地。一个autorelease池可以让你将一个对象交给它,并且它承诺在稍后为你释放对象。 在手 ...
  • 看起来你以前的代码没有使用ARC,现在你试图将它嵌入到使用ARC的代码中......使用“Edit-> Convert-> Convert to Object-C ARC”重构代码 Seems your previously working code did not use ARC, now you tried to embed it into code which uses ARC ... Refactor your code using "Edit->Convert->Convert to Object ...
  • 资料来源: https : //developer.apple.com/library/ios/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html 唯一的其他方法是: void object_setIvar(id object, Ivar ivar, id value); 您需要事先获得Ivar值,这可以通过class_getInstanceVariable(Class class, char* name) 。 总的 ...
  • 好吧,我找到了解决这个问题的方法...... 当您单击“转换为Objective-C ARC”时,它会弹出一个名为“选择要转换的目标”的菜单 您所要做的就是通过单击下拉箭头展开文件列表,然后取消选择所有AdWhirl文件。 XCode会将项目的其余部分转换为ARC,而不会在到达AdWhirl文件时遇到错误。 Alright, I've found the way around this... When you click "Convert to Objective-C ARC" it brings up a ...
  • 该工具不会为您删除它们,而只是在编译时根据需要添加保留/释放代码。 当你摆脱旧的引用计数代码时,这些问题可能会消失。 编辑:进一步说明: 在Xcode 4.2中,除了键入语法检查外,新的Apple LLVM编译器还可以将手动内存管理的负担卸载到编译器,内省代码以决定何时释放对象。 ARC的文档描述ARC如下: “自动引用计数(ARC)是一种编译器级功能,它简化了在Cocoa应用程序中管理对象生存期(内存管理)的过程。” 换句话说,ARC不会从你的代码中“剥离”引用计数,而是在它自己的引擎下进行引用计数。 您 ...
  • 首先,您应该有一个计划尽快远离ASIHTTPRequest。 它自2011年9月起停产 。 如果你正在开始一个新项目,你现在应该切换到别的东西。 我建议AFNetworking ; 这里有一个介绍。 但是,如果您正在尝试维护较旧的项目,请继续阅读。 您在此处遇到的编译器错误是因为ASIHTTPRequest代码早于2011年引入的自动引用计数(ARC)。您可以在Apple的文档中阅读有关ARC转换的信息 。 使用ARC,编译器会在适当的位置插入等效的retain , release和autorelease ...
  • Amin是对的 :对象不在自动释放池中。 创建该对象的alloc不会使用池。 另一方面,你是对的:ARC可能不会立即释放对象。 确实有一个注释可用于强制释放: objc_precise_lifetime 。 将该值添加到变量声明将导致ARC在对象在当前作用域中不再有效时立即发送release 。 然而,Amin也是对的,这不太可能是你想要的。 ARC知道它正在做什么 - 当你使用这个注释时它不能进行优化 - 除非你知道它在做什么,你应该强烈考虑让它做它的工作。 Amin is right: the obje ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)