Skip to content

Commit

Permalink
Merge pull request #19316 from emberjs/make-deprecations-enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue authored Dec 18, 2020
2 parents 9565b33 + 7cfa6a2 commit ae936ad
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion packages/@ember/-internals/utils/lib/invoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function tryInvoke(
until: '4.0.0',
for: 'ember-source',
since: {
available: '3.24.0',
enabled: '3.24.0',
},
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-utils-try-invoke',
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@ember/debug/lib/deprecate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ if (DEBUG) {
until: '4.0.0',
for: 'ember-source',
since: {
available: '3.24.0',
enabled: '3.24.0',
},
});
}
Expand All @@ -226,7 +226,7 @@ if (DEBUG) {
until: '4.0.0',
for: 'ember-source',
since: {
available: '3.24.0',
enabled: '3.24.0',
},
});
}
Expand Down
29 changes: 14 additions & 15 deletions packages/@ember/debug/tests/main_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ moduleFor(
id: 'test',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
});
assert.ok(true, 'deprecate did not throw');
} catch (e) {
Expand All @@ -86,7 +86,7 @@ moduleFor(
id: 'test',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
});
assert.ok(true, 'deprecate did not throw');
} catch (e) {
Expand All @@ -100,7 +100,7 @@ moduleFor(
id: 'test',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
});
}, /Should throw/);
}
Expand All @@ -122,7 +122,7 @@ moduleFor(
id: 'my-deprecation',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
});
assert.ok(true, 'Did not throw when level is set by id');
} catch (e) {
Expand All @@ -134,7 +134,7 @@ moduleFor(
id: 'test',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
});
}, /Should throw with no matching id/);

Expand All @@ -143,7 +143,7 @@ moduleFor(
id: 'other-id',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
});
}, /Should throw with non-matching id/);
}
Expand All @@ -156,23 +156,23 @@ moduleFor(
id: 'test',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
})
);
assert.throws(() =>
deprecate('Deprecation is thrown', '', {
id: 'test',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
})
);
assert.throws(() =>
deprecate('Deprecation is thrown', 0, {
id: 'test',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
})
);
}
Expand All @@ -185,7 +185,7 @@ moduleFor(
function () {
assert.ok(false, 'this function should not be invoked');
},
{ id: 'test', until: 'forever', for: 'me', since: { available: '1.0.0' } }
{ id: 'test', until: 'forever', for: 'me', since: { enabled: '1.0.0' } }
);

assert.ok(true, 'deprecations were not thrown');
Expand All @@ -198,19 +198,19 @@ moduleFor(
id: 'test',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
});
deprecate('Deprecation is thrown', '1', {
id: 'test',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
});
deprecate('Deprecation is thrown', 1, {
id: 'test',
until: 'forever',
for: 'me',
since: { available: '1.0.0' },
since: { enabled: '1.0.0' },
});

assert.ok(true, 'deprecations were not thrown');
Expand Down Expand Up @@ -311,8 +311,7 @@ moduleFor(
assert.expect(1);

assert.throws(
() =>
deprecate('foo', false, { until: 'forever', for: 'me', since: { available: '1.0.0' } }),
() => deprecate('foo', false, { until: 'forever', for: 'me', since: { enabled: '1.0.0' } }),
new RegExp(missingOptionsIdDeprecation),
'proper assertion is triggered when options.id is missing'
);
Expand Down
4 changes: 2 additions & 2 deletions packages/@ember/string/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function loc(str: string, formats: any[]): string {
for: 'ember-source',
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-string-loc',
since: {
available: '3.24',
enabled: '3.24',
},
}
);
Expand Down Expand Up @@ -305,7 +305,7 @@ if (ENV.EXTEND_PROTOTYPES.String) {
id: 'ember-string.prototype-extensions',
for: 'ember-source',
since: {
available: '3.24',
enabled: '3.24',
},
until: '4.0.0',
url: 'https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions',
Expand Down

0 comments on commit ae936ad

Please sign in to comment.