简体   繁体   English

将JavaScript单元测试文件放在Web应用程序中的位置

[英]Where to place JavaScript unit test files in a web application

I am working on one component (which is a web application - struts - that is deployed as a WAR), and I developed some new Javascript for which I wrote some QUnit testing. 我正在研究一个组件(这是一个Web应用程序 - struts - 部署为WAR),我开发了一些新的Javascript,我为此编写了一些QUnit测试。 I do not know where I need to place the files that go with my QUnit (qunit.js, qunit.ccs, myTestClass.js, and the hmtl page), so that they are not packaged and deployed in the production artifact. 我不知道在哪里需要放置与我的QUnit(qunit.js,qunit.ccs,myTestClass.js和hmtl页面)一起使用的文件,以便它们不会打包并部署在生产工件中。

For example, all the java unit test goes into a test folder. 例如,所有java单元测试都进入测试文件夹。 But the html/jsp/js files need to be somewhere in the webapp folder. 但是html / jsp / js文件需要位于webapp文件夹中的某个位置。

Thanks! 谢谢!

I ran into the same problem, I placed them on directory outside of the webapp and created a .html that calls loads the actual js library using a relative path. 我遇到了同样的问题,我将它们放在webapp之外的目录中并创建了一个.html,它使用相对路径调用加载实际的js库。 I don't think people have a standard location for this question as of yet. 我不认为人们对此问题有一个标准的位置。

I am using IntelliJ Idea so its easy to define a folder outside of the webapp that does not go in the final war. 我正在使用IntelliJ Idea,因此很容易定义webapp之外的文件夹,而不是最后的战争。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JavaScript单元测试:保存测试/规格文件的位置(客户端和节点) - JavaScript unit tests: where to keep test/specs files (Client and Node) 在 javascript 中对 Web 套接字进行单元测试 - unit test for web socket in javascript 如何在我的 javascript Z2567A5EC93305EB18AC2DZ9 应用程序的数据库层中为 class function 开玩笑地编写单元测试? - How do I write a unit test in jest for a class function in the database layer of my javascript web application? 如何对Web套接字进行单元测试 - JavaScript - How to unit test web sockets - JavaScript 在我的 django 应用程序中对 javascript 函数进行单元测试 - unit test the javascript functions in my django application 如何对动态加载JavaScript文件的JavaScript代码进行单元测试? - How to unit test javascript code that dynamically loads javascript files? 自定义js文件的放置位置以及如何在Angular 4应用程序中引用它们 - Where to place custom js files and how to reference them in Angular 4 application iOS 8 JavaScriptCore:您将JavaScript文件放在哪里? - iOS 8 JavaScriptCore: Where do you place your JavaScript files at? Javascript / AngularJS应用的声纳报告显示零单元测试成功 - sonar report of Javascript/AngularJS application showing zero unit test success SonarQube单元测试报告不显示Javascript文件 - SonarQube unit test report doesnt show Javascript files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM