stenciljs

How do I point Jest testEnvironment to a node module in StencilJS Config?

若如初见. 提交于 2020-06-17 11:54:51
问题 I'm trying to set testEnvironment to "jsdom" in stencil.config.ts like this: testing: { testEnvironment: "jsdom" } However, running npm test gives me this error: [ ERROR ] runJest: ● Validation Error: Test environment C:/path/to/my/project/stencil.config.ts/jsdom cannot be found. Make sure the testEnvironment configuration option points to an existing node module. Configuration Documentation: https://jestjs.io/docs/configuration.html How do I point Jest testEnvironment to a node module in

How do I point Jest testEnvironment to a node module in StencilJS Config?

风流意气都作罢 提交于 2020-06-17 11:54:31
问题 I'm trying to set testEnvironment to "jsdom" in stencil.config.ts like this: testing: { testEnvironment: "jsdom" } However, running npm test gives me this error: [ ERROR ] runJest: ● Validation Error: Test environment C:/path/to/my/project/stencil.config.ts/jsdom cannot be found. Make sure the testEnvironment configuration option points to an existing node module. Configuration Documentation: https://jestjs.io/docs/configuration.html How do I point Jest testEnvironment to a node module in

How do I point Jest testEnvironment to a node module in StencilJS Config?

自闭症网瘾萝莉.ら 提交于 2020-06-17 11:53:32
问题 I'm trying to set testEnvironment to "jsdom" in stencil.config.ts like this: testing: { testEnvironment: "jsdom" } However, running npm test gives me this error: [ ERROR ] runJest: ● Validation Error: Test environment C:/path/to/my/project/stencil.config.ts/jsdom cannot be found. Make sure the testEnvironment configuration option points to an existing node module. Configuration Documentation: https://jestjs.io/docs/configuration.html How do I point Jest testEnvironment to a node module in

How to fetch data from a local JSON file in StencilJS?

情到浓时终转凉″ 提交于 2020-01-16 05:10:47
问题 I am learning stencilJS and wanted to fetch a JSON file from the local path. However, I am not able to do that until I have placed this file in www folder of the app. Problem is whenever I build my application file gets deleted/removed from the folder. I wanted to access this file from a services folder from my app. Kindly find below is my file structure and code. src > services > mock.json componentWillLoad() { return fetch("./services/mock.json") .then(response => response.json()) .then

Stenciljs: route to new content and cannot change background

家住魔仙堡 提交于 2019-12-13 03:40:49
问题 I'm currently creating my first PWA with Stencil, PWA Toolkit and Ionic 4. I can not explain myself a behavior when switching from one page (ion-content) to another page. Here the situation: CSS 1st page (app-home): ion-content { --background: pink; } CSS 2nd page (app-data): ion-content { --background: white; } With the statement: this.router.push ('/data', 'forward'); the app changes from page 1 to page 2. But the background remains pink and does not change as expected to white. When I

@types/jest index.d.ts file returning error

╄→гoц情女王★ 提交于 2019-12-10 16:49:30
问题 I just npm installed @types/jest to my stenciljs starter app and now, when I go to start my project the newly installed node package is returning several errors. Here are the errors it's returning when I go to npm start my project: [ ERROR ] TypeScript: node_modules/@types/jest/index.d.ts:39:30 A rest parameter must be of an array type. L39: type ArgsType<T> = T extends (...args: infer A) => any ? A : never; [ ERROR ] TypeScript: node_modules/@types/jest/index.d.ts:218:112 A tuple type

Technical concepts of Angular Elements and Stencil

痞子三分冷 提交于 2019-12-10 09:57:59
问题 Are the technical concepts of Angular Elements and Stencil similar? Angular Elements will be a new feature in Angular 6, where u can basically wrap your written Angular component as a Web Component. In my understanding the generated Custom Element is just a bridge to Angular, so we still have to ship Angular. Stencil , on the other side, claims to be a compiler that generates Web Components. So the generated Custom Element is not just a bridge to something? Did i get that right? 回答1: You

Ionic Stencil: Extending default components

梦想与她 提交于 2019-12-08 05:43:33
问题 I need to make certain changes in the behavior of some of the ionic components. It was easy enough with Ionic 3 and angular components, but now that we're migrating to Ionic 4, I'm finding it more challenging to alter the default web components in @ionic/core . I have created a new stencil components project and added the npm package for @ionic/core . I tired extending the datetime component and found that the web components cannot have super classes. So I copied over the entire folder for

ion-label component inside the stencil-component-starter not getting rendered

安稳与你 提交于 2019-12-06 06:00:53
问题 I cloned the stencil-component-starter from: https://github.com/ionic-team/stencil-component-starter Then on the file: my-component.tsx I have the following code: import { Component, Prop } from '@stencil/core'; @Component({ tag: 'my-component', styleUrl: 'my-component.css', shadow: true }) export class MyComponent { @Prop() first: string; @Prop() last: string; @Prop() minHeartRate: number; @Prop() maxHeartRate: number; render() { return ( <div> Athlete: {this.first} {this.last} - Heart Rate

Technical concepts of Angular Elements and Stencil

无人久伴 提交于 2019-12-06 03:03:22
Are the technical concepts of Angular Elements and Stencil similar? Angular Elements will be a new feature in Angular 6, where u can basically wrap your written Angular component as a Web Component. In my understanding the generated Custom Element is just a bridge to Angular, so we still have to ship Angular. Stencil , on the other side, claims to be a compiler that generates Web Components. So the generated Custom Element is not just a bridge to something? Did i get that right? You shouldn't have to ship Angular as you put it. Angular Elements will allow us to use Angular components without