Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
Merge pull request #165 from trufflesuite/feature/tests
Browse files Browse the repository at this point in the history
Feature/tests
  • Loading branch information
cds-amal authored Jan 22, 2019
2 parents 849afaa + f211093 commit a7851b1
Show file tree
Hide file tree
Showing 24 changed files with 11,987 additions and 1,607 deletions.
11 changes: 9 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"extends": ["standard"]
}
"extends": ["standard", "plugin:jest/recommended"],
"plugins": ["jest"],
"rules": {
"jest/prefer-to-have-length": "warn",
},
"env" : {
"jest/globals": true
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.DS_Store
.DS_Store
.tern-project
36 changes: 22 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ How Can I Contribute?

All contributions are welcome!

If you run into an issue, the first step is to reach out in [our community Gitter channel](https://gitter.im/ConsenSys/truffle),
in case others have run into the problem or know how to help.
If you run into an issue, the first step is to reach out in [our community
Gitter channel](https://gitter.im/ConsenSys/truffle), in case others have run
into the problem or know how to help.

To report a problem or to suggest a new feature, [open a GitHub Issue](https://github.com/trufflesuite/drizzle/issues/new).
This will help the Drizzle maintainers become aware of the problem and prioritize
a fix.
To report a problem or to suggest a new feature, [open a GitHub
Issue](https://github.com/trufflesuite/drizzle/issues/new). This will help the
Drizzle maintainers become aware of the problem and prioritize a fix.

For code contributions, for either new features or bug fixes, see [Development](#development).
For code contributions, for either new features or bug fixes, see
[Development](#development).

If you're looking to make a substantial change, you may want to reach out first
to give us a heads up.
Expand All @@ -47,13 +49,17 @@ Development

### Overview

Drizzle has two companion libraries ([`drizzle-react`](https://github.com/trufflesuite/drizzle-react) and [`drizzle-react-components`](https://github.com/trufflesuite/drizzle-react-components)), each with their own
NPM packages.
Drizzle has two companion libraries
([`drizzle-react`](https://github.com/trufflesuite/drizzle-react) and
[`drizzle-react-components`](https://github.com/trufflesuite/drizzle-react-components)),
each with their own NPM packages.

The content of this guide applies to those companion libraries as well.

This repository ([trufflesuite/drizzle](https://github.com/trufflesuite/drizzle))
contains the core logic for storing and updating chaindata in a [Redux](https://github.com/reduxjs/redux) store.
This repository
([trufflesuite/drizzle](https://github.com/trufflesuite/drizzle)) contains the
core logic for storing and updating chaindata in a
[Redux](https://github.com/reduxjs/redux) store.

### Development Requirements

Expand All @@ -69,8 +75,9 @@ First clone this repository and install NPM dependencies:
$ git clone [email protected]:trufflesuite/drizzle.git
$ cd drizzle
$ npm install
$ npm test

Then, run the build command :
If all is good, then run the build command :

$ npm run build

Expand All @@ -87,11 +94,12 @@ You're ready to use your local developement version of Drizzle in your project.

### Forks, Branches, and Pull Requests

Community contributions to Drizzle require that you first fork the
repositor(y|ies) you are modifying. After your modifications, push changes to
Community contributions to Drizzle require that you first fork each
repository you wish to modify. After your modifications, push changes to
your fork(s) and submit a pull request upstream to `trufflesuite`'s fork(s).

See GitHub documentation about [Collaborating with issues and pull requests](https://help.github.com/categories/collaborating-with-issues-and-pull-requests/)
See GitHub documentation about [Collaborating with issues and pull
requests](https://help.github.com/categories/collaborating-with-issues-and-pull-requests/)
for more information.

> :exclamation: **Note:** _Drizzle development uses a long-lived `develop` branch for new (non-hotfix)
Expand Down
17 changes: 17 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html

module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,

// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
modulePathIgnorePatterns: ['<rootDir>[/\\\\](dist|node_modules)[/\\\\]'],

// The test environment that will be used for testing
testEnvironment: '<rootDir>/test/environments/ganache-environment.js',

transform: {
'^.+\\.js': '<rootDir>/jest.transform.js'
}
}
8 changes: 8 additions & 0 deletions jest.transform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const babelJest = require('babel-jest')
const webpackConfig = require('./webpack/base.config')

/* Jest needs to know how to transform our source. Use the same transformation
* options/rules specified in webpack configuration.
*/
const { options: babelOptions } = webpackConfig.module.rules[0]
module.exports = babelJest.createTransformer(babelOptions)
Loading

0 comments on commit a7851b1

Please sign in to comment.