bem / bem-react-boilerplate Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED! A bare minimum frontend boilerplate based on create-react-app and bem-react-core.
DEPRECATED! A bare minimum frontend boilerplate based on create-react-app and bem-react-core.
first case:
[email protected] test D:\learning\bem-in-react
> jest
FAIL src/blocks/App/App.test.tsx
● Test suite failed to run
SecurityError: localStorage is not available for opaque origins
at Window.get localStorage [as localStorage] (node_modules/jest-runner/node_modules/jsdom/lib/jsdom/browser/Window.js:257:15)
at Array.forEach (<anonymous>)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.658s, estimated 3s
Ran all test suites.
second case:
> [email protected] test D:\learning\bem-in-react
> jest
FAIL src/blocks/App/App.test.tsx
● Test suite failed to run
Jest encountered an unexpected token
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html
Details:
D:\learning\bem-in-react\src\blocks\App\Logo\App-Logo.svg:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
^
SyntaxError: Unexpected token <
6 | import './App-Header.css';
7 |
> 8 | const logoSvg = require('../Logo/App-Logo.svg');
| ^
9 |
10 | export interface IElemProps {
11 | title: string;
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runner/node_modules/jest-runtime/build/script_transformer.js:403:17)
at Object.<anonymous> (src/blocks/App/Header/App-Header.tsx:8:17)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 3.648s
Ran all test suites.
bem-react-boilerplate v 0.1.0
, при запуске yarn test
Вылетает с ошибкой
TypeError: environment.teardown is not a function at node_modules/jest-runner/build/run_test.js:230:25
npm test
> [email protected] test /Users/tadatuta/projects/shri/bem-react-boilerplate
> jest
FAIL src/blocks/App/App.test.js
● Test suite failed to run
Cannot find module 'b:App' from 'App.test.js'
2 | import ReactDOM from 'react-dom';
3 |
> 4 | import App from 'b:App';
5 |
6 | it('renders without crashing', () => {
7 | const div = document.createElement('div');
at Resolver.resolveModule (node_modules/jest-cli/node_modules/jest-resolve/build/index.js:169:17)
at Object.<anonymous> (src/blocks/App/App.test.js:4:13)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 2.181s
Ran all test suites.
npm ERR! Test failed. See above for more details.
To create bundle for some override level you need to set level name in .env file.
Example:
PLATFORM= desktop
After run npm start
to work with desktop override level and npm run build
to create bundle of desktop-override level.
I see that some maps are present, but what I see during debugging is not my source code. How I can to enable them properly?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.