Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,20 @@
"scripts": {
"start": "hadron-build develop",
"pretest": "mongodb-runner install && mongodb-runner start --port 27018",
"test": "npm run test-main && npm run test-renderer && hadron-build test",
"test": "hadron-build test",
"posttest": "mongodb-runner stop --port 27018",
"check": "mongodb-js-precommit ./src/app/*.js ./src/app/**/**/*.js ./src/{app/**/*.js,main/**/*.js} ./test/*.js ./src/internal-packages/**/*.js ./src/internal-packages/**/**/*{.js,.jsx} ./src/internal-packages/**/**/**/*{.js,.jsx} ./src/internal-packages/**/**/**/**/*{.js,.jsx}",
"ci": "npm run check && npm run test",
"clean": "hadron-build clean",
"compile-ui": "hadron-build ui",
"fmt": "mongodb-js-fmt ./*.js src/{**/*.js,*.js} test/{**/*.js,*.js}",
"release": "hadron-build release",
"test-functional": "npm test -- --functional",
"test-main": "electron-mocha ./tests/main-process/*.test.js",
"test-packages": "npm test -- --packages",
"test-renderer": "electron-mocha --renderer ./tests/renderer-process/*.test.js",
"test-unit": "npm test -- --unit",
"test-enzyme": "npm test -- --enzyme",
"test-packages": "npm test -- --packages",
"test-main": "npm test -- --main",
"test-renderer": "npm test -- --renderer",
"test-functional": "npm test -- --functional",
"test-release": "npm test -- --release",
"upload": "hadron-build upload",
"evergreen-expansions": "hadron-build info --format=yaml --flatten > expansions.yml"
Expand All @@ -109,7 +110,7 @@
"ampersand-view": "^9.0.0",
"ampersand-view-switcher": "^2.0.0",
"app-migrations": "mongodb-js/app-migrations#v0.1.2",
"async": "^1.5.0",
"async": "^1.5.2",
"babel-register": "^6.7.2",
"backoff": "^2.4.1",
"bootstrap": "https://github.com/twbs/bootstrap/archive/v3.3.5.tar.gz",
Expand Down Expand Up @@ -191,7 +192,7 @@
"electron-prebuilt": "1.2.8",
"enzyme": "^2.5.1",
"eslint-config-mongodb-js": "^2.2.0",
"hadron-build": "^5.1.9",
"hadron-build": "^6.0.1",
"jsdom": "^9.8.3",
"mocha": "^3.1.2",
"mock-require": "^2.0.1",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const React = require('react');
const sinon = require('sinon');
const shallow = require('enzyme').shallow;
const AppRegistry = require('hadron-app-registry');
const Collection = require('../src/internal-packages/collection/lib/components/index');
const TabNavBar = require('../src/internal-packages/app/lib/components/tab-nav-bar');
const Collection = require('../../src/internal-packages/collection/lib/components/index');
const TabNavBar = require('../../src/internal-packages/app/lib/components/tab-nav-bar');

// const debug = require('debug')('compass:collection:test');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const React = require('react');
const sinon = require('sinon');
const {mount} = require('enzyme');
const AppRegistry = require('hadron-app-registry');
const SortableTable = require('../src/internal-packages/app/lib/components/sortable-table');
const TabNavBar = require('../src/internal-packages/app/lib/components/tab-nav-bar');
const SortableTable = require('../../src/internal-packages/app/lib/components/sortable-table');
const TabNavBar = require('../../src/internal-packages/app/lib/components/tab-nav-bar');

chai.use(chaiEnzyme());

Expand All @@ -35,7 +35,7 @@ describe('<CollectionsTable />', () => {
// but got: undefined. Check the render method of `DatabasesTable`.
app.appRegistry.registerComponent('App.SortableTable', SortableTable);

this.CollectionsTable = require('../src/internal-packages/database/lib/components/collections-table');
this.CollectionsTable = require('../../src/internal-packages/database/lib/components/collections-table');
});
afterEach(() => {
// Restore properties on the global app object,
Expand Down
4 changes: 2 additions & 2 deletions test/crud.test.js → test/enzyme/crud.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const crudActions = {
closeAllMenus: closeAllMenusSpy
};

mock('../src/internal-packages/crud/lib/actions', crudActions);
mock('../../src/internal-packages/crud/lib/actions', crudActions);

const React = require('react');
const Element = require('hadron-document').Element;
const LineNumber = require('../src/internal-packages/crud/lib/component/line-number');
const LineNumber = require('../../src/internal-packages/crud/lib/component/line-number');

// use chai-enzyme assertions, see https://github.com/producthunt/chai-enzyme
chai.use(chaiEnzyme());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const React = require('react');
const sinon = require('sinon');
const {mount, shallow} = require('enzyme');
const AppRegistry = require('hadron-app-registry');
const CreateCollectionCheckbox = require('../src/internal-packages/database/lib/components/create-collection-checkbox');
const CreateCollectionInput = require('../src/internal-packages/database/lib/components/create-collection-input');
const CreateCollectionSizeInput = require('../src/internal-packages/database/lib/components/create-collection-size-input');
const SortableTable = require('../src/internal-packages/app/lib/components/sortable-table');
const TabNavBar = require('../src/internal-packages/app/lib/components/tab-nav-bar');
const CreateCollectionCheckbox = require('../../src/internal-packages/database/lib/components/create-collection-checkbox');
const CreateCollectionInput = require('../../src/internal-packages/database/lib/components/create-collection-input');
const CreateCollectionSizeInput = require('../../src/internal-packages/database/lib/components/create-collection-size-input');
const SortableTable = require('../../src/internal-packages/app/lib/components/sortable-table');
const TabNavBar = require('../../src/internal-packages/app/lib/components/tab-nav-bar');

// use chai-enzyme assertions, see https://github.com/producthunt/chai-enzyme
chai.use(chaiEnzyme());
Expand Down Expand Up @@ -57,7 +57,7 @@ describe('<DatabasesTable />', () => {
app.appRegistry.registerComponent('Database.CreateCollectionInput', CreateCollectionInput);
app.appRegistry.registerComponent('Database.CreateCollectionSizeInput', CreateCollectionSizeInput);

this.DatabasesTable = require('../src/internal-packages/server-stats/lib/component/databases-table');
this.DatabasesTable = require('../../src/internal-packages/server-stats/lib/component/databases-table');
});
afterEach(() => {
// Restore properties on the global app object,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ const expect = chai.expect;
const React = require('react');
const {mount, shallow} = require('enzyme');

const SizeColumn = require('../src/internal-packages/indexes/lib/component/size-column');
const UsageColumn = require('../src/internal-packages/indexes/lib/component/usage-column');
const SizeColumn = require('../../src/internal-packages/indexes/lib/component/size-column');
const UsageColumn = require('../../src/internal-packages/indexes/lib/component/usage-column');

chai.use(chaiEnzyme());

require('../src/app/reflux-listen-to-external-store.js');
require('../../src/app/reflux-listen-to-external-store.js');

describe('<Indexes />', () => {
let component;
Expand All @@ -36,7 +36,7 @@ describe('<Indexes />', () => {
app.appRegistry = new AppRegistry();
app.instance = {build: {version: '3.2.0'}};

this.CreateIndexButton = require('../src/internal-packages/indexes/lib/component/create-index-button');
this.CreateIndexButton = require('../../src/internal-packages/indexes/lib/component/create-index-button');
});
afterEach(function() {
// Restore properties on the global app object,
Expand Down
4 changes: 2 additions & 2 deletions test/rtss.test.js → test/enzyme/rtss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const expect = chai.expect;
const React = require('react');
const {shallow} = require('enzyme');
const AppRegistry = require('hadron-app-registry');
const StatusRow = require('../src/internal-packages/app/lib/components/status-row');
const StatusRow = require('../../src/internal-packages/app/lib/components/status-row');

chai.use(chaiEnzyme());

Expand All @@ -20,7 +20,7 @@ describe('rtss', () => {
// appRegistry.getComponent (i.e. appRegistry being undefined)
app.appRegistry = new AppRegistry();
app.appRegistry.registerComponent('App.StatusRow', StatusRow);
this.performance = require('../src/internal-packages/server-stats/lib/component/performance-component');
this.performance = require('../../src/internal-packages/server-stats/lib/component/performance-component');
});
afterEach(() => {
// Restore properties on the global app object,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('<SamplingMessage />', () => {
app.appRegistry.registerAction('CRUD.Actions', sinon.spy());
app.appRegistry.registerStore('CRUD.ResetDocumentListStore', sinon.spy());

this.SamplingMessage = require('../src/internal-packages/query/lib/component/sampling-message');
this.SamplingMessage = require('../../src/internal-packages/query/lib/component/sampling-message');
});
afterEach(() => {
// Restore properties on the global app object,
Expand Down
20 changes: 10 additions & 10 deletions test/schema.field.test.js → test/enzyme/schema.field.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,29 @@ describe('<Schema />', () => {
// appRegistry.getComponent (i.e. appRegistry being undefined)
app.appRegistry = new AppRegistry();
// register QueryStore
require('../src/internal-packages/query').activate();
require('../../src/internal-packages/query').activate();
});
after(function() {
// unregister QueryStore
require('../src/internal-packages/query').deactivate();
require('../../src/internal-packages/query').deactivate();
// Restore properties on the global app object,
// so they don't affect other tests
app.appRegistry = appRegistry;
});

context('when adding fields to the schema view', () => {
it('renders field types', () => {
const Field = require('../src/internal-packages/schema/lib/component/field');
const Type = require('../src/internal-packages/schema/lib/component/type');
const Field = require('../../src/internal-packages/schema/lib/component/field');
const Type = require('../../src/internal-packages/schema/lib/component/type');

fieldProp.types = typesWithUndefined;
component = mount(<Field {...fieldProp} />);
expect(component.find(Type)).to.have.length(2);
});

it('renders the first type as string', () => {
const Field = require('../src/internal-packages/schema/lib/component/field');
const Type = require('../src/internal-packages/schema/lib/component/type');
const Field = require('../../src/internal-packages/schema/lib/component/field');
const Type = require('../../src/internal-packages/schema/lib/component/type');

fieldProp.types = typesWithUndefined;
component = mount(<Field {...fieldProp} />);
Expand All @@ -113,8 +113,8 @@ describe('<Schema />', () => {
});

it('renders the second type as undefined', () => {
const Field = require('../src/internal-packages/schema/lib/component/field');
const Type = require('../src/internal-packages/schema/lib/component/type');
const Field = require('../../src/internal-packages/schema/lib/component/field');
const Type = require('../../src/internal-packages/schema/lib/component/type');

fieldProp.types = typesWithUndefined;
component = mount(<Field {...fieldProp} />);
Expand All @@ -124,8 +124,8 @@ describe('<Schema />', () => {

context('when rendering multiple fields', () => {
it('renders type with highest probability first', () => {
const Field = require('../src/internal-packages/schema/lib/component/field');
const Type = require('../src/internal-packages/schema/lib/component/type');
const Field = require('../../src/internal-packages/schema/lib/component/field');
const Type = require('../../src/internal-packages/schema/lib/component/type');

fieldProp.types = typesWithMultiple;
component = mount(<Field {...fieldProp} />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ describe('<Minichart />', () => {
// appRegistry.getComponent (i.e. appRegistry being undefined)
app.appRegistry = new AppRegistry();
// register QueryStore
require('../src/internal-packages/query').activate();
require('../../src/internal-packages/query').activate();
});
after(function() {
// unregister QueryStore
require('../src/internal-packages/query').deactivate();
require('../../src/internal-packages/query').deactivate();
// Restore properties on the global app object,
// so they don't affect other tests
app.appRegistry = appRegistry;
Expand All @@ -46,8 +46,8 @@ describe('<Minichart />', () => {
};

it('renders a D3Component minichart', () => {
const Minichart = require('../src/internal-packages/schema/lib/component/minichart');
const D3Component = require('../src/internal-packages/schema/lib/component/d3component');
const Minichart = require('../../src/internal-packages/schema/lib/component/minichart');
const D3Component = require('../../src/internal-packages/schema/lib/component/d3component');

const wrapper = shallow(
<Minichart
Expand All @@ -73,8 +73,8 @@ describe('<Minichart />', () => {
};

it('renders a unique minichart', () => {
const Minichart = require('../src/internal-packages/schema/lib/component/minichart');
const UniqueMinichart = require('../src/internal-packages/schema/lib/component/unique');
const Minichart = require('../../src/internal-packages/schema/lib/component/minichart');
const UniqueMinichart = require('../../src/internal-packages/schema/lib/component/unique');

const wrapper = shallow(
<Minichart
Expand All @@ -85,7 +85,7 @@ describe('<Minichart />', () => {
});

it('has a unique bubble for each datum', () => {
const Minichart = require('../src/internal-packages/schema/lib/component/minichart');
const Minichart = require('../../src/internal-packages/schema/lib/component/minichart');
const wrapper = mount(
<Minichart
fieldName="test_unique_longs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const expect = chai.expect;
const React = require('react');

const shallow = require('enzyme').shallow;
const SidebarInstanceProperties = require('../src/internal-packages/sidebar/lib/components/sidebar-instance-properties');
const SidebarInstanceProperties = require('../../src/internal-packages/sidebar/lib/components/sidebar-instance-properties');

chai.use(chaiEnzyme());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const sinon = require('sinon');
const shallow = require('enzyme').shallow;
const mount = require('enzyme').mount;
const bootstrap = require('react-bootstrap');
const SortableTable = require('../src/internal-packages/app/lib/components/sortable-table');
const SortableTable = require('../../src/internal-packages/app/lib/components/sortable-table');

chai.use(chaiEnzyme());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const shallow = require('enzyme').shallow;
const mount = require('enzyme').mount;
const bootstrap = require('react-bootstrap');
const FormControl = bootstrap.FormControl;
const RangeInput = require('../src/internal-packages/validation/lib/components/common/range-input');
const RuleCategoryRange = require('../src/internal-packages/validation/lib/components/rule-categories/range');
const RangeInput = require('../../src/internal-packages/validation/lib/components/common/range-input');
const RuleCategoryRange = require('../../src/internal-packages/validation/lib/components/rule-categories/range');

const debug = require('debug')('mongodb-compass:test:validation');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('<RuleBuilder />', () => {
// appRegistry.getComponent (i.e. appRegistry being undefined)
app.appRegistry = new AppRegistry();

this.RuleBuilder = require('../src/internal-packages/validation/lib/components/rule-builder');
this.RuleBuilder = require('../../src/internal-packages/validation/lib/components/rule-builder');
});
afterEach(() => {
// Restore properties on the global app object,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const React = require('react');

const mount = require('enzyme').mount;
const shallow = require('enzyme').shallow;
const Rule = require('../src/internal-packages/validation/lib/components/rule');
const RuleCategoryRange = require('../src/internal-packages/validation/lib/components/rule-categories/range');
const RuleCategorySelector = require('../src/internal-packages/validation/lib/components/rule-category-selector');
const Rule = require('../../src/internal-packages/validation/lib/components/rule');
const RuleCategoryRange = require('../../src/internal-packages/validation/lib/components/rule-categories/range');
const RuleCategorySelector = require('../../src/internal-packages/validation/lib/components/rule-category-selector');
const _ = require('lodash');

// const debug = require('debug')('compass:validation:test');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ function addInputCommands(client) {
* @returns {Application} The spectron application.
*/
function createApplication() {
const dir = path.join(__dirname, '..', '..');
const dir = path.join(__dirname, '..', '..', '..');
/* Force the node env to testing */
process.env.NODE_ENV = 'testing';
return new Application({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
const { expect } = require('chai');
const app = require('ampersand-app');

require('../src/app/reflux-listen-to-external-store.js');
require('../../src/app/reflux-listen-to-external-store.js');

const CollectionsStore = require('../src/internal-packages/database/lib/stores/collections-store');
const InstanceStore = require('../src/internal-packages/app/lib/stores/instance-store');
const CollectionsStore = require('../../src/internal-packages/database/lib/stores/collections-store');
const InstanceStore = require('../../src/internal-packages/app/lib/stores/instance-store');
const { NamespaceStore } = require('hadron-reflux-store');

describe('CollectionsStore', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ const AppRegistry = require('hadron-app-registry');
const { NamespaceStore } = require('hadron-reflux-store');
const sinon = require('sinon');

const root = '../src/internal-packages/';
const root = '../../src/internal-packages/';
const storeKeyMap = {
'CollectionStore': root + 'app/lib/stores/collection-store',
'LoadIndexesStore': root + 'indexes/lib/store/load-indexes-store',
'Schema.Store': root + 'schema/lib/store',
'Query.ChangedStore': root + 'query/lib/store/query-changed-store'
};
require('../src/app/reflux-listen-to-external-store.js');
require('../../src/app/reflux-listen-to-external-store.js');

const CreateIndexStore = require('../src/internal-packages/indexes/lib/store/create-index-store');
const Collection = require('../src/internal-packages/collection/lib/components/index');
const CreateIndexStore = require('../../src/internal-packages/indexes/lib/store/create-index-store');
const Collection = require('../../src/internal-packages/collection/lib/components/index');

describe('CreateIndexesStore', function() {
let unsubscribe;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint no-var: 0 */
var inValueRange = require('../src/internal-packages/query/lib/util').inValueRange;
var inValueRange = require('../../src/internal-packages/query/lib/util').inValueRange;
var assert = require('assert');
var bson = require('bson');

Expand Down
6 changes: 3 additions & 3 deletions test/query.store.test.js → test/unit/query.store.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint no-unused-expressions: 0 */

const expect = require('chai').expect;
const IndexesActions = require('../src/internal-packages/indexes/lib/action/index-actions');
const QueryStore = require('../src/internal-packages/query/lib/store/query-store');
const QueryChangedStore = require('../src/internal-packages/query/lib/store/query-changed-store');
const IndexesActions = require('../../src/internal-packages/indexes/lib/action/index-actions');
const QueryStore = require('../../src/internal-packages/query/lib/store/query-store');
const QueryChangedStore = require('../../src/internal-packages/query/lib/store/query-changed-store');
const sinon = require('sinon');

describe('QueryChangedStore', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint no-unused-expressions: 0 */

const expect = require('chai').expect;
const ValidationStore = require('../src/internal-packages/validation/lib/stores');
const ValidationStore = require('../../src/internal-packages/validation/lib/stores');
const sinon = require('sinon');
const _ = require('lodash');

Expand Down