-
Notifications
You must be signed in to change notification settings - Fork 76
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
Breaks tests #235
Comments
Also #188 I was able to get past this first problem by installing // config/environment.js
// ...
if (environment === 'test') {
ENV.emberPouch.options = {
adapter: 'memory'
};
// ...
}
// ... // app/adapters/application.js
import { Adapter } from 'ember-pouch';
import PouchDB from 'pouchdb';
import pouchInMemoryPlugin from 'pouchdb-adapter-memory'; // Note: using ember-auto-import to get this from npm
import config from 'my-app/config/environment';
import { isEmpty } from '@ember/utils';
import { assert } from '@ember/debug';
function createDb() {
const localDb = config.emberPouch.localDb;
assert('emberPouch.localDb must be set', !isEmpty(localDb));
if (config.emberPouch.options && config.emberPouch.options.adapter === "memory") {
PouchDB.plugin(pouchInMemoryPlugin);
}
const db = new PouchDB(localDb, config.emberPouch.options);
if (config.emberPouch.remoteDb) {
let remoteDb = new PouchDB(config.emberPouch.remoteDb);
db.sync(remoteDb, {
live: true,
retry: true
});
}
return db;
}
export default Adapter.extend({
init() {
this._super(...arguments);
this.set('db', createDb());
}
}); However, I now see another problem. Some tests (not the same ones with the previously mentioned problem either) now show this error after they run:
|
This |
@backspace I was able to reproduce the problem by manually using the dev tools console, so there must be more to it than just test waiters/synchronization. |
ah, okay. I was able to use the waiter technique discussed in this thread to get rid of the |
Ref #200 #217, #23, #24
I just switched from
ember-localstorage-adapter
and suddenly lots of tests that were passing now blow up during their tear-down with errors like:Does this addon not support use in testing? Is there a way to easily band-aid this? (e.g. have all the tests run a hook that does something magic?)
The text was updated successfully, but these errors were encountered: