Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,33 @@ let app = new EmberAddon(defaults, {
});
```

config/environment.js:
```js
APP: {
// ...
isRunningWithServerArgs: process.argv.includes('--server') || process.argv.includes('-s')
}
```

tests/test-helpers.js:
```js
import { forceModulesToBeLoaded, sendCoverage } from 'ember-cli-code-coverage/test-support';
import Qunit from 'qunit';

QUnit.done(async function() {
forceModulesToBeLoaded();
await sendCoverage();
});
if (config.APP.isRunningWithServerArgs) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The README would also need to indicate where to set this

Copy link
Author

@cah-john-ryan cah-john-ryan Sep 5, 2024

Choose a reason for hiding this comment

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

Hi Kate, thanks for catching that. I have added another section above test-helpers.js in the README to callout the config setting being leveraged.

I am not sure I agree with the existing format for the file edits and how easy it is to identify the changes a user would need to apply. If you have any suggestions on further changes let me know and I will be happy to try and apply them.

// until Testem is patched, this will fail to POST coverage in CI mode (running tests with -s or --server as an argument)
// Ref: https://github.com/testem/testem/issues/1577
QUnit.done(async function () {
forceModulesToBeLoaded();
await sendCoverage();
});
} else {
//eslint-disable-next-line no-undef
Testem.afterTests(function (config, data, callback) {
forceModulesToBeLoaded();
sendCoverage(callback);
});
}
```

## Usage
Expand Down