Skip to content

Enable Robolectric tests in WordPress module#5836

Merged
aforcier merged 3 commits intodevelopfrom
feature/enable-robolectric
May 4, 2017
Merged

Enable Robolectric tests in WordPress module#5836
aforcier merged 3 commits intodevelopfrom
feature/enable-robolectric

Conversation

@hypest
Copy link
Copy Markdown
Contributor

@hypest hypest commented May 4, 2017

Adds basic support for Robolectric (JVM) tests.

It also sets up Travis to automatically run these tests.

To test:

  • In AndroidStudio, open the RobolectricSetupTest.java file, right-click on the class name and select Run 'RobolectricSetupTest'. Make sure the run configuration's working directory is set to $MODULE_DIR$ and the VM options to -ea
  • The test (appNameTest) should run and succeed

@hypest hypest requested a review from aforcier May 4, 2017 12:22
@aforcier aforcier self-assigned this May 4, 2017
@aforcier
Copy link
Copy Markdown
Contributor

aforcier commented May 4, 2017

Looks great @hypest. Verified that Travis is running the tests by intentionally breaking your demo test in a separate branch.

:shipit: 👏

@aforcier aforcier merged commit 1fe2c36 into develop May 4, 2017
@aforcier aforcier deleted the feature/enable-robolectric branch May 4, 2017 14:03
// and the VM options to `-ea`
Assert.assertEquals("WordPress for Android", RuntimeEnvironment.application.getString(R.string.app_title));
}
} No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NL @ EOF.

@catehstn
Copy link
Copy Markdown
Contributor

catehstn commented May 8, 2017

Yay super happy to see this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants