Skip to content

Commit 908c67d

Browse files
committed
Migration: js() to addJs() tests added
1 parent f869eff commit 908c67d

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
block('test').js()(function() {
2+
// TODO: ololo
3+
var js = this.ctx.js;
4+
5+
js = { data: 'lol' };
6+
7+
return js;
8+
});
9+
10+
block('test').js()(true);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
block('test').addJs()(function() {
2+
// TODO: ololo
3+
var js = this.ctx.js;
4+
5+
js = { data: 'lol' };
6+
7+
return js;
8+
});
9+
10+
block('test').addJs()(true);

migration/lib/transformers/__testfixtures__/8-js-to-addjs-1.input.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ block('b')(
55

66
content()('test')
77
);
8+
9+
block('b')(
10+
js()(true),
11+
12+
content()('test')
13+
);

migration/lib/transformers/__testfixtures__/8-js-to-addjs-1.output.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ block('b')(
55

66
content()('test')
77
);
8+
9+
block('b')(
10+
addJs()(true),
11+
12+
content()('test')
13+
);

migration/lib/transformers/__tests__/common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ defineTest(__dirname, '8-mix-to-addmix', null, '8-mix-to-addmix-1');
4242
defineTest(__dirname, '8-mix-to-addmix', null, '8-mix-to-addmix-2');
4343
defineTest(__dirname, '8-js-to-addjs', null, '8-js-to-addjs-1');
4444
defineTest(__dirname, '8-js-to-addjs', null, '8-js-to-addjs-2');
45+
defineTest(__dirname, '8-chain-js-to-chain-addjs', null, '8-chain-js-to-chain-addjs-1');

0 commit comments

Comments
 (0)