Is there a way to load JavaScript files from jars when running tests with js-test-driver? I'd like to find a solution that works both from command line and from Eclipse.
The reason I want to solve this is that I'm trying to do a gradle build and store artifacts on a repository. The artifacts (jars) contain Java as well as JavaScript files, and when running the JavaScript unit tests with js-test-driver, I have dependencies to JavaScript files inside the jars.
One solution is to unpack the jars and run js-test-driver normally. Is there a better solution without the unpacking?
Related
I've got two projects which I've created:
A web UI built using webpack
A Vert.x webserver written in java built using Gradle
I want to find a way to bring the resulting build dir contents of the first project into the second as the webroot which will be server up using the StaticHandler.
Is anyone aware of a clean way to do this? I want to preserve the two git projects as they are because I like using the webpack dev server for development of the UI and it generally feels cleaner to have them separated.
I was looking at potentially using the bitbucket pipelines build on my repo, however bringing the assets generated by the first project into the build of the second is where I'm facing issues.
You could create a gradle task that before that depends on the jar task (so it runs before it) executes webpack compile into the resources directory. So when your jar task runs it bundles the compiled webpack code.
I am using Webstorm a start a angularjs project. I've created a lot of *.js files. I have the include them using the tag one by one in the html files. whenever I created a new js file, I have to create the script tag.
The things I needed is just like gulp-concat, but without minifying. minified code are hard to debug.
Can anyone help on this? Thanks!
WebStorm doesn't have any built-in functions for combining files... But there are plenty of different tools on the web - plus you can create your own batch files for this.
I can suggest using Grunt grunt-contrib-concat task (https://github.com/gruntjs/grunt-contrib-concat). It supports merging files. You can run the task using Node.js run configuration, or configure it as a file watcher, or use Grunt console.
Browserify (http://browserify.org/) is one more way to go - it allows using commonjs-style syntax when developing front-end applications, combining the files into a single file for production
Or, try Webpack (https://webpack.github.io/) - it's a modern powerful module bundler
In short:
How can I build and deploy using TeamCity multiple versions of jQuery?
Long way:
existing info:
Two files from jQuery (jquery-2.1.1.js and jquery-2.1.3.js) are checked into the source control (TFS) in absolutely same 100% way (Build Action -> "Context"). In parallel, in the same directory, all identical.
Local Build and deploy using MSStudio 12 works without any issues copying at the end of the build both files into Scripts directory
when it runs from TeamCity, it fails to find the relevant "meant to be copied" files and comes back with the following error:
"C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(608,
5): Copying file Scripts\jquery-2.1.3.js to
obj\Debug\AspnetCompileMerge\Source\Scripts\jquery-2.1.3.js failed.
Could not find file 'Scripts\jquery-2.1.3.js'"
Would someone help me to understand what is going on?
Now I make my protractor to work. Then I have another question: How to package the spec files and all the dependencies into one file, such as rpm or other format, so I can easily install it on another machine to run it? I searched the Internet and found some tools to package the javascript and CSS and images used in web page. But in my case, I only need to package the javascript I write to do the testing to one file.
I appreciate any suggestions.
The short answer is that's not possible.
When you run protractor on a fresh machine you need to have
an instance of selenium-webdriver server running (with all the browsers you want to test)
nodejs
But, assuming that the new computer you run protractor in has nodejs and selenium-webdriver is set up (i.e. either the local computer has it running, or you're testing over network like using saucelabs), then I guess you can zip up the file to send as one file.
When running Eclipse Kepler and importing an existing Maven project, Eclipse hangs during "Building Workspace (XX%)". Switching to the Progress tab reveals a "Validating nnn"; it looks like it’s validating a directory containing JavaScript files.
Kill Eclipse process.
Go to project folder and edit .project file.
Remove the following lines (it will disable failing JavaScript validator):
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
Save file.
Re-open Eclipse.
I faced the same problem when I tried to install Angular.js with bower in my project. I seems bower has lots of javascript files it downloaded automatically which caused my IDE to stuck in validation process for a long time. So, I solved this problem this way,
I first installed tern.js 0.9.0.
Then I went to the project properties, selected tern script path
included only the path I needed for validation, My project's
javascript folder. I excluded other path like placeholders,
Angular.js files, Jquery files.
I selected the Javascript from the properties again and did the same
things in include path's source.
My IDE currently working without freezing. I took help from there. Tern
I guess it can be helpful, where any IDE stuck due to lots of Javascript file.