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

Fix bluebird warnings #334

Merged
merged 1 commit into from
Dec 15, 2015
Merged

Fix bluebird warnings #334

merged 1 commit into from
Dec 15, 2015

Conversation

ariporad
Copy link
Contributor

Hi All,

This is a simple PR, it just fixes a warning from bluebird (about deferreds).

Enjoy!

@jamestalmage
Copy link
Contributor

What warnings are you seeing? I can not reproduce.

@ariporad
Copy link
Contributor Author

@jamestalmage: Logs

@jamestalmage
Copy link
Contributor

Hmm, I still don't see that error.

Either way though, it is probably a good idea to stop using a deprecated API. My only objection is the additional nesting.

@ariporad
Copy link
Contributor Author

@jamestalmage: Well, you have two options:

  1. It's not really that big a deal.
  2. I can add our own implementation of a deferred, which is ~15 lines of code.

Personally, #1 seems way more reasonable to me, but in the end it's up to you.

@jamestalmage
Copy link
Contributor

Well it i no where near 15 lines. But still, I tend to agree with you, not worth doing.

var deferred = {};
deferred.promise = new Promise(function (resolve, reject) {
  deferred.resolve = resolve;
  deferred.reject = reject;
});

LGTM

@sindresorhus
Copy link
Member

Yeah. Let's just nest. I think the code is clearer this way too.

sindresorhus added a commit that referenced this pull request Dec 15, 2015
@sindresorhus sindresorhus merged commit 4513cba into avajs:master Dec 15, 2015
@ariporad ariporad deleted the fix-bluebird-warnings branch December 17, 2015 00:41
@Lokua
Copy link

Lokua commented Jan 18, 2016

I'm still getting one these traces for every test in 0.10

Warning: Promise.defer is deprecated and will be removed in a future version. Use new Promise instead.
    at Test.run (/home/puz/lnet/lokua.net.route/node_modules/ava/lib/test.js:87:25)
    at Runner._runTest (/home/puz/lnet/lokua.net.route/node_modules/ava/lib/runner.js:127:14)
    at Runner.<anonymous> (/home/puz/lnet/lokua.net.route/node_modules/ava/lib/runner.js:114:15)
From previous event:
    at eachSeries (/home/puz/lnet/lokua.net.route/node_modules/ava/lib/runner.js:16:17)
    at Runner._runTestWithHooks (/home/puz/lnet/lokua.net.route/node_modules/ava/lib/runner.js:104:9)
    at Array.map (native)
    at each (/home/puz/lnet/lokua.net.route/node_modules/ava/lib/runner.js:12:27)
    at Runner._runConcurrent (/home/puz/lnet/lokua.net.route/node_modules/ava/lib/runner.js:137:9)
    at /home/puz/lnet/lokua.net.route/node_modules/ava/lib/runner.js:204:16
    at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
    at Runner.run (/home/puz/lnet/lokua.net.route/node_modules/ava/lib/runner.js:203:4)
    at process.<anonymous> (/home/puz/lnet/lokua.net.route/node_modules/ava/index.js:85:10)
    at emitOne (events.js:77:13)
    at process.emit (events.js:169:7)
    at process.<anonymous> (/home/puz/lnet/lokua.net.route/node_modules/ava/lib/test-worker.js:102:10)
    at emitTwo (events.js:87:13)
    at process.emit (events.js:172:7)
    at handleMessage (internal/child_process.js:689:10)
    at Pipe.channel.onread (internal/child_process.js:440:11)
Warning: a promise was created in a handler but was not returned from it
    at processImmediate [as _immediateCallback] (timers.js:383:17)

@sindresorhus
Copy link
Member

@Lokua Use our gitter chat for support. Are you sure you're on the latest AVA version locally (and globally if you run AVA from the command line with $ ava)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants