Skip to content

Commit

Permalink
test(babel-plugin-component): add more tests for @wire (#4939)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Nov 25, 2024
1 parent 8fb39b9 commit 7c31a3a
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { wire, LightningElement } from "lwc";
import { Foo } from "data-service";
export default class Test extends LightningElement {
@wire(Foo)
get wiredProp () {
return this._wiredProp
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { registerDecorators as _registerDecorators, LightningElement, registerComponent as _registerComponent } from "lwc";
import _tmpl from "./test.html";
import { Foo } from "data-service";
class Test extends LightningElement {
get wiredProp() {
return this._wiredProp;
}
/*LWC compiler vX.X.X*/
}
_registerDecorators(Test, {
wire: {
wiredProp: {
adapter: Foo,
config: function ($cmp) {
return {};
}
}
}
});
const __lwc_component_class_internal = _registerComponent(Test, {
tmpl: _tmpl,
sel: "lwc-test",
apiVersion: 9999999
});
export default __lwc_component_class_internal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { wire, LightningElement } from "lwc";
import { Foo } from "data-service";
export default class Test extends LightningElement {
@wire(Foo)
get wiredProp () {
return this._wiredProp
}

set wiredProp (val) {
this._wiredProp = val
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { registerDecorators as _registerDecorators, LightningElement, registerComponent as _registerComponent } from "lwc";
import _tmpl from "./test.html";
import { Foo } from "data-service";
class Test extends LightningElement {
get wiredProp() {
return this._wiredProp;
}
set wiredProp(val) {
this._wiredProp = val;
}
/*LWC compiler vX.X.X*/
}
_registerDecorators(Test, {
wire: {
wiredProp: {
adapter: Foo,
config: function ($cmp) {
return {};
}
}
}
});
const __lwc_component_class_internal = _registerComponent(Test, {
tmpl: _tmpl,
sel: "lwc-test",
apiVersion: 9999999
});
export default __lwc_component_class_internal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { wire, LightningElement } from "lwc";
import { Foo } from "data-service";
export default class Test extends LightningElement {
@wire(Foo)
set wiredProp (val) {
this._wiredProp = val
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { registerDecorators as _registerDecorators, LightningElement, registerComponent as _registerComponent } from "lwc";
import _tmpl from "./test.html";
import { Foo } from "data-service";
class Test extends LightningElement {
set wiredProp(val) {
this._wiredProp = val;
}
/*LWC compiler vX.X.X*/
}
_registerDecorators(Test, {
wire: {
wiredProp: {
adapter: Foo,
config: function ($cmp) {
return {};
}
}
}
});
const __lwc_component_class_internal = _registerComponent(Test, {
tmpl: _tmpl,
sel: "lwc-test",
apiVersion: 9999999
});
export default __lwc_component_class_internal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { wire, LightningElement } from "lwc";
import { Foo } from "data-service";
export default class Test extends LightningElement {
@wire(Foo)
set wiredProp (val) {
this._wiredProp = val
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { registerDecorators as _registerDecorators, LightningElement, registerComponent as _registerComponent } from "lwc";
import _tmpl from "./test.html";
import { Foo } from "data-service";
class Test extends LightningElement {
set wiredProp(val) {
this._wiredProp = val;
}
/*LWC compiler vX.X.X*/
}
_registerDecorators(Test, {
wire: {
wiredProp: {
adapter: Foo,
config: function ($cmp) {
return {};
}
}
}
});
const __lwc_component_class_internal = _registerComponent(Test, {
tmpl: _tmpl,
sel: "lwc-test",
apiVersion: 9999999
});
export default __lwc_component_class_internal;

0 comments on commit 7c31a3a

Please sign in to comment.