Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gen:endpoint): create models spec files #1143

Closed
wants to merge 3 commits into from
Closed

feat(gen:endpoint): create models spec files #1143

wants to merge 3 commits into from

Conversation

drochag
Copy link
Contributor

@drochag drochag commented Aug 8, 2015

Resolves #1095


var app = require('../../app');
var <%= classedName %> = require('./<%= name %>.model');
var <%= name %>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These <%= name %> should be <%= cameledName %> to avoid conflict with snake cased endpoint names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea about this one ?

Running "mochaTest:unit" (mochaTest) task
>> Mocha exploded!
>> /home/travis/build/DaftMonk/generator-angular-fullstack/test/temp/server/api/foo-bar/foo-bar.model.spec.js:5
>> var foo-bar;
>>        ^
>> SyntaxError: Unexpected token -
>>     at exports.runInThisContext (vm.js:73:16)
>>     at Module._compile (module.js:443:25)
>>     at Object.Module._extensions..js (module.js:478:10)
>>     at Module.load (module.js:355:32)
>>     at Function.Module._load (module.js:310:12)
>>     at Module.require (module.js:365:17)
>>     at require (module.js:384:17)
>>     at /home/travis/build/DaftMonk/generator-angular-fullstack/test/fixtures/node_modules/mocha/lib/mocha.js:192:27
>>     at Array.forEach (native)
>>     at Mocha.loadFiles (/home/travis/build/DaftMonk/generator-angular-fullstack/test/fixtures/node_modules/mocha/lib/mocha.js:189:14)
Warning: Task "mochaTest:unit" failed. Use --force to continue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, how could I check what Travis is doing? I mean

  28 passing (305ms)
  2 failing
  1) Foo Model should begin with no Foos:
     TypeError: undefined is not a function
      at Context.<anonymous> (server/api/Foo/Foo.model.spec.js:30:16)
  2) Foo Model "after each" hook:
     TypeError: undefined is not a function
      at Context.<anonymous> (server/api/Foo/Foo.model.spec.js:26:16)

This doesn't tell me much, not sure where to search the error

@drochag
Copy link
Contributor Author

drochag commented Aug 12, 2015

@kingcody can you help me a bit with those comments on the outdated diff please?

@kingcody
Copy link
Member

@danmmx, that's no problem; we'll get them straightened out. One thing we need to do is use the does template helper. We'll pass our assertion subject to the helper and it will template out an expect(foo).to or foo.should depending on what the user selected. example:

<% does("foo") %>.equal(bar);

will translate to:

expect(foo).to.equal(bar);

OR

foo.should.equal(bar);

requires #1161

fix(socketio): update socketio & doc info
fix(app): increase mocha default timeout to 5000
@drochag
Copy link
Contributor Author

drochag commented Aug 14, 2015

@kingcody now I'm having

[launcher] Running 1 instances of WebDriver
  Login View
    1) "before all" hook
  Logout View
    with local auth
      2) "before each" hook
  Signup View
    3) "before all" hook
  Main View
    4) "before each" hook
  0 passing (48s)
  4 failing
  1) Login View "before all" hook:
     Error: Angular could not be found on the page http://localhost:9000/login : retries looking for angular exceeded
      at Array.forEach (native)
  From: Task: Login View "before all" hook
  2) Logout View "before each" hook:
     Error: Angular could not be found on the page http://localhost:9000/login : retries looking for angular exceeded
      at Array.forEach (native)
  From: Task: Logout View "before each" hook
  3) Signup View "before all" hook:
     Error: Angular could not be found on the page http://localhost:9000/signup : retries looking for angular exceeded
      at Array.forEach (native)
  From: Task: Signup View "before all" hook
  4) Main View "before each" hook:
     Error: Angular could not be found on the page http://localhost:9000/ : retries looking for angular exceeded
      at Array.forEach (native)
  From: Task: Main View "before each" hook
SauceLabs results available at http://saucelabs.com/jobs/3ae3c4366331421f859e7c29f83323cb
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 failed 4 test(s)
[launcher] overall: 4 failed spec(s)
[launcher] Process exited with error code 1
>> 
Warning: Tests failed, protractor exited with code: 1 Use --force to continue.
Aborted due to warnings.

I don't think that has something to do with my PR, does it? 😧

@kingcody
Copy link
Member

@danmmx would you mind leaving this PR as is for now, I'm looking into some things and it would really help to have the current info and commits that are here.

@drochag
Copy link
Contributor Author

drochag commented Aug 15, 2015

Alright @kingcody 👍

@Awk34 Awk34 modified the milestones: 3.0.0, 3.1.0 Aug 19, 2015
@Awk34
Copy link
Member

Awk34 commented Dec 7, 2015

@danmmx would you mind updating this?

Awk34 added a commit that referenced this pull request Dec 8, 2016
@Awk34
Copy link
Member

Awk34 commented Dec 8, 2016

recreated as #2388

@Awk34 Awk34 closed this Dec 8, 2016
Awk34 added a commit that referenced this pull request Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants