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
[QUESTION] Test extended built-in adapters #77
Comments
You need to import the one from your app: needs: ['metrics-adapter:piwik'] the |
@poteto Thank you for your answer. Actually, I'm unit testing this adapter, so I thought it was not a |
I tried, but it does not work. Here is the adapter: //app/metrics-adapters/piwik.js
import PiwikAdapter from 'ember-metrics/metrics-adapters/piwik';
export default PiwikAdapter.extend({
identify(options = {}) {
this._super(...arguments);
window._paq.push(['setCustomDimension', 1, options.organizationName]);
window._paq.push(['setCustomDimension', 2, options.userId]);
}
}); and the test, using ember-mocha
The following error is thrown: It seemed to me that I should add the dependency to the ember-metrics piwik adapter, but if I do that I have the above error, ie |
Sorry about the delay! Can you share what your config / env looks like? |
Hi, I'm sorry for the delay. I don't know when I will go back to work (kind of burn out for the moment), but for sure, as soon as I can I will try to keep this up to date |
@poteto, having the same problem while unit testing a
Which fails with while removing the
my metrics-adapter itself starts with:
and works well except for the failing test |
@poteto, forget it it was as simple as setting the metricsAdapters ENV variable in my dummy app config, thanks |
@poteto I'm sorry letting this one so long. If you still interrested I could work on, otherwise I will juste close. Your call 😺 |
I cleanup my own Piwik adapter using the built-in one. I just have some customization for the adapter (like sending custom dimensions).
I have define a
app/metrics-adapters/piwik.js
, like this:So far, so good, but when I wanted to test it, I can"t find a way to resolve
ember-metrics/metrics-adapters/piwik
.In the
needs
property of my unit test, I tried to add a reference toember-metrics@metrics-adapter:piwik
with no success, I encounter this error:Attempting to register an unknown factory: 'ember-metrics@metrics-adapter:piwik'
.When referencing
ember-metrics@metrics-adapter:base
, it seems like the BaseAdapter is beeing correctly resolved.So my question: How can I test an extended adapter ?
The text was updated successfully, but these errors were encountered: