Skip to content

Commit

Permalink
chore(lib): cleanup lib, upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
vvo committed Jan 3, 2017
1 parent 919a766 commit 44ee04d
Show file tree
Hide file tree
Showing 14 changed files with 4,799 additions and 86 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015", "stage-2", "react"]
}
6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
"extends": "algolia"
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
index-dist.js
node_modules/
npm-debug.log
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
.babelrc
.eslintignore
.eslintrc.js
.travis.yml
*.js
!index-dist.js
mocha.opts
screenshot.png
15 changes: 3 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
language: node_js
node_js: 4
install: npm install
script:
- npm test
before_cache: npm prune
node_js: stable
branches:
only:
- master
- develop
# force container based infra
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure
sudo: false
cache:
directories:
- node_modules
- /^greenkeeper-.*$/
cache: yarn
62 changes: 22 additions & 40 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,60 @@



<a name="2.5.0"></a>
# [2.5.0](https://github.com/algolia/expect-jsx/compare/v2.5.1...v2.5.0) (2016-04-15)
<a name="2.5.1"></a>
## [2.5.1](https://github.com/algolia/expect-jsx/compare/v2.5.0...v2.5.1) (2016-04-15)


### Bug Fixes


<a name="2.4.0"></a>
# [2.4.0](https://github.com/algolia/expect-jsx/compare/v2.5.0...v2.4.0) (2016-04-15)
* **deps:** allow react 0.14 ([1fff6f1](https://github.com/algolia/expect-jsx/commit/1fff6f1))



<a name="2.5.0"></a>
# [2.5.0](https://github.com/algolia/expect-jsx/compare/2.4.0...v2.5.0) (2016-04-15)

<a name="2.3.0"></a>
# [2.3.0](https://github.com/algolia/expect-jsx/compare/2.4.0...v2.3.0) (2016-03-09)

### Features

* **React:** React v15 stable compat ([7557e63](https://github.com/algolia/expect-jsx/commit/7557e63))


<a name="2.2.2"></a>
## [2.2.2](https://github.com/algolia/expect-jsx/compare/2.3.0...v2.2.2) (2016-02-02)

<a name="2.4.0"></a>
# [2.4.0](https://github.com/algolia/expect-jsx/compare/2.3.0...2.4.0) (2016-03-09)



<a name="2.2.2"></a>
## [2.2.2](https://github.com/algolia/expect-jsx/compare/v2.2.1...v2.2.2) (2016-01-05)

<a name="2.3.0"></a>
# [2.3.0](https://github.com/algolia/expect-jsx/compare/v2.2.2...2.3.0) (2016-02-02)



<a name="2.2.0"></a>
# [2.2.0](https://github.com/algolia/expect-jsx/compare/v2.1.3...v2.2.0) (2015-12-08)
<a name="2.2.2"></a>
## [2.2.2](https://github.com/algolia/expect-jsx/compare/v2.2.1...v2.2.2) (2016-01-05)

### Features

* add toNotIncludeJSX ([72740a6](https://github.com/algolia/expect-jsx/commit/72740a67e87e1ddeaea2c3026796a626dc2cdaae))

<a name="2.1.3"></a>
## [2.1.3](https://github.com/algolia/expect-jsx/compare/v2.1.0...v2.1.3) (2015-11-30)
<a name="2.2.1"></a>
## [2.2.1](https://github.com/algolia/expect-jsx/compare/v2.2.0...v2.2.1) (2015-12-10)


### Bug Fixes

* handle {number} and {false} {true} cases ([0a4ccf5](https://github.com/algolia/expect-jsx/commit/0a4ccf5))
* stop replacing with <whitespace> ([b109405](https://github.com/algolia/expect-jsx/commit/b109405))
* **to-jsx:** upgrade react-element-to-jsx-string, provide Array.fill polyfill ([19ddde5](https://github.com/algolia/expect-jsx/commit/19ddde5))
* **dep:** update underlying react-element-to-jsx-string to 2.1.4 ([cd963cf](https://github.com/algolia/expect-jsx/commit/cd963cf))



<a name="2.1.2"></a>
## [2.1.2](https://github.com/algolia/expect-jsx/compare/v2.1.0...v2.1.2) (2015-11-08)
<a name="2.2.0"></a>
# [2.2.0](https://github.com/algolia/expect-jsx/compare/v2.1.3...v2.2.0) (2015-12-08)


### Bug Fixes

* handle {number} and {false} {true} cases ([0a4ccf5](https://github.com/algolia/expect-jsx/commit/0a4ccf5))
* stop replacing with <whitespace> ([b109405](https://github.com/algolia/expect-jsx/commit/b109405))



<a name="2.1.1"></a>
## [2.1.1](https://github.com/algolia/expect-jsx/compare/v2.1.0...v2.1.1) (2015-11-08)


### Bug Fixes

* handle {number} and {false} {true} cases ([0a4ccf5](https://github.com/algolia/expect-jsx/commit/0a4ccf5))
* **to-jsx:** upgrade react-element-to-jsx-string, provide Array.fill polyfill ([19ddde5](https://github.com/algolia/expect-jsx/commit/19ddde5))



Expand Down Expand Up @@ -101,6 +88,7 @@

* change package name to expect-jsx ([665ed66](https://github.com/algolia/expect-jsx/commit/665ed66)), closes [#3](https://github.com/algolia/expect-jsx/issues/3)


### Features

* add toNotEqualJSX, toIncludeJSX, change default export ([6402777](https://github.com/algolia/expect-jsx/commit/6402777)), closes [#2](https://github.com/algolia/expect-jsx/issues/2) [#4](https://github.com/algolia/expect-jsx/issues/4) [#5](https://github.com/algolia/expect-jsx/issues/5) [#6](https://github.com/algolia/expect-jsx/issues/6)
Expand Down Expand Up @@ -191,7 +179,7 @@ expect.extend(expectJSX);


<a name="1.0.1"></a>
## 1.0.1 (2015-10-15)
## [1.0.1](https://github.com/algolia/expect-jsx/compare/df977b4...v1.0.1) (2015-10-15)


### Bug Fixes
Expand All @@ -200,9 +188,3 @@ expect.extend(expectJSX);



<a name="1.0.0"></a>
# 1.0.0 (2015-10-15)




10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ It uses [algolia/react-element-to-jsx-string](https://github.com/algolia/react-e
You will most probably use this plugin as a development dependency.

```sh
npm install expect-jsx --save-dev
yarn add expect-jsx --dev
```

## API
Expand Down Expand Up @@ -90,15 +90,15 @@ It's your responsibility to then unit test those functions.
## Test

```sh
npm test
npm run test:watch
yarn test
yarn test:watch
```

## Build

```sh
npm run build
npm run build:watch
yarn build
yarn build:watch
```

## Similar projects
Expand Down
14 changes: 7 additions & 7 deletions index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ describe('expect(ReactElement).toEqualJSX(ReactElement)', () => {
} catch (err) {
expect(err instanceof Error).toBe(true);
expect(err.message)
.toEqual(`Expected '<TestComponent extra="neous" />' to equal '<TestComponent />'`);
.toEqual('Expected \'<TestComponent extra="neous" />\' to equal \'<TestComponent />\'');
}
});

it('does not care about function', () => {
var fns = {
one() {return 'one';},
two() {return 'two';}
const fns = {
one() { return 'one'; },
two() { return 'two'; },
};

expect(
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('expect(ReactElement).toEqualJSX(ReactElement)', () => {
expect(<div />).toNotEqualJSX(<div />);
} catch (err) {
expect(err instanceof Error).toBe(true);
expect(err.message).toEqual(`Expected '<div />' to not equal '<div />'`);
expect(err.message).toEqual('Expected \'<div />\' to not equal \'<div />\'');
}
});
});
Expand All @@ -95,7 +95,7 @@ describe('expect(ReactElement).toEqualJSX(ReactElement)', () => {
expect(<div />).toIncludeJSX(<div Hello=", world!" />);
} catch (err) {
expect(err instanceof Error).toBe(true);
expect(err.message).toEqual(`Expected '<div />' to include '<div Hello=", world!" />'`);
expect(err.message).toEqual('Expected \'<div />\' to include \'<div Hello=", world!" />\'');
}
});
});
Expand All @@ -111,7 +111,7 @@ describe('expect(ReactElement).toEqualJSX(ReactElement)', () => {
expect(<div Hello=", world!" />).toNotIncludeJSX(<div Hello=", world!" />);
} catch (err) {
expect(err instanceof Error).toBe(true);
let message = `Expected '<div Hello=", world!" />' to exclude '<div Hello=", world!" />'`;
const message = 'Expected \'<div Hello=", world!" />\' to exclude \'<div Hello=", world!" />\'';
expect(err.message).toEqual(message);
}
});
Expand Down
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react';
import expect from 'expect';
import collapse from 'collapse-white-space';

import reactElementToJSXString from 'react-element-to-jsx-string';

let api = {
const api = {
toEqualJSX(ReactElement) {
return expect(
reactElementToJSXString(this.actual)
Expand Down Expand Up @@ -32,7 +31,7 @@ let api = {
).toExclude(
collapse(reactElementToJSXString(ReactElement))
);
}
},
};

export default api;
2 changes: 1 addition & 1 deletion mocha.opts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
--compilers js:babel/register
--compilers js:babel-register
index-test.js
39 changes: 27 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,45 @@
"build": "babel index.js -o index-dist.js",
"build:watch": "babel index.js -o index-dist.js -w",
"test": "mocha --opts mocha.opts && eslint .",
"test:watch": "mocha --opts mocha.opts --watch --reporter min"
"test:watch": "mocha --opts mocha.opts --watch --reporter min",
"release": "./release.sh"
},
"author": {
"name": "Algolia, Inc.",
"url": "https://github.com/algolia"
},
"author": "Algolia <support@algolia.com> (https://github.com/algolia/)",
"license": "MIT",
"dependencies": {
"collapse-white-space": "^1.0.0",
"react": "^0.14.8 || ^15.0.1",
"react-element-to-jsx-string": "^3.0.0"
"react-element-to-jsx-string": "^6.0.0"
},
"repository": "algolia/expect-jsx",
"keywords": [
"expect",
"expect-extension"
"expect-extension",
"jsx",
"string"
],
"devDependencies": {
"babel": "^5.8.29",
"babel-eslint": "^4.1.8",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^1.0.0",
"eslint-config-algolia": "^4.6.0",
"eslint-plugin-algolia": "^1.5.0",
"eslint-plugin-react": "^4.2.3",
"babel-cli": "^6.18.0",
"babel-eslint": "^7.1.1",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-2": "^6.18.0",
"babel-register": "^6.18.0",
"conventional-changelog-cli": "^1.2.0",
"doctoc": "^1.2.0",
"eslint": "^3.12.2",
"eslint-config-algolia": "^6.0.1",
"eslint-import-resolver-webpack": "^0.8.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jasmine": "^2.2.0",
"eslint-plugin-react": "^6.8.0",
"expect": "^1.14.0",
"mocha": "^2.4.5",
"json": "^9.0.4",
"mocha": "^3.2.0",
"mversion": "^1.10.1",
"react": "^15.0.1"
},
"peerDependencies": {
Expand Down
33 changes: 33 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -e # exit when error

if [[ -n $(npm owner add `npm whoami`) ]]; then
printf "Release: Not an owner of the npm repo, ask for it\n"
exit 1
fi

currentBranch=`git rev-parse --abbrev-ref HEAD`
if [ $currentBranch != 'master' ]; then
printf "Release: You must be on master\n"
exit 1
fi

if [[ -n $(git status --porcelain) ]]; then
printf "Release: Working tree is not clean (git status)\n"
exit 1
fi

if [[ $# -eq 0 ]] ; then
printf "Release: use ``yarn release [major|minor|patch|x.x.x]``\n"
exit 1
fi

mversion $1
conventional-changelog --infile CHANGELOG.md --same-file --preset angular
doctoc README.md
git commit -am "$(json -f package.json version)"
git tag v`json -f package.json version`
git push
git push --tags
npm publish
Loading

0 comments on commit 44ee04d

Please sign in to comment.