nus-cs2113-AY1920S2 / forum

4 stars 0 forks source link

Unable to run JUnit tests #67

Closed brandoncjh closed 4 years ago

brandoncjh commented 4 years ago

I am having issues with trying to build and run the JUnit tests. For example, using the default tests provided, the test classes encounter an error when trying to build the module, IntelliJ is unable to import the Assertions class: capture1 After adding the recommended library to the classpath: Screenshot (36) I can build the module, but trying to run all tests it gives this error: capture2 Is there any way to rectify this? Have tried deleting and reimporting the project but it makes no difference.

damithc commented 4 years ago

After importing the project, are you able to run the gradlew test successfully? That task runs the default JUnit test as well.

brandoncjh commented 4 years ago

Yes, it says build successful. capture1

damithc commented 4 years ago

That means you can use that method to run your JUnit tests if other methods don't work.

In the meantime, try clicking the 'refresh' icon in the Gradle windows to see if that helps with the other problem. image

brandoncjh commented 4 years ago

After uninstalling and reinstalling IntelliJ, it seems I can run the tests now. Very weird: capture2

Thank you for the help Prof!