Skip to content

test: Fix insert tests #202

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

Merged
merged 8 commits into from
Jan 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/node_modules
/coverage
/dist
/node_modules
/test/fixtures
/test/cases/*/expected
/test/js
/test/manual
6 changes: 1 addition & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
module.exports = {
root: true,
parser: 'babel-eslint',
plugins: ['prettier'],
extends: ['@webpack-contrib/eslint-config-webpack'],
rules: {
'prettier/prettier': ['error'],
},
extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'],
};
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ package-lock.json -diff
* text=auto
test/cases/* eol=lf
bin/* eol=lf
yarn.lock -diff
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ Thumbs.db
*.sublime-project
*.sublime-workspace
.idea
*.iml
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
/test/cases/*/expected
/test/js
CHANGELOG.md

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you like our work, check out our Redux-based router <a href="https://github.c
> **HEADLINES (May 2018): Now Independently supports Webpack 4:**
> Yep that's right. The universal family is now fully Webpack 4. Thank you to all our users for your loyalty and patience! If you love Universal, then you are gonna fall head over heels when we bring out the main course!

So... why did we rebuild `extract-css-chunks`? What does it offer?
So... why did we rebuild `extract-css-chunks-webpack-plugin`? What does it offer?

It's got all the goodness of `mini-css-extract-plugin` but with 2 gleaming, sought after benefits.

Expand Down
5 changes: 0 additions & 5 deletions husky.config.js

This file was deleted.

1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
testURL: 'http://localhost/',
preset: 'jest-puppeteer',
transformIgnorePatterns: ['/node_modules/', '<rootDir>/dist/'],
watchPathIgnorePatterns: ['<rootDir>/test/js'],
};
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"node": ">= 6.9.0"
},
"scripts": {
"commit": "git-cz",
"start": "npm run build -- -w",
"prebuild": "npm run clean",
"build": "cross-env NODE_ENV=production babel src -d dist --ignore \"src/**/*.test.js\" --copy-files",
Expand Down Expand Up @@ -80,9 +81,11 @@
"@webpack-contrib/eslint-config-webpack": "3.0.0",
"babel-eslint": "10.0.3",
"babel-jest": "24.9.0",
"commitizen": "^4.0.3",
"commitlint-azure-pipelines-cli": "1.0.3",
"cross-env": "5.2.1",
"css-loader": "3.4.2",
"cz-conventional-changelog": "^3.0.2",
"del": "4.1.1",
"del-cli": "1.1.0",
"es-check": "5.1.0",
Expand All @@ -93,12 +96,16 @@
"file-loader": "4.3.0",
"husky": "3.1.0",
"jest": "24.9.0",
"jest-dev-server": "^4.4.0",
"jest-junit": "10.0.0",
"jest-puppeteer": "^4.4.0",
"lint-staged": "9.5.0",
"memfs": "3.0.3",
"npm-run-all": "4.1.5",
"prerender-loader": "1.3.0",
"prettier": "1.19.1",
"puppeteer": "^2.0.0",
"serve": "^11.3.0",
"standard-version": "7.0.1",
"webpack": "4.41.5",
"webpack-cli": "3.3.10",
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable class-methods-use-this */

import webpack from 'webpack';
import sources from 'webpack-sources';

Expand All @@ -23,7 +25,7 @@ const REGEXP_PLACEHOLDERS = /\[(name|id|chunkhash)\]/g;
const DEFAULT_FILENAME = '[name].css';

class CssDependencyTemplate {
apply() {} // eslint-disable-line class-methods-use-this
apply() {}
}

class CssModule extends webpack.Module {
Expand Down Expand Up @@ -71,7 +73,6 @@ class CssModule extends webpack.Module {
this.sourceMap = module.sourceMap;
}

// eslint-disable-next-line class-methods-use-this
needRebuild() {
return true;
}
Expand All @@ -92,7 +93,6 @@ class CssModule extends webpack.Module {
}

class CssModuleFactory {
// eslint-disable-next-line class-methods-use-this
create({ dependencies: [dependency] }, callback) {
callback(null, new CssModule(dependency));
}
Expand Down Expand Up @@ -399,7 +399,7 @@ class ExtractCssChunksPlugin {
);
});
}
// eslint-disable-next-line class-methods-use-this

getCssChunkObject(mainChunk) {
const obj = {};

Expand Down
3 changes: 3 additions & 0 deletions test/HMR.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @jest-environment jsdom
*/
/* eslint-env browser */
/* eslint-disable no-console */

Expand Down
9 changes: 9 additions & 0 deletions test/cases/insert-function/expected/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[1],[
/* 0 */,
/* 1 */
/***/ (function(module, exports, __webpack_require__) {

// extracted by extract-css-chunks-webpack-plugin

/***/ })
]]);
Loading