Hi, I tried to run some unit tests on TestUp, but I’m getting a JavaScript error which seems to be related to Minitest.
It doesn’t seem like I can successfully run any tests. Also, in the TestUp dialog, the cursor has a spinning wheel icon even after I run the tests. Does anyone know how I can fix this issue?
I prefer using Minitest from a command prompt, with test selection based on folder/file names.
Hence, I’ve got a Git repo SUMT. I don’t recall whether they’re still “sync’d”, but docs for it are here. The page linked is the ReadMe, which should give you a good idea of how SUMT works…
I have IE version: 11.0.9600.18762 on Windows, and I am trying to run assert_equal tests.
Snippet ruby code inside a test function:
line.description = “Test”
assert_equal(“Test”, line.description)
Correct me if I’m wrong, but I thought the above code would pass. The TestUp dialog doesn’t indicate that anything passed though (after clicking the Run button).
The results shown in the console indicate that you have one test method containing 13 assertion statements, and there were no failures, errors, or skips. IOW, the code passed.
@tt_su is the person to ask about the TestUp-2 UI.
Also, I’ve added a failure message in assert_equal, but the message doesn’t seem to appear / I can’t find it anywhere after running a failed test. Is this normal behavior?
FWIW, I wouldn’t call that a mistake. Maybe you’re new to testing, but we’re all new to everything once, and we all forget…
Have you checked the log files? The file name is listed in the console output. I can’t recall where TestUp-2 puts the various Minitest data, as TestUp-2 outputs to the console, the Dialog, and the log file…
Background
I maintain a GitHub.io site with doc’s for Ruby, several gems, and the SketchUp API. A reference of assertions in the current Minitest gem is here.
TestUp-2 uses Minitest for the test framework, but adds a GUI using a WebDialog for test selection and reporting. It was writtten by @ThomThom / @tt_su
Most of the testing I have worked with is run in stand-alone Ruby, so I’m used to running tests with the Rake task or Bundler (which normally uses the Rake task). That’s why I wrote SUMT, as it mimics much of the syntax used for running Minitest in a Ruby console setting. Also, for large test suites, I found TestUp-2 got in my way, but most plugins won’t require that many tests.
Anyway, because of that, using TestUp-2 isn’t quite fresh in my mind…
This must relate to the JavaScript errors you are seeing. Can you upload a complete testcase file that reproduce this? I’ve not seen that error before.
(Also, have you tried running the default TestUp tests?)
I don’t remember seeing the default TestUp tests, where can I find them? (Unless you’re referring to the paths initially listed in ‘Test suite paths’ in ‘Preferences’, those paths did not exist for me.)
I tried the file on my machine (Win10 IE11), worked fine:
If you are not using latest from GitHub, can you try that? If that also fails then it sounds like something is wrong with your IE. (I’ve had extension users with problems with IE needing to be repaired before.)
Alright, I cloned the latest version from GitHub, then added it to my SU plugin loader script (instead of installing as an RBZ). When I opened up SketchUp, I got this: