Repository: astorije/chai-immutable
Branch: master
Commit: 7be3ba70de16
Files: 17
Total size: 99.1 KB
Directory structure:
gitextract_3143o6vx/
├── .eslintrc.yml
├── .gitignore
├── .npmrc
├── .nycrc
├── .prettierignore
├── .prettierrc.yml
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── appveyor.yml
├── chai-immutable.js
├── package.json
├── renovate.json
└── test/
├── .eslintrc.yml
├── index.html
└── test.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .eslintrc.yml
================================================
root: true
env:
commonjs: true
es6: true
extends:
- eslint:recommended
- prettier
rules:
## Possible Errors
for-direction: error
no-prototype-builtins: error
no-template-curly-in-string: error
## Best Practices
array-callback-return: error
block-scoped-var: error
complexity:
- error
- 16
consistent-return: error
curly: error
default-case: error
dot-notation: error
eqeqeq: error
guard-for-in: error
no-alert: error
no-caller: error
no-div-regex: error
no-empty-function: error
no-empty-pattern: error
no-eq-null: error
no-eval: error
no-extend-native: error
no-extra-bind: error
no-extra-label: error
no-global-assign: error
no-implicit-coercion: error
no-implicit-globals: error
no-implied-eval: error
no-iterator: error
no-labels: error
no-lone-blocks: error
no-loop-func: error
no-multi-str: error
no-new: error
no-new-func: error
no-new-wrappers: error
no-octal-escape: error
no-proto: error
no-return-assign: error
no-script-url: error
no-self-compare: error
no-sequences: error
no-throw-literal: error
no-unmodified-loop-condition: error
no-unused-expressions: error
no-useless-call: error
no-useless-concat: error
no-useless-return: error
no-void: error
no-with: error
prefer-promise-reject-errors: error
radix: error
yoda: error
## Strict Mode
strict: error
## Variables
no-catch-shadow: error
no-label-var: error
no-shadow: error
no-shadow-restricted-names: error
no-undef-init: error
no-undefined: error
no-use-before-define: error
## Node.js and CommonJS
callback-return: error
handle-callback-err: error
no-buffer-constructor: error
no-mixed-requires: error
no-new-require: error
no-path-concat: error
no-process-env: error
no-process-exit: error
## Stylistic Issues
camelcase: error
capitalized-comments:
- error
- always
- ignoreConsecutiveComments: true
consistent-this: error
func-name-matching: error
func-style:
- error
- declaration
- allowArrowFunctions: true
id-match: error
lines-between-class-members: error
max-depth: error
max-nested-callbacks:
- error
- max: 6
max-statements-per-line: error
new-cap: error
no-array-constructor: error
no-bitwise: error
no-continue: error
no-lonely-if: error
no-multi-assign: error
no-negated-condition: error
no-nested-ternary: error
no-new-object: error
no-underscore-dangle:
- error
- allowAfterThis: true
no-unneeded-ternary: error
one-var:
- error
- never
operator-assignment: error
padding-line-between-statements: error
sort-vars: error
spaced-comment: error
## ECMAScript 6
arrow-body-style: error
no-duplicate-imports: error
no-restricted-imports: error
no-useless-computed-key: error
no-useless-constructor: error
no-useless-rename: error
no-var: error
object-shorthand: error
prefer-arrow-callback: error
prefer-const: error
prefer-destructuring: error
prefer-numeric-literals: error
prefer-spread: error
prefer-template: error
sort-imports: error
symbol-description: error
================================================
FILE: .gitignore
================================================
node_modules/
yarn-error.log
.nyc_output/
coverage/
================================================
FILE: .npmrc
================================================
save-exact = true
================================================
FILE: .nycrc
================================================
{
"reporter": [
"lcov",
"text-summary"
]
}
================================================
FILE: .prettierignore
================================================
.nyc_output/
coverage/
================================================
FILE: .prettierrc.yml
================================================
singleQuote: true
trailingComma: es5
================================================
FILE: .travis.yml
================================================
language: node_js
# https://github.com/nodejs/Release
node_js:
- 12 # EOL: 2022-04-01
- 10 # EOL: 2021-04-01
os:
- linux
- osx
matrix:
include:
- env: IMMUTABLE_VERSION=^4.0.0-rc
install:
- yarn install --frozen-lockfile
before_script:
- if [ "$IMMUTABLE_VERSION" ]; then yarn add --dev immutable@$IMMUTABLE_VERSION; fi
after_script:
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_NODE_VERSION" == "12" ]]; then yarn coveralls; fi
notifications:
email:
on_success: never
on_failure: always
# Identifies `a.b.c-xxx.n` tags as pre-releases, and `a.b.c` as stable releases
before_deploy: |
function dist_tag() {
if [[ "$TRAVIS_TAG" = *"-"* ]]; then
echo "next"
else
echo "latest"
fi
}
deploy:
provider: npm
tag: $(dist_tag)
email:
secure: bXNlycnAR6z+PawxKBB6fSKuoAQb61bH3gYhOD8yIP5Lx0zj6HHDj8Ze4jsE8X133RVVWUPONqw0D09b/w0ahWfRlY80/TzOlT6HgYHTLKuKZsgGrLDbSBBGeXzU4I+/Zuo3fJ7xGIUIRe4qrUELnUYNE7VuB1Un78xTmkuZ0cY=
api_key:
secure: lmkAwQspZnROe6Ev0QdV/9l1cN10BWMyc7BfkecNVr1Ab1G6Kws4LoczbJS/VJmLmvKaSMppLvmA+32pIu1XGa3ezjQQoobi1VPTH7RUGOY57y3japctsgI9JFXzFIESJo6lspe8blSHH7J6pyEJ0Vbl6gnDju9ploQWCawdh1g=
on:
node: 10
os: linux
tags: true
repo: astorije/chai-immutable
# If the current release is a stable release, remove potential pre-release tag
after_deploy: |
if [ "$(dist_tag)" == "latest" ]; then
npm dist-tag rm chai-immutable next || true
fi
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project owner at jeremie (at) astori (dot) fr. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2015 Jérémie Astori
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
[](https://npmjs.org/package/chai-immutable)
[](LICENSE)
[](https://travis-ci.org/astorije/chai-immutable)
[](https://ci.appveyor.com/project/astorije/chai-immutable/branch/master)
[](https://coveralls.io/r/astorije/chai-immutable)
[](https://david-dm.org/astorije/chai-immutable?type=dev)
[](https://david-dm.org/astorije/chai-immutable?type=peer)
# Chai Immutable
This plugin provides a set of [Chai](http://chaijs.com/) assertions for [Facebook's Immutable library for JavaScript collections](http://facebook.github.io/immutable-js/).
## Assertions
- BDD API Reference (Expect / Should)
- [`.empty`](#empty)
- [`.equal(collection)`](#equalcollection)
- [`.referenceEqual(value)`](#referenceequalvalue)
- [`.include(value)`](#includevalue)
- [`.keys(key1[, key2[, ...]])`](#keyskey1-key2-)
- [`.property(path[, val])`](#propertypath-val)
- [`.size(value)`](#sizevalue)
- TDD API Reference (Assert)
- [`.equal(actual, expected)`](#equalactual-expected)
- [`.referenceEqual(actual, expected)`](#referenceequalactual-expected)
- [`.notEqual(actual, expected)`](#notequalactual-expected)
- [`.notReferenceEqual(actual, expected)`](#notreferenceequalactual-expected)
- [`.sizeOf(collection, length)`](#sizeofcollection-length)
## Installation
### Node.js
Install via [npm](http://npmjs.org) or [yarn](https://yarnpkg.com/):
```bash
npm install --save-dev chai-immutable
yarn add --dev chai-immutable
```
You can then use this plugin as any other Chai plugins:
```js
const chai = require('chai');
const chaiImmutable = require('chai-immutable');
chai.use(chaiImmutable);
```
### ES6 syntax (needs Babel transpiling)
```js
import chai from 'chai';
import chaiImmutable from 'chai-immutable';
chai.use(chaiImmutable);
```
### In the browser
Include this plugin after including Chai and Immutable. It will automatically
plug in to Chai and be ready for use:
```html
```
### Using `chai-immutable` with other plugins
If you are using this plugin with
[`chai-as-promised`](https://github.com/domenic/chai-as-promised/) or
[`dirty-chai`](https://github.com/prodatakey/dirty-chai), note that
`chai-immutable` must be loaded **before** any of them. For example:
```js
const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
const chaiImmutable = require('chai-immutable');
const dirtyChai = require('dirty-chai');
const { expect } = chai;
chai.use(chaiImmutable);
chai.use(chaiAsPromised);
chai.use(dirtyChai);
const { List } = require('immutable');
/* ... */
expect(Promise.resolve(List.of(1, 2, 3))).to.eventually.have.size(3);
expect(true).to.be.true();
```
## BDD API Reference (Expect / Should)
### .empty
Asserts that the immutable collection is empty.
```js
expect(List()).to.be.empty;
expect(List.of(1, 2, 3)).to.not.be.empty;
```
### .equal(collection)
- **@param** _{ Collection }_ collection
Asserts that the values of the target are equivalent to the values of
`collection`. Aliases of Chai's original `equal` method are also supported.
```js
const a = List.of(1, 2, 3);
const b = List.of(1, 2, 3);
expect(a).to.equal(b);
```
Immutable data structures should only contain other immutable data
structures (unlike `Array`s and `Object`s) to be considered immutable and
properly work against `.equal()`. See
[issue #24](https://github.com/astorije/chai-immutable/issues/24) for more
information.
Also, note that `deep.equal` and `eql` are synonyms of `equal` when
tested against immutable data structures, therefore they are aliases to
`equal`.
### .referenceEqual(value)
- **@param** _{Collection}_ value
Asserts that the reference of the target is equivalent to the reference of
`collection`. This method preserves the original behavior of Chai's `equal`.
See [issue #210](https://github.com/astorije/chai-immutable/issues/210) for
more details.
```js
const a = List.of(1, 2, 3);
const b = a;
const c = List.of(1, 2, 3);
expect(a).to.referenceEqual(b);
expect(a).to.not.referenceEqual(c);
```
### .include(value)
- **@param** _{ Mixed }_ val
The `include` and `contain` assertions can be used as either property
based language chains or as methods to assert the inclusion of a value or
subset in an immutable collection. When used as language chains, they toggle
the `contains` flag for the `keys` assertion.
Note that `deep.include` behaves exactly like `include` in the context of
immutable data structures.
```js
expect(new List([1, 2, 3])).to.include(2);
expect(new List([1, 2, 3])).to.deep.include(2);
expect(new Map({ foo: 'bar', hello: 'world' })).to.include('bar');
expect(new Map({ a: 1, b: 2, c: 3 })).to.include(new Map({ a: 1, b: 2 }));
expect(new Map({ foo: 'bar', hello: 'world' })).to.include.keys('foo');
```
### .keys(key1[, key2[, ...]])
- **@param** _{ String... | Array | Object | Collection }_ key*N*
Asserts that the target collection has the given keys.
When the target is an object or array, keys can be provided as one or more
string arguments, a single array argument, a single object argument, or an
immutable collection. In the last 2 cases, only the keys in the given
object/collection matter; the values are ignored.
```js
expect(new Map({ foo: 1, bar: 2 })).to.have.all.keys('foo', 'bar');
expect(new Map({ foo: 1, bar: 2 })).to.have.all.keys(new List(['bar', 'foo']));
expect(new Map({ foo: 1, bar: 2 })).to.have.all.keys(new Set(['bar', 'foo']));
expect(new Map({ foo: 1, bar: 2 })).to.have.all.keys(new Stack(['bar', 'foo']));
expect(new List(['x', 'y'])).to.have.all.keys(0, 1);
expect(new Map({ foo: 1, bar: 2 })).to.have.all.keys(['foo', 'bar']);
expect(new List(['x', 'y'])).to.have.all.keys([0, 1]);
// Values in the passed object are ignored:
expect(new Map({ foo: 1, bar: 2 })).to.have.all.keys({ bar: 6, foo: 7 });
expect(new Map({ foo: 1, bar: 2 })).to.have.all.keys(
new Map({ bar: 6, foo: 7 })
);
expect(new List(['x', 'y'])).to.have.all.keys({ 0: 4, 1: 5 });
```
Note that `deep.property` behaves exactly like `property` in the context of
immutable data structures.
By default, the target must have all of the given keys and no more. Add
`.any` earlier in the chain to only require that the target have at least
one of the given keys. Also, add `.not` earlier in the chain to negate
`.keys`. It's often best to add `.any` when negating `.keys`, and to use
`.all` when asserting `.keys` without negation.
When negating `.keys`, `.any` is preferred because `.not.any.keys` asserts
exactly what's expected of the output, whereas `.not.all.keys` creates
uncertain expectations.
```js
// Recommended; asserts that target doesn't have any of the given keys
expect(new Map({ a: 1, b: 2 })).to.not.have.any.keys('c', 'd');
// Not recommended; asserts that target doesn't have all of the given
// keys but may or may not have some of them
expect(new Map({ a: 1, b: 2 })).to.not.have.all.keys('c', 'd');
```
When asserting `.keys` without negation, `.all` is preferred because
`.all.keys` asserts exactly what's expected of the output, whereas
`.any.keys` creates uncertain expectations.
```js
// Recommended; asserts that target has all the given keys
expect(new Map({ a: 1, b: 2 })).to.have.all.keys('a', 'b');
// Not recommended; asserts that target has at least one of the given
// keys but may or may not have more of them
expect(new Map({ a: 1, b: 2 })).to.have.any.keys('a', 'b');
```
Note that `.all` is used by default when neither `.all` nor `.any` appear
earlier in the chain. However, it's often best to add `.all` anyway because
it improves readability.
```js
// Both assertions are identical
expect(new Map({ a: 1, b: 2 })).to.have.all.keys('a', 'b'); // Recommended
expect(new Map({ a: 1, b: 2 })).to.have.keys('a', 'b'); // Not recommended
```
Add `.include` earlier in the chain to require that the target's keys be a
superset of the expected keys, rather than identical sets.
```js
// Target object's keys are a superset of ['a', 'b'] but not identical
expect(new Map({ a: 1, b: 2, c: 3 })).to.include.all.keys('a', 'b');
expect(new Map({ a: 1, b: 2, c: 3 })).to.not.have.all.keys('a', 'b');
```
However, if `.any` and `.include` are combined, only the `.any` takes
effect. The `.include` is ignored in this case.
```js
// Both assertions are identical
expect(new Map({ a: 1 })).to.have.any.keys('a', 'b');
expect(new Map({ a: 1 })).to.include.any.keys('a', 'b');
```
The alias `.key` can be used interchangeably with `.keys`.
```js
expect(new Map({ foo: 1 })).to.have.key('foo');
```
### .property(path[, val])
- **@param** _{ String | Array | Iterable }_ path
- **@param** _{ Mixed }_ val (optional)
Asserts that the target has a property with the given `path`.
```js
expect(new Map({ a: 1 })).to.have.property('a');
```
When `val` is provided, `.property` also asserts that the property's value
is equal to the given `val`. `val` can be an immutable collection.
```js
expect(new Map({ a: 1 })).to.have.property('a', 1);
```
Note that `deep.property` behaves exactly like `property` in the context of
immutable data structures.
Add `.nested` earlier in the chain to enable dot- and bracket-notation when
referencing nested properties. An immutable `List` can also be used as the
starting point of a `nested.property`.
```js
expect(Immutable.fromJS({ a: { b: ['x', 'y'] } })).to.have.nested.property(
'a.b[1]'
);
expect(Immutable.fromJS({ a: { b: ['x', 'y'] } })).to.have.nested.property(
'a.b[1]',
'y'
);
expect(Immutable.fromJS({ a: { b: ['x', 'y'] } })).to.have.nested.property(
['a', 'b', 1],
'y'
);
expect(Immutable.fromJS({ a: { b: ['x', 'y'] } })).to.have.nested.property(
new List(['a', 'b', 1]),
'y'
);
```
If `.` or `[]` are part of an actual property name, they can be escaped by
adding two backslashes before them.
```js
expect(Immutable.fromJS({ '.a': { '[b]': 'x' } })).to.have.nested.property(
'\\.a.\\[b\\]'
);
```
Add `.not` earlier in the chain to negate `.property`.
```js
expect(new Map({ a: 1 })).to.not.have.property('b');
```
However, it's dangerous to negate `.property` when providing `val`. The
problem is that it creates uncertain expectations by asserting that the
target either doesn't have a property at the given `path`, or that it
does have a property at the given key `path` but its value isn't equal to
the given `val`. It's often best to identify the exact output that's
expected, and then write an assertion that only accepts that exact output.
When the target isn't expected to have a property at the given
`path`, it's often best to assert exactly that.
```js
expect(new Map({ b: 2 })).to.not.have.property('a'); // Recommended
expect(new Map({ b: 2 })).to.not.have.property('a', 1); // Not recommended
```
When the target is expected to have a property at the given key `path`,
it's often best to assert that the property has its expected value, rather
than asserting that it doesn't have one of many unexpected values.
```js
expect(new Map({ a: 3 })).to.have.property('a', 3); // Recommended
expect(new Map({ a: 3 })).to.not.have.property('a', 1); // Not recommended
```
`.property` changes the target of any assertions that follow in the chain
to be the value of the property from the original target object.
```js
expect(new Map({ a: 1 }))
.to.have.property('a')
.that.is.a('number');
```
### .size(value)
- **@param** _{ Number }_ size
Asserts that the immutable collection has the expected size.
```js
expect(List.of(1, 2, 3)).to.have.size(3);
```
It can also be used as a chain precursor to a value comparison for the
`size` property.
```js
expect(List.of(1, 2, 3)).to.have.size.least(3);
expect(List.of(1, 2, 3)).to.have.size.most(3);
expect(List.of(1, 2, 3)).to.have.size.above(2);
expect(List.of(1, 2, 3)).to.have.size.below(4);
expect(List.of(1, 2, 3)).to.have.size.within(2, 4);
```
Similarly to `length`/`lengthOf`, `sizeOf` is an alias of `size`:
```js
expect(List.of(1, 2, 3)).to.have.sizeOf(3);
```
## TDD API Reference (Assert)
### .equal(actual, expected)
- **@param** _{ Collection }_ actual
- **@param** _{ Collection }_ expected
Asserts that the values of `actual` are equivalent to the values of
`expected`. Note that `.strictEqual()` and `.deepEqual()` assert
exactly like `.equal()` in the context of Immutable data structures.
```js
const a = List.of(1, 2, 3);
const b = List.of(1, 2, 3);
assert.equal(a, b);
```
Immutable data structures should only contain other immutable data
structures (unlike `Array`s and `Object`s) to be considered immutable and
properly work against `.equal()`, `.strictEqual()` or `.deepEqual()`. See
[issue #24](https://github.com/astorije/chai-immutable/issues/24) for more
information.
### .referenceEqual(actual, expected)
- **@param** _{Collection}_ actual
- **@param** _{Collection}_ expected
Asserts that the reference of `actual` is equivalent to the reference of
`expected`. This method preserves the original behavior of Chai's `equal`.
See [issue #210](https://github.com/astorije/chai-immutable/issues/210) for
more details.
```js
const a = List.of(1, 2, 3);
const b = a;
const c = List.of(1, 2, 3);
assert.referenceEqual(a, b);
assert.throws(() => assert.referenceEqual(a, c));
```
### .notEqual(actual, expected)
- **@param** _{ Collection }_ actual
- **@param** _{ Collection }_ expected
Asserts that the values of `actual` are not equivalent to the values of
`expected`. Note that `.notStrictEqual()` and `.notDeepEqual()` assert
exactly like `.notEqual()` in the context of Immutable data structures.
```js
const a = List.of(1, 2, 3);
const b = List.of(4, 5, 6);
assert.notEqual(a, b);
```
### .notReferenceEqual(actual, expected)
- **@param** _{Collection}_ actual
- **@param** _{Collection}_ expected
Asserts that the reference of `actual` is not equivalent to the reference of
`expected`. This method preserves the original behavior of Chai's `notEqual`.
See [issue #210](https://github.com/astorije/chai-immutable/issues/210) for
more details.
```js
const a = List.of(1, 2, 3);
const b = a;
const c = List.of(1, 2, 3);
assert.throws(() => assert.notReferenceEqual(a, b));
assert.notReferenceEqual(a, c);
```
### .sizeOf(collection, length)
- **@param** _{ Collection }_ collection
- **@param** _{ Number }_ size
Asserts that the immutable collection has the expected size.
```js
assert.sizeOf(List.of(1, 2, 3), 3);
assert.sizeOf(new List(), 0);
```
================================================
FILE: appveyor.yml
================================================
# http://www.appveyor.com/docs/appveyor-yml
# Build version format
version: '{build}'
# Do not build on tags (GitHub only)
skip_tags: true
environment:
matrix:
- nodejs_version: 12 # EOL: 2022-04-01
- nodejs_version: 10 # EOL: 2021-04-01
install:
- ps: Install-Product node $env:nodejs_version
- yarn install --frozen-lockfile
- yarn add --dev mocha-appveyor-reporter
- echo --reporter mocha-appveyor-reporter >> test/mocha.opts
test_script:
- node --version
- yarn --version
- yarn test
# cache npm modules
cache:
- "%LOCALAPPDATA%\\Yarn"
# Don't actually build
build: off
================================================
FILE: chai-immutable.js
================================================
'use strict';
((context, factory) => {
if (
typeof require === 'function' &&
typeof exports === 'object' &&
typeof module === 'object'
) {
// Node.js
module.exports = factory(require('immutable'));
} else {
// Other environments (usually