Skip to content

Commit

Permalink
test: update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Aug 31, 2024
1 parent 9d5eb5a commit d4926ba
Showing 1 changed file with 42 additions and 43 deletions.
85 changes: 42 additions & 43 deletions test/__snapshots__/index.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ export { client as default };
exports[`rollup-plugin-swc3 swc (rollup 2) directive - merge "use client" 1`] = `
"'use client';
'use sukka';
var foo = \\"sukka\\";
var foo = 'sukka';
var bar = \\"sukka\\";
var bar = 'sukka';
export { bar, foo };
"
`;

exports[`rollup-plugin-swc3 swc (rollup 2) directive - only output "use client" / "use server" in the specfic entry 1`] = `
"'use client';
var foo = \\"client\\";
var foo = 'client';
export { foo };
"
`;

exports[`rollup-plugin-swc3 swc (rollup 2) directive - only output "use client" / "use server" in the specfic entry 2`] = `
"'use server';
var bar = \\"server\\";
var bar = 'server';
export { bar };
"
Expand Down Expand Up @@ -396,8 +396,8 @@ var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
// @ts-expect-error -- the dependency is only installed during test
var ee = new EventEmitter();
ee.on(\\"test\\", function() {
console.log(\\"test\\");
ee.on('test', function() {
console.log('test');
});
"
`;
Expand All @@ -420,7 +420,7 @@ function _class_private_field_init(obj, privateMap, value) {
function test(s) {
console.log(s);
}
test(\\"hello swc!\\");
test('hello swc!');
var _es2022Feature = /*#__PURE__*/ new WeakMap();
var Test = function Test() {
_class_call_check(this, Test);
Expand Down Expand Up @@ -460,7 +460,7 @@ console.log(Foo);
`;

exports[`rollup-plugin-swc3 swc (rollup 2) minify 1`] = `
"console.log(class{render(){return React.createElement(\\"div\\",{className:\\"hehe\\"},\\"hello there!!!\\")}});
"console.log(class{render(){return /*#__PURE__*/React.createElement(\\"div\\",{className:\\"hehe\\"},\\"hello there!!!\\")}});
"
`;

Expand Down Expand Up @@ -540,7 +540,7 @@ var Foo = /*#__PURE__*/ function() {
return Foo;
}();
var bar = \\"baz\\";
var bar = 'baz';
console.log(Foo);
console.log(bar);
Expand Down Expand Up @@ -570,29 +570,29 @@ export { rollupCommonjs as default };
`;

exports[`rollup-plugin-swc3 swc (rollup 2) target - include other files 1`] = `
"var foo = \\"sukka\\";
"var foo = 'sukka';
console.log(foo);
"
`;

exports[`rollup-plugin-swc3 swc (rollup 2) tsconfig - baseUrl & paths 1`] = `
"var a = function(input) {
return \\"a\\" + input;
return 'a' + input;
};
var b = \\"b\\";
var b = 'b';
console.log(a(b));
"
`;

exports[`rollup-plugin-swc3 swc (rollup 2) tsconfig - paths 1`] = `
"var a = function(input) {
return \\"a\\" + input;
return 'a' + input;
};
var b = \\"b\\";
var b = 'b';
console.log(a(b));
"
Expand Down Expand Up @@ -671,25 +671,25 @@ export { client as default };
exports[`rollup-plugin-swc3 swc (rollup 3) directive - merge "use client" 1`] = `
"'use client';
'use sukka';
var foo = \\"sukka\\";
var foo = 'sukka';
var bar = \\"sukka\\";
var bar = 'sukka';
export { bar, foo };
"
`;

exports[`rollup-plugin-swc3 swc (rollup 3) directive - only output "use client" / "use server" in the specfic entry 1`] = `
"'use client';
var foo = \\"client\\";
var foo = 'client';
export { foo };
"
`;

exports[`rollup-plugin-swc3 swc (rollup 3) directive - only output "use client" / "use server" in the specfic entry 2`] = `
"'use server';
var bar = \\"server\\";
var bar = 'server';
export { bar };
"
Expand Down Expand Up @@ -1052,8 +1052,8 @@ var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
// @ts-expect-error -- the dependency is only installed during test
var ee = new EventEmitter();
ee.on(\\"test\\", function() {
console.log(\\"test\\");
ee.on('test', function() {
console.log('test');
});
"
`;
Expand All @@ -1076,7 +1076,7 @@ function _class_private_field_init(obj, privateMap, value) {
function test(s) {
console.log(s);
}
test(\\"hello swc!\\");
test('hello swc!');
var _es2022Feature = /*#__PURE__*/ new WeakMap();
var Test = function Test() {
_class_call_check(this, Test);
Expand Down Expand Up @@ -1116,7 +1116,7 @@ console.log(Foo);
`;

exports[`rollup-plugin-swc3 swc (rollup 3) minify 1`] = `
"console.log(class{render(){return React.createElement(\\"div\\",{className:\\"hehe\\"},\\"hello there!!!\\")}});
"console.log(class{render(){return /*#__PURE__*/React.createElement(\\"div\\",{className:\\"hehe\\"},\\"hello there!!!\\")}});
"
`;

Expand Down Expand Up @@ -1196,7 +1196,7 @@ var Foo = /*#__PURE__*/ function() {
return Foo;
}();
var bar = \\"baz\\";
var bar = 'baz';
console.log(Foo);
console.log(bar);
Expand Down Expand Up @@ -1226,29 +1226,29 @@ export { rollupCommonjs as default };
`;

exports[`rollup-plugin-swc3 swc (rollup 3) target - include other files 1`] = `
"var foo = \\"sukka\\";
"var foo = 'sukka';
console.log(foo);
"
`;

exports[`rollup-plugin-swc3 swc (rollup 3) tsconfig - baseUrl & paths 1`] = `
"var a = function(input) {
return \\"a\\" + input;
return 'a' + input;
};
var b = \\"b\\";
var b = 'b';
console.log(a(b));
"
`;

exports[`rollup-plugin-swc3 swc (rollup 3) tsconfig - paths 1`] = `
"var a = function(input) {
return \\"a\\" + input;
return 'a' + input;
};
var b = \\"b\\";
var b = 'b';
console.log(a(b));
"
Expand Down Expand Up @@ -1327,25 +1327,25 @@ export { client as default };
exports[`rollup-plugin-swc3 swc (rollup 4) directive - merge "use client" 1`] = `
"'use client';
'use sukka';
var foo = \\"sukka\\";
var foo = 'sukka';
var bar = \\"sukka\\";
var bar = 'sukka';
export { bar, foo };
"
`;

exports[`rollup-plugin-swc3 swc (rollup 4) directive - only output "use client" / "use server" in the specfic entry 1`] = `
"'use client';
var foo = \\"client\\";
var foo = 'client';
export { foo };
"
`;

exports[`rollup-plugin-swc3 swc (rollup 4) directive - only output "use client" / "use server" in the specfic entry 2`] = `
"'use server';
var bar = \\"server\\";
var bar = 'server';
export { bar };
"
Expand Down Expand Up @@ -1708,8 +1708,8 @@ var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
// @ts-expect-error -- the dependency is only installed during test
var ee = new EventEmitter();
ee.on(\\"test\\", function() {
console.log(\\"test\\");
ee.on('test', function() {
console.log('test');
});
"
`;
Expand All @@ -1732,7 +1732,7 @@ function _class_private_field_init(obj, privateMap, value) {
function test(s) {
console.log(s);
}
test(\\"hello swc!\\");
test('hello swc!');
var _es2022Feature = /*#__PURE__*/ new WeakMap();
var Test = function Test() {
_class_call_check(this, Test);
Expand Down Expand Up @@ -1772,7 +1772,7 @@ console.log(Foo);
`;

exports[`rollup-plugin-swc3 swc (rollup 4) minify 1`] = `
"console.log(class{render(){return React.createElement(\\"div\\",{className:\\"hehe\\"},\\"hello there!!!\\")}});
"console.log(class{render(){return /*#__PURE__*/React.createElement(\\"div\\",{className:\\"hehe\\"},\\"hello there!!!\\")}});
"
`;

Expand Down Expand Up @@ -1832,7 +1832,6 @@ function _defineProperties(target, props) {
}
function _create_class(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
var Foo = /*#__PURE__*/ function() {
Expand All @@ -1852,7 +1851,7 @@ var Foo = /*#__PURE__*/ function() {
return Foo;
}();
var bar = \\"baz\\";
var bar = 'baz';
console.log(Foo);
console.log(bar);
Expand Down Expand Up @@ -1882,29 +1881,29 @@ export { rollupCommonjs as default };
`;

exports[`rollup-plugin-swc3 swc (rollup 4) target - include other files 1`] = `
"var foo = \\"sukka\\";
"var foo = 'sukka';
console.log(foo);
"
`;

exports[`rollup-plugin-swc3 swc (rollup 4) tsconfig - baseUrl & paths 1`] = `
"var a = function(input) {
return \\"a\\" + input;
return 'a' + input;
};
var b = \\"b\\";
var b = 'b';
console.log(a(b));
"
`;

exports[`rollup-plugin-swc3 swc (rollup 4) tsconfig - paths 1`] = `
"var a = function(input) {
return \\"a\\" + input;
return 'a' + input;
};
var b = \\"b\\";
var b = 'b';
console.log(a(b));
"
Expand Down

0 comments on commit d4926ba

Please sign in to comment.