Skip to content

Commit

Permalink
Setup IE11 CI as targets still include IE11
Browse files Browse the repository at this point in the history
  • Loading branch information
raido committed Nov 25, 2021
1 parent 1925abf commit 60a9131
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ jobs:
- name: Lint
run: yarn lint

build-windows:
runs-on: windows-latest
needs: lint
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
browser: [
'ie'
]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: volta-cli/action@v1
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test
run: yarn test:ember --launch ${{ matrix.browser }}

test:
name: Tests
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 2 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module.exports = function (defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

app.import({ test: 'vendor/ie11-promise.js' });

const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app, {
skipBabel: [
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/services/window-messenger-events-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { settled } from '@ember/test-helpers';

module('Unit | Service | window messenger events', function (hooks) {
setupTest(hooks);
Expand All @@ -23,6 +24,8 @@ module('Unit | Service | window messenger events', function (hooks) {
// send first message
window.postMessage(message, '*');

await settled();

// send second message
window.postMessage(message, '*');
});
Expand All @@ -43,5 +46,6 @@ module('Unit | Service | window messenger events', function (hooks) {
});

window.postMessage(message, 'http://localhost:9999');
await settled();
});
});
11 changes: 6 additions & 5 deletions tests/unit/services/window-messenger-server-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ module('Unit | Service | window messenger server', function (hooks) {
let server = this.owner.lookup('service:window-messenger-server');
let client = this.owner.lookup('service:window-messenger-client');

server.on('client-request', (/*resolve, reject, query*/) => {
server.on('client-request', (resolve /*, reject, query*/) => {
assert.ok(true);
resolve();
});
client.fetch('client-request');
await client.fetch('client-request');
});

test("it should not receive client's request if not a match", async function (assert) {
Expand All @@ -35,9 +36,10 @@ module('Unit | Service | window messenger server', function (hooks) {

server.on('client-request', (resolve, reject, query) => {
assert.equal(query.id, 1, 'it should have got query parameters');
resolve();
});

client.fetch('client-request', {
await client.fetch('client-request', {
id: 1,
});
});
Expand All @@ -50,9 +52,8 @@ module('Unit | Service | window messenger server', function (hooks) {
server.on('client-request', () => {
assert.ok(true);
});

server.destroy();
client.fetch('client-request');
server.destroy();
await settled();
});
});
2 changes: 2 additions & 0 deletions vendor/ie11-promise.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// https://github.com/babel/ember-cli-babel/issues/250
self.Promise = self.Promise || Ember.RSVP.Promise;

0 comments on commit 60a9131

Please sign in to comment.