Skip to content

Add connectorCapabilities global object #24

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

Merged
merged 1 commit into from
Oct 12, 2016
Merged

Add connectorCapabilities global object #24

merged 1 commit into from
Oct 12, 2016

Conversation

duffn
Copy link
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

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

slnode commented Oct 8, 2016

Can one of the admins verify this patch?

1 similar comment
@slnode
Copy link

slnode commented Oct 8, 2016

Can one of the admins verify this patch?

@superkhau
Copy link
Contributor

@rmg Is there a way to only have @slnode message us once instead of 3 times?

@superkhau superkhau merged commit 0e92b6b into loopbackio:master Oct 12, 2016
superkhau pushed a commit that referenced this pull request Oct 12, 2016
@superkhau superkhau self-assigned this Oct 12, 2016
superkhau added a commit that referenced this pull request Oct 12, 2016
raymondfeng added a commit that referenced this pull request Aug 27, 2018
 * upgrade deps (Raymond Feng)
 * Replicate .github from loopback repo (Siddhi Pai)
 * Remove unused CI config (Simon Ho)
 * Add CI config to package.json (Simon Ho)
 * Start 3.x + drop support for Node v0.10/v0.12 (siddhipai)
 * Drop support for Node v0.10 and v0.12 (Siddhi Pai)
 * Start the development of the next major version (Siddhi Pai)
 * Update README.md (#27) (Rand McKinney)
 * Update readme (Amir Jafarian)
 * Add connectorCapabilities global object (#24) (Nicholas Duffy)
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