This repository has been archived by the owner on Sep 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #165 from trufflesuite/feature/tests
Feature/tests
- Loading branch information
Showing
24 changed files
with
11,987 additions
and
1,607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
.DS_Store | ||
.DS_Store | ||
.tern-project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
@@ -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 | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.