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

Add connectorCapabilities global object #179

Merged
merged 1 commit into from
Oct 12, 2016
Merged

Add connectorCapabilities global object #179

merged 1 commit into from
Oct 12, 2016

Conversation

duffn
Copy link
Contributor

@duffn duffn commented Oct 9, 2016

Purpose

This PR is to support the new connectorCapabilities object added to loopback-datasource-juggler as discussed here: loopbackio/loopback-datasource-juggler#1091.

This object will allow connectors to tell the tests in basic-querying.test.js whether or not they support a certain operator, so new operators added do not cause downstream connector tests to fail. Tests run when the operator is supported and do not run when it is not.

Example

In a connector's test/init.js

global.connectorCapabilities = {
  ilike: false,
  nilike: false,
};

In loopback-datasource-juggler test/basic-querying.test.js

var itWhenIlikeSupported = connectorCapabilities.ilike ? it : it.skip.bind(it);

itWhenIlikeSupported('should support "like" that is satisfied', function(done) {
  User.find({where: {name: {like: 'John'}}}, function(err, users) {
    if (err) return done(err);
    users.length.should.equal(1);
    users[0].name.should.equal('John Lennon');
    done();
  });
});

@slnode
Copy link

slnode commented Oct 9, 2016

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@slnode
Copy link

slnode commented Oct 9, 2016

Can one of the admins verify this patch?

1 similar comment
@slnode
Copy link

slnode commented Oct 9, 2016

Can one of the admins verify this patch?

@superkhau superkhau merged commit 99f436a into loopbackio:master Oct 12, 2016
@superkhau superkhau self-assigned this Oct 12, 2016
superkhau pushed a commit that referenced this pull request Oct 12, 2016
superkhau added a commit that referenced this pull request Oct 12, 2016
0candy added a commit that referenced this pull request Oct 14, 2016
 * Add connectorCapabilities global object (#179) (Nicholas Duffy)
 * Accept PGDATABASE env var in test/init.js (#178) (Simon Ho)
 * Remove unused prefix from test env vars (#176) (Simon Ho)
 * Fix #123: Set default value during autoupdate. (#167) (Samuel Reed)
 * Update translation files - round#2 (#170) (Candy)
 * Add translated files (gunjpan)
 * Update deps to loopback 3.0.0 RC (Miroslav Bajtoš)
 * Use juggler@3 for running tests (Candy)
 * Add eslint infrastructure (Loay)
 * Revert "Add eslint infrastructure" (Loay)
 * Fix CI Failure (Loay)
 * test: accept more env vars on CI (Ryan Graham)
 * test: use 'emptytest' database as default (Ryan Graham)
 * test: seed DB with test schema before running (Ryan Graham)
 * test: separate dbconfig from datasource (Ryan Graham)
 * test: replace tables.sql with full schema dump (Ryan Graham)
 * Refactor (jannyHou)
 * Upgrade version (jannyHou)
 * Globalize discover.js (jannyHou)
 * Update URLs in CONTRIBUTING.md (#150) (Ryan Graham)
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