Skip to content

Commit 9a6301a

Browse files
committed
Auto-generated commit
1 parent 01028ca commit 9a6301a

3 files changed

Lines changed: 11 additions & 128 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
197197
[npm-image]: http://img.shields.io/npm/v/@stdlib/assert-has-weakmap-support.svg
198198
[npm-url]: https://npmjs.org/package/@stdlib/assert-has-weakmap-support
199199

200-
[test-image]: https://github.com/stdlib-js/assert-has-weakmap-support/actions/workflows/test.yml/badge.svg?branch=v0.1.1
201-
[test-url]: https://github.com/stdlib-js/assert-has-weakmap-support/actions/workflows/test.yml?query=branch:v0.1.1
200+
[test-image]: https://github.com/stdlib-js/assert-has-weakmap-support/actions/workflows/test.yml/badge.svg?branch=main
201+
[test-url]: https://github.com/stdlib-js/assert-has-weakmap-support/actions/workflows/test.yml?query=branch:main
202202

203203
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/assert-has-weakmap-support/main.svg
204204
[coverage-url]: https://codecov.io/github/stdlib-js/assert-has-weakmap-support?branch=main

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
"@stdlib/fs-read-file": "^0.1.1"
4545
},
4646
"devDependencies": {
47-
"@stdlib/assert-has-own-property": "^0.1.0",
48-
"@stdlib/assert-is-boolean": "^0.1.0",
49-
"@stdlib/assert-is-browser": "^0.1.0",
50-
"@stdlib/assert-is-windows": "^0.1.0",
47+
"@stdlib/assert-has-own-property": "^0.1.1",
48+
"@stdlib/assert-is-boolean": "^0.1.1",
49+
"@stdlib/assert-is-browser": "^0.1.1",
50+
"@stdlib/assert-is-windows": "^0.1.1",
5151
"@stdlib/bench": "^0.1.0",
52-
"@stdlib/process-exec-path": "^0.1.0",
52+
"@stdlib/process-exec-path": "^0.1.1",
5353
"proxyquire": "^2.0.0",
5454
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5555
"istanbul": "^0.4.1",

test/dist/test.js

Lines changed: 4 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2018 The Stdlib Authors.
4+
* Copyright (c) 2023 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -21,130 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var proxyquire = require( 'proxyquire' );
25-
var hasOwnProp = require( '@stdlib/assert-has-own-property' );
26-
var detect = require( './../../dist' );
27-
28-
29-
// VARIABLES //
30-
31-
var hasWeakMap = ( typeof WeakMap === 'function' );
24+
var main = require( './../../dist' );
3225

3326

3427
// TESTS //
3528

36-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
3730
t.ok( true, __filename );
38-
t.strictEqual( typeof detect, 'function', 'main export is a function' );
39-
t.end();
40-
});
41-
42-
tape( 'feature detection result is a boolean', function test( t ) {
43-
t.strictEqual( typeof detect(), 'boolean', 'detection result is a boolean' );
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
4432
t.end();
4533
});
46-
47-
tape( 'if `WeakMap` is supported, detection result is `true`', function test( t ) {
48-
var mocked;
49-
if ( hasWeakMap ) {
50-
t.strictEqual( detect(), true, 'detection result is `true`' );
51-
} else {
52-
t.strictEqual( detect(), false, 'detection result is `false`' );
53-
}
54-
mocked = proxyquire( './../dist/main.js', {
55-
'./weakmap.js': Mock
56-
});
57-
t.strictEqual( mocked(), true, 'detection result is `true` (mocked)' );
58-
59-
t.end();
60-
61-
function Mock() {
62-
var o = {};
63-
function has( key ) {
64-
return hasOwnProp( o, key );
65-
}
66-
function set( key, value ) {
67-
o[ key ] = value;
68-
}
69-
function get( key ) {
70-
return o[ key ];
71-
}
72-
return {
73-
'has': has,
74-
'set': set,
75-
'get': get
76-
};
77-
}
78-
});
79-
80-
tape( 'if `WeakMap` is not supported, detection result is `false`', function test( t ) {
81-
var mocked;
82-
if ( hasWeakMap ) {
83-
t.strictEqual( detect(), true, 'detection result is `true`' );
84-
} else {
85-
t.strictEqual( detect(), false, 'detection result is `false`' );
86-
}
87-
mocked = proxyquire( './../dist/main.js', {
88-
'./weakmap.js': {}
89-
});
90-
t.strictEqual( mocked(), false, 'detection result is `false` (mocked)' );
91-
92-
mocked = proxyquire( './../dist/main.js', {
93-
'./weakmap.js': Mock1
94-
});
95-
t.strictEqual( mocked(), false, 'detection result is `false` (no `has` method)' );
96-
97-
mocked = proxyquire( './../dist/main.js', {
98-
'./weakmap.js': Mock2
99-
});
100-
t.strictEqual( mocked(), false, 'detection result is `false` (no `set` method)' );
101-
102-
mocked = proxyquire( './../dist/main.js', {
103-
'./weakmap.js': Mock3
104-
});
105-
t.strictEqual( mocked(), false, 'detection result is `false` (no `get` method)' );
106-
107-
t.end();
108-
109-
function Mock1() {
110-
var o = {};
111-
function set( key, value ) {
112-
o[ key ] = value;
113-
}
114-
function get( key ) {
115-
return o[ key ];
116-
}
117-
return {
118-
'set': set,
119-
'get': get
120-
};
121-
}
122-
123-
function Mock2() {
124-
var o = {};
125-
function has( key ) {
126-
return hasOwnProp( o, key );
127-
}
128-
function get( key ) {
129-
return o[ key ];
130-
}
131-
return {
132-
'has': has,
133-
'get': get
134-
};
135-
}
136-
137-
function Mock3() {
138-
var o = {};
139-
function has( key ) {
140-
return hasOwnProp( o, key );
141-
}
142-
function set( key, value ) {
143-
o[ key ] = value;
144-
}
145-
return {
146-
'has': has,
147-
'set': set
148-
};
149-
}
150-
});

0 commit comments

Comments
 (0)