Skip to content

Commit 6e1c963

Browse files
committed
expect prototype extension deprecation in tests
1 parent 591be24 commit 6e1c963

File tree

7 files changed

+21
-7
lines changed

7 files changed

+21
-7
lines changed

packages/@ember/string/tests/camelize_test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
55
function test(assert, given, expected, description) {
66
assert.deepEqual(camelize(given), expected, description);
77
if (ENV.EXTEND_PROTOTYPES.String) {
8-
assert.deepEqual(given.camelize(), expected, description);
8+
expectDeprecation(() => {
9+
assert.deepEqual(given.camelize(), expected, description);
10+
}, /String prototype extensions are deprecated/);
911
}
1012
}
1113

packages/@ember/string/tests/capitalize_test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
55
function test(assert, given, expected, description) {
66
assert.deepEqual(capitalize(given), expected, description);
77
if (ENV.EXTEND_PROTOTYPES.String) {
8-
assert.deepEqual(given.capitalize(), expected, description);
8+
expectDeprecation(() => {
9+
assert.deepEqual(given.capitalize(), expected, description);
10+
}, /String prototype extensions are deprecated/);
911
}
1012
}
1113

packages/@ember/string/tests/classify_test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
55
function test(assert, given, expected, description) {
66
assert.deepEqual(classify(given), expected, description);
77
if (ENV.EXTEND_PROTOTYPES.String) {
8-
assert.deepEqual(given.classify(), expected, description);
8+
expectDeprecation(() => {
9+
assert.deepEqual(given.classify(), expected, description);
10+
}, /String prototype extensions are deprecated/);
911
}
1012
}
1113

packages/@ember/string/tests/dasherize_test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
55
function test(assert, given, expected, description) {
66
assert.deepEqual(dasherize(given), expected, description);
77
if (ENV.EXTEND_PROTOTYPES.String) {
8-
assert.deepEqual(given.dasherize(), expected, description);
8+
expectDeprecation(() => {
9+
assert.deepEqual(given.dasherize(), expected, description);
10+
}, /String prototype extensions are deprecated/);
911
}
1012
}
1113

packages/@ember/string/tests/decamelize_test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
55
function test(assert, given, expected, description) {
66
assert.deepEqual(decamelize(given), expected, description);
77
if (ENV.EXTEND_PROTOTYPES.String) {
8-
assert.deepEqual(given.decamelize(), expected, description);
8+
expectDeprecation(() => {
9+
assert.deepEqual(given.decamelize(), expected, description);
10+
}, /String prototype extensions are deprecated/);
911
}
1012
}
1113

packages/@ember/string/tests/underscore_test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
55
function test(assert, given, expected, description) {
66
assert.deepEqual(underscore(given), expected, description);
77
if (ENV.EXTEND_PROTOTYPES.String) {
8-
assert.deepEqual(given.underscore(), expected, description);
8+
expectDeprecation(() => {
9+
assert.deepEqual(given.underscore(), expected, description);
10+
}, /String prototype extensions are deprecated/);
911
}
1012
}
1113

packages/@ember/string/tests/w_test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { moduleFor, AbstractTestCase } from 'internal-test-helpers';
55
function test(assert, given, expected, description) {
66
assert.deepEqual(w(given), expected, description);
77
if (ENV.EXTEND_PROTOTYPES.String) {
8-
assert.deepEqual(given.w(), expected, description);
8+
expectDeprecation(() => {
9+
assert.deepEqual(given.w(), expected, description);
10+
}, /String prototype extensions are deprecated/);
911
}
1012
}
1113

0 commit comments

Comments
 (0)