PASS src/app/app.component.spec.ts
AppComponent
✓ should create the app (95ms)
✓ should have as title 'forgerock-ui-sdk' (44ms)
✓ should render title in a h1 tag (24ms)
Test Suites: 1 passed, 1 total
Tests: 3 passed, 3 total
Snapshots: 0 total
Time: 3.383s
Ran all test suites.
FAIL projects/components/src/lib/components.service.spec.ts
● Test suite failed to run
/Users/julien.renaux/Sites/forgerock-ui-sdk/projects/components/src/lib/components.service.spec.ts:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){require('ts-jest').install("/Users/julien.renaux/Sites/forgerock-ui-sdk/projects/components/src/lib/components.service.spec.ts", "import { TestBed } from '@angular/core/testing';\nimport { ComponentsService } from './components.service';\ndescribe('ComponentsService', function () {\n beforeEach(function () { return TestBed.configureTestingModule({}); });\n it('should be created', function () {\n var service = TestBed.get(ComponentsService);\n expect(service).toBeTruthy();\n });\n});\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50cy5zZXJ2aWNlLnNwZWMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb21wb25lbnRzLnNlcnZpY2Uuc3BlYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFaEQsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU
SyntaxError: Unexpected token {
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:316:17)
FAIL projects/components/src/lib/components.component.spec.ts
● Test suite failed to run
/Users/julien.renaux/Sites/forgerock-ui-sdk/projects/components/src/lib/components.component.spec.ts:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){require('ts-jest').install("/Users/julien.renaux/Sites/forgerock-ui-sdk/projects/components/src/lib/components.component.spec.ts", "import { async, TestBed } from '@angular/core/testing';\nimport { ComponentsComponent } from './components.component';\ndescribe('ComponentsComponent', function () {\n var component;\n var fixture;\n beforeEach(async(function () {\n TestBed.configureTestingModule({\n declarations: [ComponentsComponent]\n })\n .compileComponents();\n }));\n beforeEach(function () {\n fixture = TestBed.createComponent(ComponentsComponent);\n component = fixture.componentInstance;\n fixture.detectChanges();\n });\n it('should create', function () {\n expect(component).toBeTruthy();\n });\n});\n//# sourceMappingURL=data:app
SyntaxError: Unexpected token {
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:316:17)
Test Suites: 2 failed, 2 total
Tests: 0 total
Snapshots: 0 total
Time: 1.661s
Ran all test suites.
npm ERR! Test failed. See above for more details.
Thanks to @shprink we found this error:
It seems the command
npx jest --clearCachefix this. Ajestseems to be made before installing the schematics.