ng test doesn't work (poseidon-ng-4.0.1)

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
brettw
Posts: 12
Joined: 08 Oct 2013, 01:40

19 Jun 2017, 04:36

Download the posiedon template (4.0.1).
C:>npm install (OK)
C:> ng build (OK)
C:> ng test (NOK):
Image

- So, I added tsconfig.spec.json from angular quickstart cli project.

C:> ng test (NOK):
Image

Can someone please advise on configuration changes to get the testing framework going.
Thanks
Brett

User avatar
DarthMaul
Posts: 582
Joined: 23 Nov 2015, 21:20

19 Jun 2017, 09:38

Hi,

Right now there is no test written for templates. You added a ts.config file and I am guessing it comes with some simple tests. Those tests have some dependencies and those dependencies aren't imported on your side.

Code: Select all

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/spec",
    "module": "commonjs",
    "target": "es5",
    "baseUrl": "",
    "types": [
      "jasmine",
      "node"
    ]
  },
  "files": [
    "test.ts"
  ],
  "include": [
    "**/*.spec.ts",
    "**/*.d.ts"
  ]
}

This is PrimeNG tsconfig.spec.json file maybe it can help you.

Regards

brettw
Posts: 12
Joined: 08 Oct 2013, 01:40

20 Jun 2017, 01:18

Thanks for the response. The tsconfig.spec.json you posted is exactly the same as the angular quickstart cli project, so it generates the same errors. All I want is for the project to execute a simple test, but it won't because of the errors. In fact even if I remove all tests and change Include in the tsconfig.spec.json to be empty, errors are still generated as above. I must admit I am completely new to angular world so please forgive any ignorance!! It would be nice if ng test worked out of the box for the template product. Thanks for any more advice if you have it.
Brett

User avatar
DarthMaul
Posts: 582
Joined: 23 Nov 2015, 21:20

28 Jun 2017, 09:06

Hi,

You need to import those files which produces errors.

For example for map

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';

Hope this will help you.

Regards

Post Reply

Return to “Poseidon - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests