8000 Auto-generated commit · stdlib-js/string-base-trim@3b7a17d · GitHub
[go: up one dir, main page]

Skip to content 10000

Commit 3b7a17d

Browse files
committed
Auto-generated commit
1 parent 21aba97 commit 3b7a17d

File tree

3 files changed

+7
-190
lines changed

3 files changed

+7
-190
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
170170
[npm-image]: http://img.shields.io/npm/v/@stdlib/string-base-trim.svg
171171
[npm-url]: https://npmjs.org/package/@stdlib/string-base-trim
172172

173-
[test-image]: https://github.com/stdlib-js/string-base-trim/actions/workflows/test.yml/badge.svg?branch=v0.1.1
174-
[test-url]: https://github.com/stdlib-js/string-base-trim/actions/workflows/test.yml?query=branch:v0.1.1
173+
[test-image]: https://github.com/stdlib-js/string-base-trim/actions/workflows/test.yml/badge.svg?branch=main
174+
[test-url]: https://github.com/stdlib-js/string-base-trim/actions/workflows/test.yml?query=branch:main
175175

176176
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/string-base-trim/main.svg
177177
[coverage-url]: https://codecov.io/github/stdlib-js/string-base-trim?branch=main

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@stdlib/string-base-replace": "^0.1.1"
4141
},
4242
"devDependencies": {
43-
"@stdlib/assert-is-string": "^0.1.0",
43+
"@stdlib/assert-is-string": "^0.1.1",
4444
"@stdlib/bench": "^0.1.0",
4545
"proxyquire": "^2.0.0",
4646
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",

test/dist/test.js

Lines changed: 4 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2022 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,196 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var proxyquire = require( 'proxyquire' );
25-
var polyfill = require( './../../dist/polyfill.js' );
26-
var main = require( './../../dist/main.js' );
27-
var trim = require( './../../dist' );
24+
var main = require( './../../dist' );
2825

2926

3027
// TESTS //
3128

32-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
3330
t.ok( true, __filename );
34-
t.strictEqual( typeof trim, 'function', 'main export is a function' );
35-
t.end();
36-
});
37-
38-
tape( 'the main export is a polyfill if an environment does not support String.prototype.trim', function test( t ) {
39-
var trim = proxyquire( './../dist', {
40-
'./has_builtin.js': false
41-
});
42-
t.equal( trim, polyfill, 'returns expected value' );
43-
t.end();
44-
});
45-
46-
tape( 'the main export is a polyfill if an environment has deprecated String.prototype.trim behavior', function test( t ) {
47-
var trim = proxyquire( './../dist', {
48-
'./has_builtin.js': true,
49-
'./check.js': mock
50-
});
51-
t.equal( trim, polyfill, 'returns expected value' );
52-
t.end();
53-
54-
function mock() {
55-
return false;
56-
}
57-
});
58-
59-
tape( 'the main export is a wrapper around a builtin if an environment supports String.prototype.trim and has expected behavior', function test( t ) {
60-
var trim = proxyquire( './../dist', {
61-
'./has_builtin.js': true,
62-
'./check.js': mock
63-
});
64-
t.equal( trim, main, 'returns expected value' );
65-
t.end();
66-
67-
function mock() {
68-
return true;
69-
}
70-
});
71-
72-
tape( 'the function removes all whitespace characters at the beginning and end of a string', function test( t ) {
73-
var expected;
74-
var actual;
75-
76-
expected = 'Whitespace';
77-
actual = trim( ' Whitespace ' );
78-
t.equal( actual, expected, 'removes all spaces' );
79-
80-
expected = 'beep';
81-
actual = trim( ' beep' );
82-
t.equal( actual, expected, 'removes all spaces' );
83-
84-
expected = 'boop';
85-
actual = trim( 'boop ' );
86-
t.equal( actual, expected, 'removes all spaces' );
87-
88-
expected = 'foo foo';
89-
actual = trim( ' foo foo ' );
90-
t.equal( actual, expected, 'removes all spaces' );
91-
92-
expected = '# bar bar bar';
93-
actual = trim( '# bar bar bar ' );
94-
t.equal( actual, expected, 'removes all spaces' );
95-
96-
expected = '# beep boop';
97-
actual = trim( ' # beep boop' );
98-
t.equal( actual, expected, 'removes all spaces' );
99-
100-
expected = 'foo \n\n\n\n foo';
101-
actual = trim( ' foo \n\n\n\n foo ' );
102-
t.equal( actual, expected, 'removes all spaces' );
103-
104-
expected = 'Tabs';
105-
actual = trim( '\t\t\tTabs\t\t\t' );
106-
t.equal( actual, expected, 'removes all tabs' );
107-
108-
expected = 'New Lines';
109-
actual = trim( '\n\n\nNew Lines\n\n\n' );
110-
t.equal( actual, expected, 'removes all newline characters' );
111-
112-
expected = 'Beep';
113-
actual = trim( ' \r\n\tBeep \r\n\t' );
114-
t.equal( actual, expected, 'removes all whitespace characters' );
115-
116-
expected = 'beep';
117-
actual = trim( '\fbeep\f' );
118-
t.equal( actual, expected, 'removes \\f' );
119-
120-
expected = 'beep';
121-
actual = trim( '\nbeep\n' );
122-
t.equal( actual, expected, 'removes \\n' );
123-
124-
expected = 'beep';
125-
actual = trim( '\tbeep\t' );
126-
t.equal( actual, expected, 'removes \\t' );
127-
128-
expected = 'beep';
129-
actual = trim( '\vbeep\v' );
130-
t.equal( actual, expected, 'removes \\v' );
131-
132-
expected = 'beep';
133-
actual = trim( '\u1680beep\u1680' );
134-
t.equal( actual, expected, 'removes \\u1680' );
135-
136-
expected = 'beep';
137-
actual = trim( '\u2000beep\u2000' );
138-
t.equal( actual, expected, 'removes \\u2000' );
139-
140-
expected = 'beep';
141-
actual = trim( '\u2001beep\u2001' );
142-
t.equal( actual, expected, 'removes \\u2001' );
143-
144-
expected = 'beep';
145-
actual = trim( '\u2002beep\u2002' );
146-
t.equal( actual, expected, 'removes \\u2002' );
147-
148-
expected = 'beep';
149-
actual = trim( '\u2003beep\u2003' );
150-
t.equal( actual, expected, 'removes \\u2003' );
151-
152-
expected = 'beep';
153-
actual = trim( '\u2004beep\u2004' );
154-
t.equal( actual, expected, 'removes \\u2004' );
155-
156-
expected = 'beep';
157-
actual = trim( '\u2005beep\u2005' );
158-
t.equal( actual, expected, 'removes \\u2005' );
159-
160-
expected = 'beep';
161-
actual = trim( '\u2006beep\u2006' );
162-
t.equal( actual, expected, 'removes \\u2006' );
163-
164-
expected = 'beep';
165-
actual = trim( '\u2007beep\u2007' );
166-
t.equal( actual, expected, 'removes \\u2007' );
167-
168-
expected = 'beep';
169-
actual = trim( '\u2008beep\u2008' );
170-
t.equal( actual, expected, 'removes \\u2008' );
171-
172-
expected = 'beep';
173-
actual = trim( '\u2009beep\u2009' );
174-
t.equal( actual, expected, 'removes \\u2009' );
175-
176-
expected = 'beep';
177-
actual = trim( '\u200abeep\u200a' );
178-
t.equal( actual, expected, 'removes \\u200a' );
179-
180-
expected = 'beep';
181-
actual = trim( '\u2028beep\u2028' );
182-
t.equal( actual, expected, 'removes \\u2028' );
183-
184-
expected = 'beep';
185-
actual = trim( '\u2029beep\u2029' );
186-
t.equal( actual, expected, 'removes \\u2029' );
187-
188-
expected = 'beep';
189-
actual = trim( '\u202fbeep\u202f' );
190-
t.equal( actual, expected, 'removes \\u202f' );
191-
192-
expected = 'beep';
193-
actual = trim( '\u205fbeep\u205f' );
194-
t.equal( actual, expected, 'removes \\u205f' );
195-
196-
expected = 'beep';
197-
actual = trim( '\u3000beep\u3000' );
198-
t.equal( actual, expected, 'removes \\u3000' );
199-
200-
expected = 'beep';
201-
actual = trim( '\ufeffbeep\ufeff' );
202-
t.equal( actual, expected, 'removes \\ufefff' );
203-
204-
t.end();
205-
});
206-
207-
tape( 'the function does not remove the Mongolian space separator in accordance with Unicode 6.3.0 and later', function test( t ) {
208-
var expected;
209-
var actual;
210-
211-
expected = '\u180ebeep\u180e';
212-
actual = trim( '\u180ebeep\u180e' );
213-
t.equal( actual, expected, 'does not remove \\u180e' );
214-
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
21532
t.end();
21633
});

0 commit comments

Comments
 (0)
0