今していること
create-react-app使用
→Sass使用するために以下の様に変更
//package.json "scripts": { "compile:sass": "node-sass src/sass/index.scss src/index.css", "watch:sass": "node-sass src/sass/index.scss src/index.css -w", "start-js": "react-scripts start", "start": "npm-run-all --parallel watch:sass start-js",
困っていること
この変更でmochaを使用し、テストコード書く必要有。
describe('test file exists', function () { it('should src/index.css', function () { if(file_exists(src/index.css)); }); });
このようにcompile後にindex.cssにcompileされているかどうかのテストをしたいですが、上手くいきません。
また「npm run compile:sass」を実行後 -> src/index.cssに反映されているか。 をテストコードに記載したいですがscriptの実行をテストコードに書く方法が不明です。
よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。