Skip to content

Commit

Permalink
Merge pull request #173 from blackflux/dev
Browse files Browse the repository at this point in the history
[Gally]: master <- dev
  • Loading branch information
simlu authored Jun 11, 2024
2 parents f6132be + b3fd710 commit 13bd30b
Show file tree
Hide file tree
Showing 13 changed files with 1,188 additions and 1,046 deletions.
1 change: 1 addition & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"coverage/*",
"lib/*",
"test/hot.js",
"test/reg.js",
"eslint.config.js"
],
"temp-directory": "./coverage/.c8_output",
Expand Down
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ workflows:
- test-node-v18:
requires:
- gally-create-pr
- test-node-v16:
- test-node-v21:
requires:
- gally-create-pr
- test-node-v20:
Expand All @@ -15,7 +15,7 @@ workflows:
requires:
- gally-create-pr
- test-node-v18
- test-node-v16
- test-node-v21
- test-node-v20
filters:
branches:
Expand All @@ -24,7 +24,7 @@ workflows:
requires:
- gally-create-pr
- test-node-v18
- test-node-v16
- test-node-v21
- test-node-v20
filters:
branches:
Expand All @@ -33,14 +33,14 @@ version: 2.1
jobs:
gally-create-pr:
docker:
- image: cimg/node:16.20
- image: cimg/node:20.11
steps:
- checkout
- run: sudo yarn global add gally
- run: ga promote $CIRCLE_BRANCH
gally-auto-approve:
docker:
- image: cimg/node:16.20
- image: cimg/node:20.11
steps:
- run:
name: Set PR number
Expand All @@ -59,7 +59,7 @@ jobs:
"base.ref=dev&state=open&user.login=dependabot-preview[bot]"
release:
docker:
- image: cimg/node:16.20
- image: cimg/node:20.11
steps:
- checkout
- run:
Expand Down Expand Up @@ -87,9 +87,9 @@ jobs:
- ~/.cache/yarn
- run: yarn global add "semantic-release@^19.0.5"
- run: yarn run semantic-release
test-node-v16:
test-node-v18:
docker:
- image: cimg/node:16.20
- image: cimg/node:18.19
steps:
- checkout
- run:
Expand Down Expand Up @@ -119,9 +119,9 @@ jobs:
- run: >-
(git add . && git diff-index --quiet HEAD --) || (git status && exit
1);
test-node-v18:
test-node-v20:
docker:
- image: cimg/node:18.16
- image: cimg/node:20.11
steps:
- checkout
- run:
Expand Down Expand Up @@ -151,9 +151,9 @@ jobs:
- run: >-
(git add . && git diff-index --quiet HEAD --) || (git status && exit
1);
test-node-v20:
test-node-v21:
docker:
- image: cimg/node:20.4
- image: cimg/node:21.6
steps:
- checkout
- run:
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": [
"airbnb-base",
"plugin:mocha/recommended",
"plugin:markdown/recommended"
"plugin:markdown/recommended-legacy"
],
"rules": {
"mocha/no-mocha-arrows": 0,
Expand Down
2 changes: 1 addition & 1 deletion .gally.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"contexts": [
"ci/circleci: gally-create-pr",
"ci/circleci: test-node-v18",
"ci/circleci: test-node-v16",
"ci/circleci: test-node-v21",
"ci/circleci: test-node-v20"
]
},
Expand Down
3 changes: 2 additions & 1 deletion .roboconfig.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"package.json",
"src/index.js",
"test/hot.js",
"test/index.spec.js"
"test/index.spec.js",
"test/reg.js"
]
}
49 changes: 44 additions & 5 deletions CONFDOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Documents configuration tasks managed by [robo-config](https://github.com/blackf
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structnpm-default">:open_file_folder:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structnpm-default">`struct/#npm-default`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structforce-gardener">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structforce-gardener">`struct/force-gardener`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structnpm-base">:open_file_folder:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structnpm-base">`struct/#npm-base`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtest-reg">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtest-reg">`struct/test-reg`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtest-hot">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtest-hot">`struct/test-hot`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtemplate-readme">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtemplate-readme">`struct/template-readme`</a>
- <a name="blackfluxrobo-config-plugin-task-idx-ref-structtemplate-mocharc">:clipboard:</a> <a href="#blackfluxrobo-config-plugin-task-ref-structtemplate-mocharc">`struct/template-mocharc`</a>
Expand Down Expand Up @@ -87,7 +88,8 @@ Manage various configuration files for an open source npm package on github.
<code>│&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-srcindexjs">index.js</a></code><br/>
<code>└─&nbsp;test</code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">hot.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testregjs">reg.js</a></code><br/>
</ul>
</td>
<td align="left" valign="top">
Expand Down Expand Up @@ -151,7 +153,8 @@ Manage basic project structure for npm package on github.
<code>│&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-srcindexjs">index.js</a></code><br/>
<code>└─&nbsp;test</code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">hot.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testregjs">reg.js</a></code><br/>
</ul>
</td>
<td align="left" valign="top">
Expand Down Expand Up @@ -224,7 +227,8 @@ Manage basic project structure for npm package on github.
<code>│&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-srcindexjs">index.js</a></code><br/>
<code>└─&nbsp;test</code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">hot.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;├─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testindexspecjs">index.spec.js</a></code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testregjs">reg.js</a></code><br/>
</ul>
</td>
<td align="left" valign="top">
Expand All @@ -244,11 +248,40 @@ Manage basic project structure for npm package on github.
</tbody>
</table>

###### :clipboard: <a name="blackfluxrobo-config-plugin-task-ref-structtest-reg">struct/test-reg</a> (<a href="#blackfluxrobo-config-plugin-task-idx-ref-structtest-reg">`index`</a>)

_Updating <a href="#blackfluxrobo-config-plugin-target-ref-testregjs">test/reg.js</a> using <a href="#blackfluxrobo-config-plugin-strat-ref-overwrite">overwrite</a>._

- Create register file.

<table>
<tbody>
<tr>
<th>Targets</th>
<th>Requires</th>
</tr>
<tr>
<td align="left" valign="top">
<ul>
<code>project</code><br/>
<code>└─&nbsp;test</code><br/>
<code>&nbsp;&nbsp;&nbsp;└─&nbsp;<a href="#blackfluxrobo-config-plugin-target-ref-testregjs">reg.js</a></code><br/>
</ul>
</td>
<td align="left" valign="top">
<ul>
<li><a href="#blackfluxrobo-config-plugin-req-ref-javascript">javascript</a></li>
</ul>
</td>
</tr>
</tbody>
</table>

###### :clipboard: <a name="blackfluxrobo-config-plugin-task-ref-structtest-hot">struct/test-hot</a> (<a href="#blackfluxrobo-config-plugin-task-idx-ref-structtest-hot">`index`</a>)

_Updating <a href="#blackfluxrobo-config-plugin-target-ref-testhotjs">test/hot.js</a> using <a href="#blackfluxrobo-config-plugin-strat-ref-overwrite">overwrite</a>._

- Create custom loader file.
- Create loader file.

<table>
<tbody>
Expand Down Expand Up @@ -1651,11 +1684,17 @@ The code owner is the gatekeeper of the project, ultimately responsible for all

Execute all configured js-gardener tasks.

### <a name="blackfluxrobo-config-plugin-target-ref-testregjs">test/reg.js</a>

:small_blue_diamond: `other`

*Registration hook to load custom loader.*

### <a name="blackfluxrobo-config-plugin-target-ref-testhotjs">test/hot.js</a>

:small_blue_diamond: `other`

*Custom loader to allow hot reloading of files for testing.*
*Loader to allow hot reloading of files for testing.*

### <a name="blackfluxrobo-config-plugin-target-ref-readmemd">README.md</a> ([`link`](https://help.github.com/en/articles/about-readmes))

Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default [
...compat.extends(
'airbnb-base',
'plugin:mocha/recommended',
'plugin:markdown/recommended'
'plugin:markdown/recommended-legacy'
),
...compat.env({ es6: true, node: true, mocha: true }),
...compat.plugins('json', 'mocha'),
Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
"author": "Lukas Siemon",
"license": "MIT",
"devDependencies": {
"@babel/core": "7.23.0",
"@babel/eslint-parser": "7.22.15",
"@babel/register": "7.22.15",
"@babel/core": "7.24.7",
"@babel/eslint-parser": "7.24.7",
"@babel/register": "7.24.6",
"@blackflux/eslint-plugin-rules": "3.0.1",
"@blackflux/robo-config-plugin": "9.2.2",
"c8": "8.0.1",
"chai": "4.3.10",
"eslint": "8.50.0",
"@blackflux/robo-config-plugin": "9.4.0",
"c8": "10.1.0",
"chai": "5.1.1",
"eslint": "8.57.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-json": "3.1.0",
"eslint-plugin-markdown": "3.0.1",
"eslint-plugin-mocha": "10.2.0",
"js-gardener": "5.0.2",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-json": "4.0.0",
"eslint-plugin-markdown": "5.0.0",
"eslint-plugin-mocha": "10.4.3",
"js-gardener": "5.0.4",
"lodash.clonedeep": "4.5.0",
"lodash.samplesize": "4.2.0",
"node-tdd": "4.0.1"
"node-tdd": "5.2.4"
},
"licenses": [
{
Expand Down Expand Up @@ -56,7 +56,7 @@
"clean": "rm -rf lib",
"build": "cp -rf ./src ./lib",
"build-clean": "yarn run clean && yarn run build",
"test-simple": "c8 mocha --experimental-loader=./test/hot.js \"./test/**/*.spec.js\"",
"test-simple": "c8 mocha --import=./test/reg.js \"./test/**/*.spec.js\"",
"test": "yarn run clean && yarn run gardener && yarn run test-simple",
"docker": "docker run --net host -u`id -u`:`id -g` -v $(pwd):/user/project -v ~/.aws:/user/.aws -v ~/.npmrc:/user/.npmrc -w /user/project -it --entrypoint /bin/bash",
"u": "yarn upgrade --latest --force",
Expand All @@ -65,7 +65,7 @@
"t": "yarn test",
"ts": "yarn run test-simple",
"tsv": "yarn run test-simple --verbose",
"semantic-release": "yarn run build-clean && npx semantic-release",
"semantic-release": "yarn run build-clean && yarn exec semantic-release",
"gardener": "node gardener.js"
},
"homepage": "https://github.com/blackflux/object-lib#readme",
Expand All @@ -76,6 +76,6 @@
"node": ">= 16"
},
"dependencies": {
"object-scan": "19.0.3"
"object-scan": "19.0.5"
}
}
18 changes: 18 additions & 0 deletions test/core/contains.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('Testing contains', { timeout: 100000 }, () => {
it('Testing equal', () => {
expect(contains('value1', 'value1')).to.equal(true);
});

it('Testing not equal', () => {
expect(contains('value1', 'value2')).to.equal(false);
});
Expand All @@ -26,27 +27,35 @@ describe('Testing contains', { timeout: 100000 }, () => {
it('Testing equal arrays (containing three equal numbers)', () => {
expect(contains([1, 2, 3], [1, 2, 3])).to.equal(true);
});

it('Testing not equal arrays (containing three equal numbers in different order)', () => {
expect(contains([1, 2, 3], [3, 2, 1])).to.equal(false);
});

it('Testing equal arrays (containing single object)', () => {
expect(contains([{ key: 'value1' }], [{ key: 'value1' }])).to.equal(true);
});

it('Testing not equal arrays (containing different single object)', () => {
expect(contains([{ key: 'value1' }], [{ key: 'value2' }])).to.equal(false);
});

it('Testing not equal arrays (array contains number that are a subset)', () => {
expect(contains([1, 2, 3], [1, 2])).to.equal(false);
});

it('Testing empty arrays equal', () => {
expect(contains([], [])).to.equal(true);
});

it('Testing nested empty arrays equal', () => {
expect(contains([[], []], [[], []])).to.equal(true);
});

it('Testing nested not equal (different arrays, removed)', () => {
expect(contains([['x'], []], [[], []])).to.equal(false);
});

it('Testing nested not equal (different arrays, added)', () => {
expect(contains([[], []], [['x'], []])).to.equal(false);
});
Expand All @@ -56,15 +65,19 @@ describe('Testing contains', { timeout: 100000 }, () => {
it('Testing empty objects equal', () => {
expect(contains({}, {})).to.equal(true);
});

it('Testing objects equal with single key', () => {
expect(contains({ key: 'value1' }, { key: 'value1' })).to.equal(true);
});

it('Testing objects different with same keys, but different values', () => {
expect(contains({ key: 'value1' }, { key: 'value2' })).to.equal(false);
});

it('Testing different keys (added)', () => {
expect(contains({ key: 'value1' }, { key: 'value1', foo: 'bar' })).to.equal(false);
});

it('Testing different keys (removed)', () => {
expect(contains({ key: 'value1', foo: 'bar' }, { key: 'value1' })).to.equal(true);
});
Expand All @@ -74,18 +87,23 @@ describe('Testing contains', { timeout: 100000 }, () => {
it('Testing empty object vs empty string', () => {
expect(contains({}, '')).to.equal(false);
});

it('Testing empty object vs empty array', () => {
expect(contains({}, [])).to.equal(false);
});

it('Testing empty array vs empty string', () => {
expect(contains([], '')).to.equal(false);
});

it('Testing empty array vs empty object', () => {
expect(contains([], {})).to.equal(false);
});

it('Testing empty string vs empty object', () => {
expect(contains('', {})).to.equal(false);
});

it('Testing empty string vs empty array', () => {
expect(contains('', [])).to.equal(false);
});
Expand Down
1 change: 1 addition & 0 deletions test/core/merge.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import genData from './gen-data.js';
describe('Testing Merge', { timeout: 100000 }, () => {
describe('Default Merge', () => {
let merge;

before(() => {
merge = Merge();
});
Expand Down
Loading

0 comments on commit 13bd30b

Please sign in to comment.