Skip to content

Commit 0cc13a7

Browse files
committed
Auto-generated commit
1 parent 8974c00 commit 0cc13a7

File tree

7 files changed

+77
-27
lines changed

7 files changed

+77
-27
lines changed

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
node-version: 15
3535
- name: Install production and development dependencies
3636
run: |
37-
npm install
37+
npm install || npm install || npm install
3838
- name: Run benchmarks
3939
run: |
4040
npm run benchmark

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
node-version: 15
3535
- name: Install production and development dependencies
3636
run: |
37-
npm install
37+
npm install || npm install || npm install
3838
- name: Run examples
3939
run: |
4040
npm run examples

.github/workflows/test.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ name: build
2121

2222
# Workflow triggers:
2323
on:
24+
schedule:
25+
# * is a special character in YAML so you have to quote this string
26+
- cron: '30 1 * * 6'
2427
workflow_dispatch:
2528

2629
# Workflow jobs:
@@ -36,18 +39,12 @@ jobs:
3639
node-version: 15
3740
- name: Install production and development dependencies
3841
id: install
39-
uses: nick-invision/retry@v2
40-
with:
41-
timeout_minutes: 2
42-
max_attempts: 3
43-
command: npm install
42+
run: |
43+
npm install || npm install || npm install
4444
- name: Run tests
4545
id: tests
46-
uses: nick-invision/retry@v2
47-
with:
48-
timeout_minutes: 3
49-
max_attempts: 2
50-
command: npm test
46+
run: |
47+
npm test || npm test || npm test
5148
- uses: act10ns/slack@v1
5249
with:
5350
status: ${{ job.status }}

.github/workflows/test_coverage.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ name: coverage
2121

2222
# Workflow triggers:
2323
on:
24+
workflow_run:
25+
workflows: ["build"]
26+
types: [completed]
2427
workflow_dispatch:
2528

2629
# Workflow jobs:
@@ -33,17 +36,11 @@ jobs:
3336
with:
3437
node-version: 15
3538
- name: Install production and development dependencies
36-
uses: nick-invision/retry@v2
37-
with:
38-
timeout_minutes: 2
39-
max_attempts: 3
40-
command: npm install
39+
run: |
40+
npm install || npm install || npm install
4141
- name: Calculate test coverage
42-
uses: nick-invision/retry@v2
43-
with:
44-
timeout_minutes: 3
45-
max_attempts: 2
46-
command: npm run test-cov
42+
run: |
43+
npm run test-cov || npm run test-cov || npm run test-cov
4744
- name: Upload coverage to Codecov
4845
id: upload
4946
uses: codecov/codecov-action@v1

.github/workflows/test_install.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ name: Test Installing Dependencies
2121

2222
# Workflow triggers:
2323
on:
24+
schedule:
25+
# * is a special character in YAML so you have to quote this string
26+
- cron: '30 1 * * 6'
2427
workflow_run:
2528
workflows: ["Publish Package"]
2629
types: [completed]
@@ -38,11 +41,8 @@ jobs:
3841
with:
3942
node-version: 15
4043
- name: Install production dependencies via npm
41-
uses: nick-invision/retry@v2
42-
with:
43-
timeout_minutes: 2
44-
max_attempts: 3
45-
command: npm install --only=prod
44+
run: |
45+
npm install --only=prod || npm install --only=prod || npm install --only=prod
4646
- uses: act10ns/slack@v1
4747
with:
4848
status: ${{ job.status }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"@stdlib/assert-has-symbol-support": "^0.0.x",
4545
"@stdlib/assert-is-boolean": "^0.0.x",
4646
"@stdlib/bench": "^0.0.x",
47+
"@stdlib/utils-noop": "^0.0.x",
4748
"proxyquire": "^2.0.0",
4849
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
4950
"istanbul": "^0.4.1",

test/test.try2exec.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2021 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var tape = require( 'tape' );
24+
var proxyquire = require( 'proxyquire' );
25+
var noop = require( '@stdlib/utils-noop' );
26+
var try2exec = require( './../lib/try2exec.js' );
27+
28+
29+
// TESTS //
30+
31+
tape( 'main export is a function', function test( t ) {
32+
t.ok( true, __filename );
33+
t.strictEqual( typeof try2exec, 'function', 'main export is a function' );
34+
t.end();
35+
});
36+
37+
tape( 'the function returns `true` if able to call a `RegExp` method', function test( t ) {
38+
var try2exec = proxyquire( './../lib/try2exec.js', {
39+
'./exec.js': noop
40+
});
41+
t.strictEqual( try2exec(), true, 'returns expected value' );
42+
t.end();
43+
});
44+
45+
tape( 'the function returns `false` if unable to call a `RegExp` method', function test( t ) {
46+
var try2exec = proxyquire( './../lib/try2exec.js', {
47+
'./exec.js': mock
48+
});
49+
t.strictEqual( try2exec(), false, 'returns expected value' );
50+
t.end();
51+
52+
function mock() {
53+
throw new Error( 'not supported' );
54+
}
55+
});

0 commit comments

Comments
 (0)