Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.ico files are not managed by jest & eslint config #952

Closed
vadzim opened this issue Oct 24, 2016 · 0 comments
Closed

.ico files are not managed by jest & eslint config #952

vadzim opened this issue Oct 24, 2016 · 0 comments

Comments

@vadzim
Copy link
Contributor

vadzim commented Oct 24, 2016

Description

.ico files are managed by webpack config, but not by jest & eslint configs

Place this code to e.g. App.js:

import myico from './my.ico';

Expected behavior

Tests pass.

Actual behavior

Webpack builds this code successfully, but this code does not pass tests because jest config does not treat .ico files as images. Also .ico files are not mentioned explicitly in eslint config (but other images are), though I did not notice any problem with this.

 FAIL  src/App.test.js
  ● Test suite failed to run

    /home/vadzim/tmp/cra_ico/src/my.ico:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){

    SyntaxError: Invalid or unexpected token

      at transformAndBuildScript (node_modules/react-scripts/node_modules/jest-runtime/build/transform.js:284:10)
      at Object.<anonymous> (src/App.js:3:37)
      at Object.<anonymous> (src/App.test.js:3:38)

Environment

[email protected]
node v6.9.1
npm 3.10.8

Ubuntu 16.10
Command line interface (no browser)

Reproducible Demo

https://github.com/vadzim/cra_ico.git
npm test

vadzim added a commit to vadzim/create-react-app that referenced this issue Oct 24, 2016
gaearon pushed a commit that referenced this issue Oct 28, 2016
kitze added a commit to kitze/custom-react-scripts that referenced this issue Nov 4, 2016
…react-app

# By Ville Immonen (11) and others
# Via Dan Abramov
* 'master' of https://github.com/facebookincubator/create-react-app: (39 commits)
  Remove redundant `function` from export statement (facebook#996)
  Add Gatsby to alternatives (facebook#995)
  Allow webpack 2 as peerDependency in react-dev-utils (facebook#963)
  Remove custom babel-loader cache dir config (facebook#983)
  Check for presence of folders before continuing eject. Closes facebook#939. (facebook#951)
  Fixes facebook#952 (facebook#953)
  Always build before deploying to gh-pages (facebook#959)
  Add collectCoverageFrom option to collect coverage on files without any tests. (facebook#961)
  Catch and noop call to open web browser. (facebook#964)
  Gently nudge users towards https by default (facebook#974)
  Enable compression on webpack-dev-server (facebook#966) (facebook#968)
  Add next.js to Alternatives
  Point people to npm Windows instructions
  Encourage people to try recent npm
  Fix an attribution link in 0.7.0 changelog
  Update CLI version in changelog
  Publish
  Update eslint-config-react-app version in the guide
  Update changelog for 0.7.0
  Revert "Temporarily remove 0.7.0 changelog as it's not out yet"
  ...

Conflicts:
	packages/babel-preset-react-app/package.json
	packages/create-react-app/package.json
	packages/eslint-config-react-app/package.json
	packages/react-dev-utils/package.json
	packages/react-scripts/config/webpack.config.dev.js
	packages/react-scripts/config/webpack.config.prod.js
	packages/react-scripts/package.json
eXtreme added a commit to eXtreme/create-react-app that referenced this issue Nov 18, 2016
* pull2:
  Support Yarn (facebook#898)
  Fix chrome tab reuse (facebook#1035)
  Remove unnecessary transform plugins for object spread to work (facebook#1052)
  Clears the usage of react-jsx-source & react-jsx-self (facebook#992)
  Update babel-present-env and use node: 'current' as target (facebook#1051)
  Remove redundant `function` from export statement (facebook#996)
  Add Gatsby to alternatives (facebook#995)
  Allow webpack 2 as peerDependency in react-dev-utils (facebook#963)
  Remove custom babel-loader cache dir config (facebook#983)
  Check for presence of folders before continuing eject. Closes facebook#939. (facebook#951)
  Fixes facebook#952 (facebook#953)
  Always build before deploying to gh-pages (facebook#959)
  Add collectCoverageFrom option to collect coverage on files without any tests. (facebook#961)
  Catch and noop call to open web browser. (facebook#964)
  Gently nudge users towards https by default (facebook#974)
  Enable compression on webpack-dev-server (facebook#966) (facebook#968)
  Add next.js to Alternatives
  Point people to npm Windows instructions
  Encourage people to try recent npm

# Conflicts:
#	packages/react-scripts/config/webpack.config.dev.js
#	packages/react-scripts/package.json
#	packages/react-scripts/utils/createJestConfig.js
jarlef pushed a commit to jarlef/create-react-app that referenced this issue Nov 28, 2016
alexdriaguine pushed a commit to alexdriaguine/create-react-app that referenced this issue Jan 23, 2017
randycoulman pushed a commit to CodingZeal/create-react-app that referenced this issue May 8, 2017
maltestenzel pushed a commit to maltestenzel/custom-react-scripts that referenced this issue Mar 7, 2018
…react-app

# By Ville Immonen (11) and others
# Via Dan Abramov
* 'master' of https://github.com/facebookincubator/create-react-app: (39 commits)
  Remove redundant `function` from export statement (facebook#996)
  Add Gatsby to alternatives (facebook#995)
  Allow webpack 2 as peerDependency in react-dev-utils (facebook#963)
  Remove custom babel-loader cache dir config (facebook#983)
  Check for presence of folders before continuing eject. Closes facebook#939. (facebook#951)
  Fixes facebook#952 (facebook#953)
  Always build before deploying to gh-pages (facebook#959)
  Add collectCoverageFrom option to collect coverage on files without any tests. (facebook#961)
  Catch and noop call to open web browser. (facebook#964)
  Gently nudge users towards https by default (facebook#974)
  Enable compression on webpack-dev-server (facebook#966) (facebook#968)
  Add next.js to Alternatives
  Point people to npm Windows instructions
  Encourage people to try recent npm
  Fix an attribution link in 0.7.0 changelog
  Update CLI version in changelog
  Publish
  Update eslint-config-react-app version in the guide
  Update changelog for 0.7.0
  Revert "Temporarily remove 0.7.0 changelog as it's not out yet"
  ...

Conflicts:
	packages/babel-preset-react-app/package.json
	packages/create-react-app/package.json
	packages/eslint-config-react-app/package.json
	packages/react-dev-utils/package.json
	packages/react-scripts/config/webpack.config.dev.js
	packages/react-scripts/config/webpack.config.prod.js
	packages/react-scripts/package.json
rrdelaney pushed a commit to rrdelaney/reason-scripts that referenced this issue May 23, 2018
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
sven3270350 added a commit to sven3270350/react-typescript that referenced this issue Aug 11, 2022
OrdinalKing pushed a commit to OrdinalKing/create-react-app-ts-redux-saga-mui that referenced this issue Aug 26, 2022
SmartCodiDev added a commit to SmartCodiDev/redux-saga-mui that referenced this issue May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant