apache / cordova-paramedic

Apache Cordova - Paramedic
https://cordova.apache.org/
Apache License 2.0
36 stars 53 forks source link

ADDITIONAL_TESTS_DIR (to replace TEST_DIR) #143

Closed janpio closed 5 years ago

janpio commented 5 years ago

Before, some plugins had something like this:

  - env: TEST_DIR=.
    language: objective-c
  - env: TEST_DIR=./tests/ios
    language: objective-c

which was run via

  - if [[ "$TEST_DIR" != "" ]]; then
      cd $TEST_DIR;
      npm install;
      npm test;
    else
      cordova-paramedic --config pr/$PLATFORM --plugin . --shouldUseSauce --buildName travis-plugin-camera-$TRAVIS_JOB_NUMBER;
   fi

the if [[ "$TEST_DIR" != "" ]]; then was not part of the paramedic config, so got overlooked when cleaning up the travis.yml that then got copied over to plugins. When adding the env back to the plugin travis.yml config, it failed (see #141).


As this is an important feature for 2 plugins, it has to be reinstated:


This PR ads ADDITIONAL_TESTS and recreates the if/else that was there before. It also adds a pseudo test to /spec/testable-plugin/tests/foo so that this can be tested on paramedic itself as well.

closes #141