Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
jest-svelte-transformer
Advanced tools
svelte component transformer to compile svelte 3 components on the fly for tests files
npm install -D jest-svelte-transformer
In your package.json
add these lines:
"jest": {
"transform": {
"^.+\\.svelte$": "jest-svelte-transformer"
}
}
To add preprocessors you can create a config file at the root of your project named jest-svelte-transformer.config.js
. Here is an example of what you could have in this file:
const presetenv = require('postcss-preset-env')
const postcss = require('postcss')
module.exports = {
preprocessors: {
async style ({ content: code }) {
const { css } = await postcss([presetenv({
"stage": 0,
"features": {
"calc": false
}
})]).process(code, { from: undefined })
return { code: css }
}
},
compileOptions: {
dev: true,
immutable: true
}
}
Preprocessors and compile options config follows the svelte api (https://svelte.dev/docs#svelte_preprocess, https://svelte.dev/docs#svelte_compile)
If you don't need preprocessors but only compile options, you can put the config into an rc
file — .jest-svelte-transformerrc
— Like so:
{
"compileOptions": {
"dev": true,
"immutable": true
}
}
Babel is used to transpile svelte compiled code so that it could be loaded as a
commonjs
module, so any babel config set up in your project will also be used to transpile svelte compiled code.
By setting LOG_LEVEL
environment variable to trace
you can see config loading errors, like so for example:
LOG_LEVEL=trace npm test -- widget.test.js
FAQs
svelte component transformer to compile svelte 3 components on the fly for tests files
The npm package jest-svelte-transformer receives a total of 9 weekly downloads. As such, jest-svelte-transformer popularity was classified as not popular.
We found that jest-svelte-transformer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.