diff --git a/.circleci/config.yml b/.circleci/config.yml index 3993b3a256..7ef6c7c8af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -909,34 +909,47 @@ jobs: shell: bash.exe steps: - checkout - - run: nvm install $(cat .nvmrc) - - run: nvm use $(cat .nvmrc) + - run: nvm install $(cat e2e/a5es5/.nvmrc) + - run: nvm use $(cat e2e/a5es5/.nvmrc) - attach_workspace: at: dist - run: name: NPM Shell command: npm config set script-shell bash.exe - restore_cache: - key: a12-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a12/package-lock.json" }} + key: a5es5-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a5es5/package-lock.json" }} - run: name: NPM Install command: | - if [ ! -d "e2e/a12/node_modules/" ]; then - cd e2e/a12 && npm ci --no-optional --ignore-scripts && ./node_modules/.bin/ngcc + if [ ! -d "e2e/a5es5/node_modules/" ]; then + npm run i:a5es5 -- --ignore-scripts fi - save_cache: - key: a12-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a12/package-lock.json" }} + key: a5es5-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a5es5/package-lock.json" }} paths: - - ./e2e/a12/node_modules + - ./e2e/a5es5/node_modules - run: name: Spreading Build - command: npm run s:a12 + command: | + P=e2e/a5es5/node_modules/ng-mocks + rm -Rf $P + mkdir -p $P + cp -R dist/libs/ng-mocks/. $P - run: name: Spreading Tests - command: npm run s:test:a12 + command: | + P=e2e/a5es5/src/test + rm -Rf $P + mkdir -p $P + cp -R tests $P + cp -R examples $P + rm $P/examples/TestRoutingGuard/test.spec.ts + rm $P/examples/TestRoutingResolver/test.spec.ts - run: name: Unit Tests - command: cd e2e/a12 && npm run test:jasmine:es5:ivy + command: | + cd e2e/a5es5 + npm run test:jasmine environment: IE_BIN: 'C:\Program Files\Internet Explorer\iexplore.exe' workflows: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dda6d0cb8..05d70c8641 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [13.0.2](https://github.com/ike18t/ng-mocks/compare/v13.0.1...v13.0.2) (2022-02-06) + + +### Bug Fixes + +* **ie:** running IE on A5 and old nodejs ([087d58d](https://github.com/ike18t/ng-mocks/commit/087d58d873536921bc3b1745e38ac5213457eef3)) + ## [13.0.1](https://github.com/ike18t/ng-mocks/compare/v13.0.0...v13.0.1) (2022-02-06) diff --git a/e2e/a12/karma.conf.js b/e2e/a12/karma.conf.js index 89afb5cf80..a4b154491e 100644 --- a/e2e/a12/karma.conf.js +++ b/e2e/a12/karma.conf.js @@ -10,7 +10,6 @@ module.exports = function (config) { plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), - require('karma-ie-launcher'), require('karma-jasmine-html-reporter'), require('@angular-devkit/build-angular/plugins/karma'), ], @@ -25,17 +24,13 @@ module.exports = function (config) { base: 'ChromeHeadless', flags: ['--headless', '--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage'], }, - IECi: { - base: 'IE', - flags: ['-extoff'], - }, }, reporters: ['kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: false, - browsers: [process.env.IE_BIN ? 'IECi' : 'ChromeCi'], + browsers: ['ChromeCi'], singleRun: true, }); }; diff --git a/e2e/a12/package-lock.json b/e2e/a12/package-lock.json index 7c18dda15c..fa4d56ae5e 100644 --- a/e2e/a12/package-lock.json +++ b/e2e/a12/package-lock.json @@ -11465,15 +11465,6 @@ "which": "^1.2.1" } }, - "karma-ie-launcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/karma-ie-launcher/-/karma-ie-launcher-1.0.0.tgz", - "integrity": "sha1-SXmGhCxJAZA0bNifVJTKmDDG1Zw=", - "dev": true, - "requires": { - "lodash": "^4.6.1" - } - }, "karma-jasmine": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-4.0.1.tgz", diff --git a/e2e/a12/package.json b/e2e/a12/package.json index 9b94b948f7..3b07a96086 100644 --- a/e2e/a12/package.json +++ b/e2e/a12/package.json @@ -46,7 +46,6 @@ "jest-preset-angular": "8.3.2", "karma": "6.1.2", "karma-chrome-launcher": "3.1.0", - "karma-ie-launcher": "1.0.0", "karma-jasmine": "4.0.1", "karma-jasmine-html-reporter": "1.5.4", "puppeteer": "10.4.0", diff --git a/e2e/a5es2015/src/polyfills.ts b/e2e/a5es2015/src/polyfills.ts index 3e05d259d0..6135a1e638 100644 --- a/e2e/a5es2015/src/polyfills.ts +++ b/e2e/a5es2015/src/polyfills.ts @@ -19,26 +19,26 @@ */ /** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/weak-map'; +import 'core-js/es6/set'; /** IE10 and IE11 requires the following for NgClass support on SVG elements */ // import 'classlist.js'; // Run `npm install --save classlist.js`. /** IE10 and IE11 requires the following for the Reflect API. */ -// import 'core-js/es6/reflect'; +import 'core-js/es6/reflect'; /** Evergreen browsers require these. **/ // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. diff --git a/e2e/a5es5/.nvmrc b/e2e/a5es5/.nvmrc new file mode 100644 index 0000000000..369689dd81 --- /dev/null +++ b/e2e/a5es5/.nvmrc @@ -0,0 +1 @@ +6.17.1 diff --git a/e2e/a5es5/karma.conf.js b/e2e/a5es5/karma.conf.js index 0cda6f8222..aed6a02ca9 100644 --- a/e2e/a5es5/karma.conf.js +++ b/e2e/a5es5/karma.conf.js @@ -10,6 +10,7 @@ module.exports = function (config) { plugins: [ require('@angular/cli/plugins/karma'), require('karma-chrome-launcher'), + require('karma-ie-launcher'), require('karma-jasmine'), require('karma-jasmine-html-reporter'), ], @@ -24,6 +25,10 @@ module.exports = function (config) { base: 'ChromeHeadless', flags: ['--headless', '--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage'], }, + IECi: { + base: 'IE', + flags: ['-extoff'], + }, }, angularCli: { environment: 'dev', @@ -33,7 +38,7 @@ module.exports = function (config) { colors: true, logLevel: config.LOG_INFO, autoWatch: false, - browsers: ['ChromeCi'], + browsers: [process.env.IE_BIN ? 'IECi' : 'ChromeCi'], singleRun: true, }); }; diff --git a/e2e/a5es5/package-lock.json b/e2e/a5es5/package-lock.json index 98f989b867..316fb7adf9 100755 --- a/e2e/a5es5/package-lock.json +++ b/e2e/a5es5/package-lock.json @@ -6839,6 +6839,15 @@ "which": "^1.2.1" } }, + "karma-ie-launcher": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/karma-ie-launcher/-/karma-ie-launcher-1.0.0.tgz", + "integrity": "sha1-SXmGhCxJAZA0bNifVJTKmDDG1Zw=", + "dev": true, + "requires": { + "lodash": "^4.6.1" + } + }, "karma-jasmine": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-1.1.2.tgz", diff --git a/e2e/a5es5/package.json b/e2e/a5es5/package.json index ad86054880..7c486e6ee9 100644 --- a/e2e/a5es5/package.json +++ b/e2e/a5es5/package.json @@ -44,6 +44,7 @@ "jest-preset-angular": "5.2.3", "karma": "3.1.4", "karma-chrome-launcher": "2.2.0", + "karma-ie-launcher": "1.0.0", "karma-jasmine": "1.1.2", "karma-jasmine-html-reporter": "0.2.2", "puppeteer": "1.20.0", diff --git a/e2e/a5es5/src/polyfills.ts b/e2e/a5es5/src/polyfills.ts index 3e05d259d0..6135a1e638 100644 --- a/e2e/a5es5/src/polyfills.ts +++ b/e2e/a5es5/src/polyfills.ts @@ -19,26 +19,26 @@ */ /** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/weak-map'; +import 'core-js/es6/set'; /** IE10 and IE11 requires the following for NgClass support on SVG elements */ // import 'classlist.js'; // Run `npm install --save classlist.js`. /** IE10 and IE11 requires the following for the Reflect API. */ -// import 'core-js/es6/reflect'; +import 'core-js/es6/reflect'; /** Evergreen browsers require these. **/ // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. diff --git a/karma.conf.ts b/karma.conf.ts index 5c019a1255..a39d986e8c 100644 --- a/karma.conf.ts +++ b/karma.conf.ts @@ -35,7 +35,7 @@ if (!process.env.KARMA_SUITE) { export default (config: Config) => { config.set({ autoWatch: false, - browsers: [process.env.IE_BIN ? 'IECi' : 'ChromeCi'], + browsers: ['ChromeCi'], client: { clearContext: false, jasmine: { @@ -65,10 +65,6 @@ export default (config: Config) => { '--remote-debugging-port=9222', ], }, - IECi: { - base: 'IE', - flags: ['-extoff'], - }, }, files: [ { pattern: './empty.ts', watched: false }, diff --git a/karma.ie.sh b/karma.ie.sh new file mode 100644 index 0000000000..a846789a7e --- /dev/null +++ b/karma.ie.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# initialization +export IE_BIN="/c/Program Files/Internet Explorer/iexplore.exe" +cd /c/ && rm -Rf ng-mocks && mkdir ng-mocks && cd ng-mocks + +find /z/ng-mocks/e2e/a5es5 -maxdepth 1 -not -name a5es5 -not -name node_modules -exec cp -r {} . \; + +# installing dependencies +npm install --no-optional --ignore-scripts + +# spreading tests +rm -Rf ./src/test && mkdir src/test && cp -r /z/ng-mocks/tests ./src/test && cp -r /z/ng-mocks/examples ./src/test +rm ./src/test/examples/TestRoutingGuard/test.spec.ts +rm ./src/test/examples/TestRoutingResolver/test.spec.ts + +# spreading ng-mocks +rm -Rf ./node_modules/ng-mocks && cp -r /z/ng-mocks/dist/libs/ng-mocks ./node_modules + +# running tests +npm run test:jasmine diff --git a/package-lock.json b/package-lock.json index 5ab7b5edf4..b2bb9868eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12512,15 +12512,6 @@ "minimatch": "^3.0.4" } }, - "karma-ie-launcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/karma-ie-launcher/-/karma-ie-launcher-1.0.0.tgz", - "integrity": "sha1-SXmGhCxJAZA0bNifVJTKmDDG1Zw=", - "dev": true, - "requires": { - "lodash": "^4.6.1" - } - }, "karma-jasmine": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-4.0.1.tgz", diff --git a/package.json b/package.json index b5a1bf7bd9..e43c6102b8 100644 --- a/package.json +++ b/package.json @@ -195,7 +195,6 @@ "karma": "6.3.15", "karma-chrome-launcher": "3.1.0", "karma-coverage-istanbul-reporter": "3.0.3", - "karma-ie-launcher": "1.0.0", "karma-jasmine": "4.0.1", "karma-jasmine-html-reporter": "1.7.0", "karma-junit-reporter": "2.0.1", diff --git a/renovate.json b/renovate.json index e140802b63..c7f410a549 100644 --- a/renovate.json +++ b/renovate.json @@ -111,6 +111,12 @@ "packageNames": ["@types/node"], "allowedVersions": "<=6" }, + { + "additionalBranchPrefix": "e2e/a5/", + "paths": ["e2e/a5es5/.nvmrc", "e2e/a5es2015/.nvmrc"], + "packageNames": ["node"], + "allowedVersions": "<=6" + }, { "additionalBranchPrefix": "e2e/a5/", "paths": ["e2e/a5es5/package.json", "e2e/a5es2015/package.json"], diff --git a/webpack.config.js b/webpack.config.js index 28a6ff5fc4..1c8e1c7e15 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,6 +4,7 @@ module.exports = { mode: 'production', devtool: 'source-map', entry: './libs/ng-mocks/src/index.ts', + target: ['web', 'es5'], output: { path: path.resolve(__dirname, './dist/libs/ng-mocks/'), filename: 'index.js',