ptomato / jasmine-gjs

Jasmine for GJS
MIT License
20 stars 8 forks source link

bin: Fix exit code propagation #50

Closed tchx84 closed 6 months ago

tchx84 commented 7 months ago

Now that we're loading entrypoints as modules, exit codes no longer propagate in the same way. Therefore, we must do that explicitly through the system exit function.

Without this the exit code is always ZERO and in practical terms all CI pipelines depending on this are always passing even when the tests are actually failing.

See 7825a0c.

To reproduce:

  1. Build latest jasmine-gjs from master (c6aa28b).

  2. Use the following sample test.

describe('test', function() {

    it('fails', function() {
        expect('one').toEqual('two');
    });
});
  1. Run it:
$ jasmine --no-config --verbose --no-color sample.js
$ echo $?

With out this PR the exit code is always ZERO.

tchx84 commented 6 months ago

@ptomato I addressed your comments, plus removed some unnecessary function wrapping...