Test javaScript code

Hi All

I’m a web development student and still new to the subject. I’ve been asked to ‘Test javaScript code which I’ve written, and to test in multiple display platforms’. I’m not sure how to do this. Is there any tutorials that will guild me through this process. I’m looked online and I can’t find anything specific for this topic.

Best wishes


Testing is quite a large and extensive subject. There are various kinds of test and it very much depends on what you are wanting to test, as to which kind of methodology you will use.

One of the more popular JS testing frameworks out there is Jest. That might be a good starting point for you.

I just pulled this tutorial off Google. It seems decent:

I suspect that the teacher means that you should try running your code on a computer, on a tablet, and on a cellphone or two to see how they differ.

How do you mean? JavaScript shouldn’t differ much between running it on a PC, tablet and Smartphone.

Well, that’s what I interpret from “test in multiple display platforms”

Fair enough. Let’s wait for the OP to elaborate.

1 Like

In theory, yes. But since JavaScript depends on the host environment (aka browser) and you have different browsers for each platform, you end up with differences (for a glimpse of that have a look at http://caniuse.com).

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.