Title: Unit Test Failures- Error: A platform with a different configuration has been created. Please destroy it first. · Issue #5432 · angular/angular-cli · GitHub
Open Graph Title: Unit Test Failures- Error: A platform with a different configuration has been created. Please destroy it first. · Issue #5432 · angular/angular-cli
X Title: Unit Test Failures- Error: A platform with a different configuration has been created. Please destroy it first. · Issue #5432 · angular/angular-cli
Description: Karma , Jasmine Failures to creat unit test instance: Error: A platform with a different configuration has been created. Please destroy it first. at assertPlatform (http://localhost:9876/base/src/test.ts?3dd3df58e39fbebb2f34c8313262ec136...
Open Graph Description: Karma , Jasmine Failures to creat unit test instance: Error: A platform with a different configuration has been created. Please destroy it first. at assertPlatform (http://localhost:9876/base/src/t...
X Description: Karma , Jasmine Failures to creat unit test instance: Error: A platform with a different configuration has been created. Please destroy it first. at assertPlatform (http://localhost:9876/base/src/t...
Opengraph URL: https://github.com/angular/angular-cli/issues/5432
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unit Test Failures- Error: A platform with a different configuration has been created. Please destroy it first. ","articleBody":"\r\n### Karma , Jasmine Failures to creat unit test instance:\r\nError: A platform with a different configuration has been created. Please destroy it first.\r\n at assertPlatform (http://localhost:9876/base/src/test.ts?3dd3df58e39fbebb2f34c8313262ec136a3cc28e:31208:15) [\u003croot>]\r\n at Object.platformBrowserDynamicTesting (http://localhost:9876/base/src/test.ts?3dd3df58e39fbebb2f34c8313262ec136a3cc28e:31191:16) [\u003croot>]\r\n at Object.\u003canonymous> (http://localhost:9876/base/src/test.ts?3dd3df58e39fbebb2f34c8313262ec136a3cc28e:36047:92) [\u003croot>]\r\n at attemptSync (http://localhost:9876/base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?916005cc407925f4764668d61d04888d59258f5d:1950:24) [\u003croot>]\r\n at ZoneQueueRunner.QueueRunner.run (http://localhost:9876/base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?916005cc407925f4764668d61d04888d59258f5d:1938:9) [\u003croot>]\r\n at ZoneQueueRunner.QueueRunner.execute (http://localhost:9876/base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?916005cc407925f4764668d61d04888d59258f5d:1923:10) [\u003croot>]\r\n at http://localhost:9876/base/src/test.ts?3dd3df58e39fbebb2f34c8313262ec136a3cc28e:73459:130 [\u003croot>]\r\n at Zone.runTask (http://localhost:9876/base/src/test.ts?3dd3df58e39fbebb2f34c8313262ec136a3cc28e:70552:47) [\u003croot> => \u003croot>]\r\n at drainMicroTaskQueue (http://localhost:9876/base/src/test.ts?3dd3df58e39fbebb2f34c8313262ec136a3cc28e:70932:35) [\u003croot>]\r\nError: A platform with a different configuration has been created. Please destroy it first.\r\n\r\n### Versions.\r\nAngular CLI v1.0.0 RC0 & Webpack 2\r\n \"@angular/common\": \"^2.4.8\",\r\n \"@angular/compiler\": \"^2.4.8\",\r\n \"@angular/core\": \"^2.4.8\",\r\n \"@angular/forms\": \"^2.4.8\",\r\n \"@angular/http\": \"^2.4.8\",\r\n \"@angular/platform-browser\": \"^2.4.8\",\r\n \"@angular/platform-browser-dynamic\": \"^2.4.8\",\r\n \"@angular/router\": \"^3.4.0\",\r\n \"jasmine-core\": \"~2.5.2\",\r\n \"jasmine-spec-reporter\": \"~3.2.0\",\r\n \"javascript-obfuscator\": \"^0.9.1\",\r\n \"json-loader\": \"^0.5.4\",\r\n \"karma\": \"^1.4.1\",\r\n \"karma-chrome-launcher\": \"~2.0.0\",\r\n \"karma-cli\": \"~1.0.1\",\r\n \"karma-coverage\": \"^1.1.1\",\r\n \"karma-coverage-istanbul-reporter\": \"^0.2.0\",\r\n \"karma-jasmine\": \"~1.1.0\",\r\n \"karma-jasmine-html-reporter\": \"^0.2.2\",\r\n \"karma-sourcemap-loader\": \"^0.3.7\",\r\n\r\nOS : MacOS Sierra V10.12.3\r\n\r\n### Files Config :\r\n#### ---- > main.ts:\r\nimport './polyfills.ts';\r\n\r\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\nimport { enableProdMode } from '@angular/core';\r\nimport { environment } from './environments/environment';\r\nimport { AppModule } from './app/app.module';\r\n\r\nif (environment.production) {\r\n enableProdMode();\r\n}\r\n\r\nplatformBrowserDynamic().bootstrapModule(AppModule);\r\n\r\n#### ---- > tsconfig.json:\r\n{\r\n \"exclude\": [\r\n \"test.ts\"\r\n ],\r\n \"compilerOptions\": {\r\n \"baseUrl\": \"\",\r\n \"declaration\": false,\r\n \"emitDecoratorMetadata\": true,\r\n \"experimentalDecorators\": true,\r\n \"lib\": [\r\n \"es6\",\r\n \"dom\"\r\n ],\r\n \"mapRoot\": \"./\",\r\n \"module\": \"es6\",\r\n \"moduleResolution\": \"node\",\r\n \"outDir\": \"../dist/out-tsc\",\r\n \"sourceMap\": true,\r\n \"target\": \"es5\",\r\n \"typeRoots\": [\r\n \"../node_modules/@types\"\r\n ]\r\n }\r\n}\r\n\r\n#### ---- > karma.conf.js:\r\n\r\n// Karma configuration file, see link for more information\r\n// https://karma-runner.github.io/0.13/config/configuration-file.html\r\nconst path = require('path');\r\n\r\nmodule.exports = function (config) {\r\n config.set({\r\n basePath: '',\r\n frameworks: ['jasmine', '@angular/cli'],\r\n plugins: [\r\n require('karma-jasmine'),\r\n require('karma-chrome-launcher'),\r\n require('karma-jasmine-html-reporter'),\r\n require('karma-coverage-istanbul-reporter'),\r\n require('@angular/cli/plugins/karma')\r\n ],\r\n client: {\r\n clearContext: false // leave Jasmine Spec Runner output visible in browser\r\n },\r\n files: [ //src/app/contact/contact.component.spec.ts\r\n {pattern: './src/test.ts', watched: false}\r\n ],\r\n preprocessors: {\r\n './src/test.ts': ['@angular/cli']\r\n },\r\n mime: {\r\n 'text/x-typescript': ['ts', 'tsx']\r\n },\r\n coverageIstanbulReporter: {\r\n reports: ['html', 'lcovonly'],\r\n dir: path.join(__dirname, 'coverage'),\r\n 'report-config': {\r\n html: {\r\n subdir: 'html'\r\n },\r\n cobertura: {\r\n subdir: 'cobertura'\r\n },\r\n lcovonly: {\r\n file: 'coverage.lcov'\r\n }\r\n },\r\n thresholds: {\r\n statements: 100,\r\n lines: 100,\r\n branches: 100,\r\n functions: 100\r\n },\r\n fixWebpackSourcePaths: true\r\n },\r\n angularCli: {\r\n environment: 'dev'\r\n },\r\n reporters: config.angularCli && config.angularCli.codeCoverage\r\n\r\n ? ['progress', 'coverage-istanbul']\r\n : ['progress', 'kjhtml'],\r\n\r\n port: 9876,\r\n colors: true,\r\n logLevel: config.LOG_INFO,\r\n autoWatch: true,\r\n browsers: ['Chrome'],\r\n singleRun: false\r\n });\r\n};\r\n\r\n#### ---- > test.ts:\r\n\r\nimport './polyfills.ts';\r\n\r\nimport 'zone.js/dist/long-stack-trace-zone';\r\nimport 'zone.js/dist/proxy.js';\r\nimport 'zone.js/dist/sync-test';\r\nimport 'zone.js/dist/jasmine-patch';\r\nimport 'zone.js/dist/async-test';\r\nimport 'zone.js/dist/fake-async-test';\r\nimport { getTestBed } from '@angular/core/testing/test_bed';\r\nimport {\r\n BrowserDynamicTestingModule,\r\n platformBrowserDynamicTesting\r\n} from '@angular/platform-browser-dynamic/testing/index';\r\n\r\n// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.\r\ndeclare var __karma__: any;\r\ndeclare var require: any;\r\n\r\n// Prevent Karma from running prematurely.\r\n__karma__.loaded = function () {};\r\n\r\n// First, initialize the Angular testing environment.\r\ngetTestBed().initTestEnvironment(\r\n BrowserDynamicTestingModule,\r\n platformBrowserDynamicTesting()\r\n);\r\n// Then we find all the tests.\r\nlet context = require.context('./', true, /\\.spec\\.ts$/);\r\n// And load the modules.\r\ncontext.keys().map(context);\r\n// Finally, start Karma to run the tests.\r\n__karma__.start();\r\n\r\n#### ---- > app.component.ts:\r\n\r\nimport { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n templateUrl: './app.component.html',\r\n styleUrls: ['app.component.scss']\r\n})\r\nexport class AppComponent {}\r\n\r\n#### ---- > app.component.spec.ts:\r\n\r\n\r\nimport { TestBed, async } from '@angular/core/testing';\r\nimport { AppComponent } from './app.component';\r\nimport { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'\r\nimport { BrowserDynamicTestingModule,\r\n platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';\r\n\r\ndescribe('AppComponent', () => {\r\n beforeEach(() => {\r\n TestBed.configureTestingModule({\r\n declarations: [\r\n AppComponent\r\n ],\r\n schemas:[CUSTOM_ELEMENTS_SCHEMA]\r\n });\r\n TestBed.compileComponents();\r\n });\r\n\r\n it('should create the app', async(() => {\r\n let fixture = TestBed.createComponent(AppComponent);\r\n let app = fixture.debugElement.componentInstance;\r\n expect(app).toBeTruthy();\r\n }));\r\n\r\n});\r\n\r\n\r\n------------------------------------------------ :(\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/AhmedHadjTaieb","@type":"Person","name":"AhmedHadjTaieb"},"datePublished":"2017-03-15T10:41:55Z","url":"https://github.com/angular/angular-cli/issues/5432"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2509593f-66d2-352e-d85b-140e206f022f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A37A:2A7C1C:10B04BC:1616CB1:6B01E01B |
| html-safe-nonce | bc7070a62d3c4a590fa665e447e1fe5571d9a0225ba2485a30f8372d4014a679 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzdBOjJBN0MxQzoxMEIwNEJDOjE2MTZDQjE6NkIwMUUwMUIiLCJ2aXNpdG9yX2lkIjoiODM0NDE4MTMwNTczOTc1NTc5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 116b5353aaedd9360cd2072a6524b4d28cf8a5a7943f33e4d11e8fd002ae5de3 |
| hovercard-subject-tag | issue:214349254 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/5432/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8298f3c45fc2ef26d15ef8f1a52e409d07f1eebf088b85efe9e3e710fd01d2d8/angular/angular-cli/issues/5432 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8298f3c45fc2ef26d15ef8f1a52e409d07f1eebf088b85efe9e3e710fd01d2d8/angular/angular-cli/issues/5432 |
| og:image:alt | Karma , Jasmine Failures to creat unit test instance: Error: A platform with a different configuration has been created. Please destroy it first. at assertPlatform (http://localhost:9876/base/src/t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AhmedHadjTaieb |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width