Test javaScript code

#1

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

Dan

0 Likes

#2

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:

0 Likes

#3

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.

0 Likes

#4

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

0 Likes

#5

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

0 Likes

#6

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

1 Like

#7

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).

0 Likes