Skip to content

Add connectorCapabilities global object#24

Merged
superkhau merged 1 commit intoloopbackio:masterfrom
duffn:connector-capabilities
Oct 12, 2016
Merged

Add connectorCapabilities global object#24
superkhau merged 1 commit intoloopbackio:masterfrom
duffn:connector-capabilities

Conversation

@duffn
Copy link
Copy Markdown
Contributor

@duffn duffn commented Oct 8, 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
Copy Markdown

slnode commented Oct 8, 2016

Can one of the admins verify this patch?

@slnode
Copy link
Copy Markdown

slnode commented Oct 8, 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
Copy Markdown

slnode commented Oct 8, 2016

Can one of the admins verify this patch?

@superkhau superkhau merged commit e03ebd2 into loopbackio:master 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
qpresley pushed a commit that referenced this pull request Nov 2, 2016
 * remove connect/lazyconnect (#27) (Quentin Presley)
 * Add initial settings config (#26) (Quentin Presley)
 * Add connectorCapabilities global object (#24) (Nicholas Duffy)
 * Redirect users to log issues in loopback (Candy)
 * deps: remove extraneous dependencies (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.

3 participants