Skip to content

Commit 4fe27b7

Browse files
committed
updating assertions
1 parent 45de569 commit 4fe27b7

File tree

11 files changed

+50
-50
lines changed

11 files changed

+50
-50
lines changed

fixtures/debug-flag/expectation7.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
if (true
2-
/* DEBUG */
3-
) {
1+
if (true/* DEBUG */) {
42
console.log('woot');
53
}

fixtures/development-svelte-builds/expectation7.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
export let PartialComponentManager;
22

3-
if (false
4-
/* DEPRECATED_PARTIALS */
5-
) {
3+
if (false/* DEPRECATED_PARTIALS */) {
64
PartialComponentManager = class {
75
constructor() {
86
this.isDone = true;
@@ -11,29 +9,21 @@ if (false
119
};
1210
}
1311

14-
if (false
15-
/* DEPRECATED_PARTIALS */
16-
&& someOtherThing()) {
12+
if (false/* DEPRECATED_PARTIALS */&& someOtherThing()) {
1713
doStuff();
1814
}
1915

20-
if (!false
21-
/* DEPRECATED_PARTIALS */
22-
&& someOtherThing()) {
16+
if (!false/* DEPRECATED_PARTIALS */&& someOtherThing()) {
2317
doStuff2();
2418
}
2519

26-
if (false
27-
/* DEPRECATED_PARTIALS */
28-
=== false && someOtherThing()) {
20+
if (false/* DEPRECATED_PARTIALS */=== false && someOtherThing()) {
2921
doStuff3();
3022
}
3123

3224
export let ObjectController;
3325

34-
if (true
35-
/* DEPRECATED_CONTROLLERS */
36-
) {
26+
if (true/* DEPRECATED_CONTROLLERS */) {
3727
ObjectController = class {
3828
constructor() {
3929
this.isDoneAsWell = true;

fixtures/ember-cli-babel-config-pre-3-27/expectation7.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
if (true
2-
/* DEBUG */
3-
) {
1+
if (true/* DEBUG */) {
42
doStuff();
53
}
64

fixtures/ember-cli-babel-config/expectation7.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { warn, assert, deprecate } from '@ember/debug';
22

3-
if (true
4-
/* DEBUG */
5-
) {
3+
if (true/* DEBUG */) {
64
doStuff();
75
}
86

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
let testing;
22

3-
if (false
4-
/* TESTING */
5-
) {
3+
if (false/* TESTING */) {
64
testing = 'WOOT';
75
}
86

97
let debug;
108

11-
if (true
12-
/* DEBUG */
13-
) {
9+
if (true/* DEBUG */) {
1410
debug = 'DEBUG';
1511
}
Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
let a;
22

3-
if (false
4-
/* FEATURE_A */
5-
) {
3+
if (false/* FEATURE_A */) {
64
a = () => console.log('hello');
7-
} else if (true
8-
/* FEATURE_B */
9-
) {
5+
} else if (true/* FEATURE_B */) {
106
a = () => console.log('bye');
117
}
128

13-
if (!false
14-
/* FEATURE_A */
15-
) {
9+
if (!false/* FEATURE_A */) {
1610
console.log('stuff');
1711
}
1812

19-
a = false
20-
/* FEATURE_A */
21-
? 'hello' : 'bye';
13+
a = false/* FEATURE_A */ ? 'hello' : 'bye';
2214

23-
if (false
24-
/* FEATURE_A */
25-
&& window.foo && window.bar) {
15+
if (false/* FEATURE_A */&& window.foo && window.bar) {
2616
console.log('wheeee');
2717
}

fixtures/runtime-feature-flags/expectation7.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { FEATURE_B } from '@ember/features';
22

3-
if (true
4-
/* FEATURE_A */
5-
) {
3+
if (true /* FEATURE_A */) {
64
console.log('woot');
75
}
86

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"babel-core": "^6.26.3",
4444
"babel-preset-env": "^1.7.0",
4545
"chai": "^5.1.0",
46+
"code-equality-assertions": "^0.9.0",
4647
"eslint": "^9.0.0",
4748
"eslint-config-prettier": "^9.1.0",
4849
"eslint-plugin-n": "^16.6.2",

pnpm-lock.yaml

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/create-tests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const DebugToolsPlugin = require('..');
44
const fs = require('fs');
55
const CONSOLE = Object.assign({}, console);
6+
require('code-equality-assertions/jest');
67

78
function createTests(options) {
89
const babelVersion = options.babelVersion;
@@ -483,7 +484,7 @@ function createTests(options) {
483484
`./fixtures/${fixtureName}/expectation${babelVersion}.js`,
484485
'utf-8'
485486
);
486-
expect(transform(sample, options).code).toEqual(expectation);
487+
expect(transform(sample, options).code).toEqualCode(expectation);
487488
});
488489
},
489490

0 commit comments

Comments
 (0)