Browserless, ant-task-oriented Javascript Unit Testing? [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a javascript unit test framework that I can use as part of my automated maven build. This CANNOT use an actual browser, and it MUST be fully browserless.
I've tried looking at a few posts on SO, but none seem to meet my needs. Is there such a javascript unit tester? I'm anxious to find out.

I was trying to solve the same problem. It seems, that this is not as common, as one might think from our perspective.
RhinoUnit looks very good.
If you need browser capabilities within Rhino, take a look at
http://ejohn.org/blog/bringing-the-browser-to-the-server/
http://groups.google.com/group/envjs
http://github.com/thatcher/env-js/tree/master

There are two projects called JSUnit (www.jsunit.net) and (jsunit.berlios.de). The latter is designed to work with Rhino and Maven. Note that there will be browser-specific problems that such tests will not discover, but it should help with basic functionality.

Not sure about a JavaScript unit testing framework, though I'm sure there is one. But I would probably look towards Rhino as JS interpreter.
http://www.mozilla.org/rhino/
If your JS references any of the browser/DOM you'll also need to mock/stub those...

Have you tried JSunit?

AFAIK, javascript is a language specifically designed to run in the browser.
Have you considereds j-unit tests? They do still run in the browser however.

Related

Is there a tool, program, extension to prevent and find code repetition in a project? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I've been looking for a VS Code / Git extension, add-on or anything that can help me prevent but to also identify code that is already repeated so I can abstract it away and reuse it.
You know, maybe even build a library for the darn app but I haven't found anything useful and fresh yet.
There is, but it is not free. WebStorm IDE or any there JetBrains IDE show code repetition and also give you a very good insight into your code. you can try it for free for 30 days and if you liked it then buy it.
WebStorm - The smartest JavaScript IDE
Sonarlint is one of the best tool. It says code duplications and makes sure the code is good shape based on the best practices. You can also add that as a plugin in the VS Code.
SonarCube is the actual product you are looking for, it provide lot more than code duplication details.
Sonar Cube will do following things for you
Code Quality Check, it actually analyses your entire code and provides you information about Bugs and vulnerabilities
it also provides you code coverage on new-code which get pushed
it provides you information and graphs about code coverage, bugs etc.
it provides you information about code duplication

How To Obfuscate Javascript to Unreadable, but Valid [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm soon releasing my paid Electron application.
I have worked for many months on it now, and i need protection on my source code.
i have 2 files, 1. file 5000 lines, and 2. file around 4000 lines.
I need very good obfuscation on this, so it can't be read, and cant be cracked easily.
I'm willing to pay a little bit for a good obfuscator, if anyone knows any good ones that isn't free.
I have tried some different online javascript obfuscators, and most isn't very good, and is easily to read afterwards.
Thank you.
The short and sweet is: what you're looking for does not exist.
At its core, electron is very little but a repackaged webview executing javascript/html/css. The moment you execute your application, the said webview has to have full, concurrent access to the files required by it.
This means your code is there, open, unencrypted, and the only defense you have against somebody peeking is obfuscation. Which, let's admit one thing, falls short pretty quickly when the person digging into the code knows javascript.
If you were using a framework for your app that allowed purely native code, you could write a DRM-esque toolchain for it, but sadly, that's not even an option. Beyond uglifying your code and moving as much of it towards WASM as possible, there's no real other option, just compromises and trade-offs.

How to Remove Unused javascript From Website [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I'm trying to speed up my website. I used www.unused-css.com/ to trim away excess CSS, but I cannot find anything similar for JavaScript. Is there an online service that can detect the js code being used and then trim away the unused code?
Here is the website with the problem: IQ Tests for Kids
I'm using bootstrap code and it is very bloated. I'm sure that I'm only using a fraction of js because I trimmed down my HTML as well.
The best you are going to get is running the JavaScript itself through a dead code removal process, such as the one provided by the Google Closure Compiler with ADVANCED_OPTIMIZATIONS enabled or Uglify's dead_code option. Some people even combine both of these.
Tree shaking is an even better process you will hear people talk about. But this is more difficult to achieve in your case, because tree shaking involves using ES6 modules, which the code you are dealing with almost certainly is not. Thus it would be a lot of work to get that going, as you would have to modify the code.
Don't know any online tool for that, but there are techniques to do what is called "tree shaking". You can google about it more.
Best my used tools to have it working are webpack and Flow
Webpack is quite general tool to make all kind of magic with JS, while Flow is type checking tool which, if you have type checking active can provide very good tree shaking.
But as you mentioned, you are using Bootstrap, so best place to start looking at would be customize your build:
http://getbootstrap.com/customize/

ipython equivalent for javascript/coffeescript for node.js? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
More specifically, is there a REPL that has (more) colorful output, pretty printing, tab completion and the other goodies that ipython has for node.js javascript/coffeescript?
I've recently started a project to provide an enhanced, extensible, embeddable interactive interpreter for multiple languages running on Node (including built-in support for CoffeeScript) here:
http://danielgtaylor.github.com/nesh/
It's pretty basic at the moment but it already provides a nice base with multi-language support and an asynchronous plugin architecture, a small set of built-in utility functions, etc. Let me know if there are any specific features you are looking for :-)
To my knowledge, node and coffee are the only full-featured command-line REPLs for Node.js and CoffeeScript (respectively) right now. In their latest iterations, both offer some degree of colorful output, pretty printing, and completion.
This is the best REPL available - https://github.com/princejwesley/Mancy
Ankit, I was looking for exactly the same answer and ended up implementing it, perhaps it could be helpful for you as well: https://github.com/mksenzov/i.js
Have you tried the console in Chrome Dev Tools?
or this one: http://jsconsole.com/
Ok so for input commands history you can use this:
http://blog.doteight.com/blog/2011/01/16/rlwrap-and-node/
but this way the tab completion doesn't work...
anyone know how to call node interpreter with
tab autocomletion turned on?

Looking for a Javascript unit testing framework [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
What do you recommend as the best and most documented Unit Test Framework for Javascript?
Jasmine is a BDD testing framework for javascript that works client-side or server-side. It works well in Rails, Node, Maven, etc. There's also a lot of plugins for things like jQuery.
Jquery team is using its Qunit for client side testing . It has a potential.
Check out this post. JSUnit is probably very effective, but I've found that Firebug now has an extension called FireUnit.
JSUnit is fairly useful, though it's been discontinued.
There are a whole bunch of modules found on the npm if you search for "unit test".
There is also the CommonJS testing specification.
I've written implementations of them which are on github. But I wouldn't call them production ready. There reasonably stable.
Very young, but still nicely functioning framework - bob.js.

Categories

Resources