Skip to content

Commit

Permalink
Merge pull request #335 from SimonSimCity/chai-puppeteer
Browse files Browse the repository at this point in the history
Use chai by npm and replace chrome by puppeteer
  • Loading branch information
theodorDiaconu authored Mar 5, 2020
2 parents 29d89fa + 30a53f6 commit 93f05d3
Show file tree
Hide file tree
Showing 30 changed files with 73 additions and 45 deletions.
56 changes: 33 additions & 23 deletions .npm/package/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 5 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
sudo: required
addons:
chrome: stable

dist: xenial

services:
- xvfb
- redis-server

language: node_js
Expand All @@ -19,17 +12,14 @@ before_install:

cache:
directories:
- ~/.npm
- "node_modules"
- $HOME/.npm
- $HOME/.meteor

notifications:
email: false

before_script:
- sleep 3

script:
- meteor create --release 1.8.1-rc.1 --bare test
- meteor create --release 1.8.1 --bare test
- cd test
- meteor npm i --save [email protected] [email protected] simpl-schema chai
- METEOR_PACKAGE_DIRS="../" TEST_BROWSER_DRIVER=chrome meteor test-packages --once --driver-package meteortesting:mocha ../
- meteor npm i --save [email protected] simpl-schema chai
- METEOR_PACKAGE_DIRS="../" TEST_BROWSER_DRIVER=puppeteer meteor test-packages --raw-logs --once --driver-package meteortesting:mocha ../
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ It is also always helpful to have some context for your pull request. What was t

### Setup
```
meteor create --release 1.8.1-rc.1 --bare test
meteor create --release 1.8.1 --bare test
cd test
meteor npm i --save [email protected] [email protected] simpl-schema
meteor npm i --save [email protected] simpl-schema
```

### Start Tests
```
METEOR_PACKAGE_DIRS="../" TEST_BROWSER_DRIVER=chrome meteor test-packages --once --driver-package meteortesting:mocha ../
METEOR_PACKAGE_DIRS="../" TEST_BROWSER_DRIVER=puppeteer meteor test-packages --raw-logs --once --driver-package meteortesting:mocha ../
```

## Financial contributions
Expand Down
1 change: 1 addition & 0 deletions lib/cache/testing/filterFieldsForFetching.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {filterDisallowedFields, filterAllowedFields} from '../lib/filterFieldsForFetching';

describe('Filter fields for fetching', function () {
Expand Down
1 change: 1 addition & 0 deletions lib/processors/testing/getStrategy.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import getStrategy from '../getStrategy';
import { Strategy } from '../../constants';
import { _ } from 'meteor/underscore';
Expand Down
1 change: 1 addition & 0 deletions lib/processors/testing/synthetic.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import process from '../synthetic';
import { Events } from '../../constants';
import { MongoIDMap } from '../../cache/mongoIdMap';
Expand Down
1 change: 1 addition & 0 deletions lib/redis/testing/getFieldsOfInterestFromAll.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import { removeChildrenOfParents } from '../lib/getFieldsOfInterestFromAll';

describe('#removeChildrenOfParents ', function() {
Expand Down
1 change: 1 addition & 0 deletions lib/utils/testing/extractIdsFromSelector.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import run from '../extractIdsFromSelector';

describe('Unit # extractIdsFromSelector', function () {
Expand Down
1 change: 1 addition & 0 deletions lib/utils/testing/getFields.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import run from '../getFields';

describe('Unit # getFields', function () {
Expand Down
8 changes: 4 additions & 4 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Package.describe({
git: 'https://github.com/cult-of-coders/redis-oplog',
// By default, Meteor will default to using README.md for documentation.
// To avoid submitting documentation, set this field to null.
documentation: 'README.md',
documentation: 'README.md'
});

Npm.depends({
redis: '2.8.0',
'deep-extend': '0.5.0',
'lodash.clonedeep': '4.5.0',
'lodash.clonedeep': '4.5.0'
});

Package.onUse(function(api) {
Expand All @@ -29,7 +29,7 @@ Package.onUse(function(api) {
'diff-sequence',
'id-map',
'mongo-id',
'tracker',
'tracker'
]);

api.mainModule('redis-oplog.js', 'server');
Expand All @@ -53,7 +53,7 @@ Package.onTest(function(api) {
api.use('matb33:[email protected]');
api.use('alanning:[email protected]');

api.use(['meteortesting:mocha', 'practicalmeteor:chai']);
api.use(['meteortesting:mocha']);

api.mainModule('testing/main.server.js', 'server');
api.addFiles('testing/publishComposite/boot.js', 'server');
Expand Down
1 change: 1 addition & 0 deletions testing/accounts/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {Meteor} from 'meteor/meteor';
import { DDP } from 'meteor/ddp-client';

Expand Down
1 change: 1 addition & 0 deletions testing/client_side_mutators.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {Collections, config} from './boot';
import helperGenerator from './lib/helpers';

Expand Down
1 change: 1 addition & 0 deletions testing/collection-defaults/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {Items} from './collections';
import {_} from 'meteor/underscore';
import {waitForHandleToBeReady, callWithPromise} from '../lib/sync_utils';
Expand Down
1 change: 1 addition & 0 deletions testing/collection_hooks.server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import { _ } from 'meteor/underscore';
import { Random } from 'meteor/random';

Expand Down
2 changes: 2 additions & 0 deletions testing/collection_transform.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { assert } from 'chai';
function Foo () {}

const fooCollection = new Mongo.Collection('foo', {
transform: function(document) {
return new Foo(document)
Expand Down
1 change: 1 addition & 0 deletions testing/custom-publications/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {Items} from './collections';
import {Meteor} from 'meteor/meteor';
import {Counter} from 'meteor/natestrauser:publish-performant-counts'
Expand Down
2 changes: 2 additions & 0 deletions testing/include_prev_doc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { assert } from 'chai';

import { Mongo } from 'meteor/mongo';
import { _ } from 'meteor/underscore';
import Config from '../lib/config';
Expand Down
1 change: 1 addition & 0 deletions testing/initial_add.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {Mongo} from 'meteor/mongo';

const InitialAddCollection = new Mongo.Collection('initial_add')
Expand Down
1 change: 1 addition & 0 deletions testing/main.client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import { Collections, config } from './boot';
import { _ } from 'meteor/underscore';
import './synthetic_mutators';
Expand Down
1 change: 1 addition & 0 deletions testing/object-id/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import { SmartIds } from './collections';
import { Meteor } from 'meteor/meteor';

Expand Down
1 change: 1 addition & 0 deletions testing/observe_callbacks.server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import { Mongo } from 'meteor/mongo';

const Collection = new Mongo.Collection('test_observe_callbacks');
Expand Down
1 change: 1 addition & 0 deletions testing/optimistic-ui/client.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import { Items } from './collections';
import { _ } from 'meteor/underscore';
import { waitForHandleToBeReady, callWithPromise } from '../lib/sync_utils';
Expand Down
1 change: 1 addition & 0 deletions testing/polling/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import { Campaigns } from './collections';
import { Meteor } from 'meteor/meteor';

Expand Down
1 change: 1 addition & 0 deletions testing/publish-counts/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {Items} from './collections';
import {Meteor} from 'meteor/meteor';
import {Counter} from 'meteor/natestrauser:publish-performant-counts'
Expand Down
1 change: 1 addition & 0 deletions testing/publishComposite/client.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {Items, Children} from './collections';
import {_} from 'meteor/underscore';
import {waitForHandleToBeReady, callWithPromise} from '../lib/sync_utils';
Expand Down
1 change: 1 addition & 0 deletions testing/server-autorun/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {Orders, Items} from './collections';
import {Meteor} from 'meteor/meteor';

Expand Down
1 change: 1 addition & 0 deletions testing/synthetic_mutators.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import { Collections, config } from './boot';
import { Random } from 'meteor/random';
import { _ } from 'meteor/underscore';
Expand Down
1 change: 1 addition & 0 deletions testing/transformations/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {Items} from './collections';

describe('Transformations', function () {
Expand Down
1 change: 1 addition & 0 deletions testing/transformations/server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import { Items } from './collections';

Meteor.publish('transformations_items', function() {
Expand Down
1 change: 1 addition & 0 deletions testing/vent/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { assert } from 'chai';
import {waitForHandleToBeReady, callWithPromise} from '../lib/sync_utils';
import {Random} from 'meteor/random';
import {Vent} from 'meteor/cultofcoders:redis-oplog';
Expand Down

0 comments on commit 93f05d3

Please sign in to comment.