TypeScript-Babel-Starter | sample setup using Babel CLI to build TypeScript code | Build Tool library
kandi X-RAY | TypeScript-Babel-Starter Summary
kandi X-RAY | TypeScript-Babel-Starter Summary
This is a small sample repository that uses Babel to transform TypeScript to plain JavaScript, and uses TypeScript for type-checking. This README will also explain step-by-step how you can set up this repository so you can understand how each component fits together. For simplicity, we've used babel-cli with a bare-bones TypeScript setup, but we'll also demonstrate integration with JSX/React, as well as adding bundlers into the mix. Specifically, we'll show off integration with Webpack for if you're deploying an application, and Rollup for if you're producing a library.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of TypeScript-Babel-Starter
TypeScript-Babel-Starter Key Features
TypeScript-Babel-Starter Examples and Code Snippets
Community Discussions
Trending Discussions on TypeScript-Babel-Starter
QUESTION
I am trying to get Jest to run within the Electron runtime (rather than Node), it works as expected when I start Electron as follows:
...ANSWER
Answered 2019-Oct-25 at 12:29Unfortunately, I cannot provide an actual solution to your problem, but I think I examined its cause: See end of answer for a workaround.
The Node.js executable hides its options from the executed JS file. So if you run node --inspect file.js
, the process.argv
array will be ['/path/to/node', '/path/to/file.js']
, without the --inspect
flag appearing anywhere.
Electron however will not do the same. The process.argv
array differs between node_modules/.bin/electron file.js
and node_modules/.bin/electron --inspect file.js
.
Jest seems to take all arguments from the third onwards and use them as its own options. That means, when you run node_modules/.bin/electron --inspect node_modules/.bin/jest
, Jest will use the node_modules/.bin/jest
argument as a test file pattern — and not find any that match it. That's also why your test output states: Pattern: node_modules/.bin/jest - 0 matches
.
EDIT:
I found a terribly inelegant workaround, but it solves the problem.
You can create a "proxy" file which removes the --inspect
argument from process.argv
and run your tests through that:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install TypeScript-Babel-Starter
Add the following to the "scripts" section of your package.json.
Install the @babel/preset-react package as well as React, ReactDOM, and their respective type declarations.
to the scripts section in your package.json.
to the scripts section in your package.json.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page