Skip to content

Commit

Permalink
Set RAISE_ON_DEPRECATION to false when EXTEND_PROTOTYPES is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed Jun 5, 2024
1 parent 1e686b7 commit 09dc249
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
working-directory: smoke-tests/scenarios
run: |
matrix_json=$(pnpm scenario-tester list --require @swc-node/register --files "*-test.ts" --matrix "pnpm run test --filter %s" )
echo "matrix=$matrix_json" >> $GITHUB_OUTPUT
echo "matrix=$matrix_json" >> $GITHUB_OUTPUT
types:
name: Type Checking (current version)
Expand Down Expand Up @@ -105,9 +105,11 @@ jobs:
ENABLE_OPTIONAL_FEATURES: "true"
- name: "Extend prototypes"
EXTEND_PROTOTYPES: "true"
RAISE_ON_DEPRECATION: "false"
- name: "Extend prototypes, with optional features"
EXTEND_PROTOTYPES: "true"
ENABLE_OPTIONAL_FEATURES: "true"
RAISE_ON_DEPRECATION: "false"

steps:
- uses: actions/checkout@v3
Expand All @@ -120,6 +122,7 @@ jobs:
OVERRIDE_DEPRECATION_VERSION: ${{ matrix.OVERRIDE_DEPRECATION_VERSION }}
EXTEND_PROTOTYPES: ${{ matrix.EXTEND_PROTOTYPES }}
ENABLE_OPTIONAL_FEATURES: ${{ matrix.ENABLE_OPTIONAL_FEATURES }}
RAISE_ON_DEPRECATION: ${{ matrix.RAISE_ON_DEPRECATION }}

run: pnpm test

Expand Down
7 changes: 5 additions & 2 deletions bin/run-tests.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable no-console */
'use strict';

/*
/*
Test Variants
These are all accepted as environment variables when running `ember test` or
as query params when directly invoking the test suite in the browser.
as query params when directly invoking the test suite in the browser.
*/
const variants = [
// When true, even deprecations that are not yet at the "enabled" version will
Expand All @@ -25,6 +25,9 @@ const variants = [
// This enables all canary feature flags for unreleased feature within Ember
// itself.
'ENABLE_OPTIONAL_FEATURES',

// Throw on unexpected deprecations. Defaults to true if not set explicitly.
'RAISE_ON_DEPRECATION',
];

const chalk = require('chalk');
Expand Down
14 changes: 8 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@
EmberENV.ENABLE_OPTIONAL_FEATURES = true;
}

EmberENV['RAISE_ON_DEPRECATION'] = true;
EmberENV['RAISE_ON_DEPRECATION'] = QUnit.urlParams.RAISE_ON_DEPRECATION
? QUnit.urlParams.RAISE_ON_DEPRECATION === 'true'
: true;

if (QUnit.urlParams.ALL_DEPRECATIONS_ENABLED) {
EmberENV['_ALL_DEPRECATIONS_ENABLED'] = true;
}
EmberENV['_ALL_DEPRECATIONS_ENABLED'] = true;
}

if (QUnit.urlParams.OVERRIDE_DEPRECATION_VERSION) {
EmberENV['_OVERRIDE_DEPRECATION_VERSION'] = QUnit.urlParams.OVERRIDE_DEPRECATION_VERSION;
}
if (QUnit.urlParams.OVERRIDE_DEPRECATION_VERSION) {
EmberENV['_OVERRIDE_DEPRECATION_VERSION'] = QUnit.urlParams.OVERRIDE_DEPRECATION_VERSION;
}
</script>

<script type="module">
Expand Down

0 comments on commit 09dc249

Please sign in to comment.