Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix($q): Promises should be Promises/A+ spec compliant #3535

Closed

Conversation

jamestalmage
Copy link
Contributor

The $q promise library is not Promise/A+ compliant.

The spec's test-suite makes heavy use of Mocha's done method and would be difficult to port to jasmine. Therefore, I have added a separate karma config that runs mocha.

In addition, the spec is written for Node, and makes use of the CommonJS environment. I forked the spec and used component to make it browser friendly.

@mary-poppins
Copy link

Thanks for the PR!

  • Contributor signed CLA now or in the past
    • If you just signed, leave a comment here with your real name
  • PR's commit messages follow the commit message format

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@jamestalmage
Copy link
Contributor Author

Just signed the CLA

@IgorMinar
Copy link
Contributor

looks like we missed 3.2.6.4 and 3.2.6.5, I'd call that pretty darn close :-)

I think that running these tests in karma is an overkill as it requires too many conversions and transformations which will be hard to keep up to date over time.

what if we ran the tests in node instead? it should be easy to load promises-aplus-tests npm module and q.js and run them with mocha.

also, please add the tests (into qSpec.js) for changes you made to q.js

@jamestalmage
Copy link
Contributor Author

If you are OK running those tests in Node, then things should be much easier.

@IgorMinar
Copy link
Contributor

yes. it doesn't make sense to run that test suite in the browser. we have our $q specs to ensure that the implementation is cross-browser compatible.

@btford
Copy link
Contributor

btford commented Aug 21, 2013

Hi James, do you have cycles to finish this PR as Igor suggested?

If nothing else we should extract the actual fix, write a $q spec for it and merge that in.

@jamestalmage
Copy link
Contributor Author

Yes.
I'll do it tonight/tomorrow.

@btford
Copy link
Contributor

btford commented Aug 21, 2013

Thanks!

@IgorMinar and I will take care of the fix for the part of the spec that doesn't pass, so can you just focus on adding the A+ spec suite to our build?

@jamestalmage
Copy link
Contributor Author

Just so I'm clear, you want a P.R. that will fail the build because I've added tests but not the implementation?

@btford
Copy link
Contributor

btford commented Aug 21, 2013

Yes.

We'll merge our change before yours so that master is never broken, but in your PR the tests should fail on the part of the spec you identified earlier.

@jamestalmage
Copy link
Contributor Author

Done. #3693

btford added a commit to btford/angular.js that referenced this pull request Aug 21, 2013
@btford btford closed this in 7d188d6 Aug 21, 2013
@jamestalmage jamestalmage deleted the promise-aplus-fix branch January 15, 2015 19:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants