nativescript-schematics icon indicating copy to clipboard operation
nativescript-schematics copied to clipboard

new --c=@nativescript/schematics doesn't create spec files

Open giacomo opened this issue 6 years ago • 4 comments

Environment

{
  "name": "foo",
  "nativescript": {
    "id": "org.nativescript.foo"
  },
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "android": "tns run android --bundle",
    "ios": "tns run ios --bundle"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~7.1.0",
    "@angular/common": "~7.1.0",
    "@angular/compiler": "~7.1.0",
    "@angular/core": "~7.1.0",
    "@angular/forms": "~7.1.0",
    "@angular/http": "~7.1.0",
    "@angular/platform-browser": "~7.1.0",
    "@angular/platform-browser-dynamic": "~7.1.0",
    "@angular/router": "~7.1.0",
    "core-js": "^2.5.4",
    "nativescript-angular": "~7.1.0",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~6.3.3",
    "tns-core-modules": "~5.1.1",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/cli": "^7.1.0",
    "@angular/compiler-cli": "~7.1.0",
    "@angular-devkit/build-angular": "~0.11.4",
    "@nativescript/schematics": "~0.4.0",
    "@types/jasmine": "2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "nativescript-dev-typescript": "~0.7.0",
    "nativescript-dev-webpack": "^0.18.0",
    "protractor": "~5.3.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "~3.1.1",
    "nativescript-dev-sass": "~1.6.0"
  }
}

Describe the bug creating a new angular project does not create the default spec files. creating a new component does not create the defualt spec files.

To Reproduce ng new --c=@nativescript/schematics --name=projectname --shared --style=scss ng g c componentname

Expected behavior *.spect.ts files should be generated

Additional context log of generating a new component

$: ng g c nav
CREATE src/app/nav/nav.component.html (22 bytes)
CREATE src/app/nav/nav.component.ts (258 bytes)
CREATE src/app/nav/nav.component.scss (0 bytes)
CREATE src/app/nav/nav.component.tns.scss (49 bytes)
CREATE src/app/nav/nav.component.tns.html (59 bytes)
UPDATE src/app/app.module.ts (540 bytes)
UPDATE src/app/app.module.tns.ts (927 bytes)

Any workaround?

giacomo avatar Jan 30 '19 10:01 giacomo

Hi @giacomo,

This intentional at the moment, as the unit testing needs some more work in NativeScript, which is something that we will work on in the current sprint, and should be included in the NativeScript 5.3 release.

However, when you create a new component you can add the --spec flag.

ng g c hello --spec

sebawita avatar Feb 15 '19 16:02 sebawita

Hi @sebawita, nice to hear! thanks for your response. I hope to see these changes soon in the NativeScript 5.3 release.

giacomo avatar Feb 18 '19 16:02 giacomo

I am on the latest packages and still don't see the default spec files generated on a new project.

nativescript 5.3.4
schematics 0.5.2

@sebawita please do update, is this still a work in progress and when it can be expected, thanks

dinusuresh avatar May 07 '19 03:05 dinusuresh

@sebawita any news on this?

giacomo avatar Jul 25 '19 18:07 giacomo