@@ -109,12 +109,11 @@ describe("all and only the specified prototype methods exist", () => {
109
109
const list = ( [ str ] ) => str . trim ( ) . split ( / \s + / g) ;
110
110
111
111
const names = list `
112
- constructor valueOf length with
113
- popped pushed reversed shifted slice
114
- sorted spliced concat includes indexOf join
112
+ constructor valueOf length with slice toReversed
113
+ toSorted toSpliced concat includes indexOf join
115
114
lastIndexOf entries every filter find findIndex
116
115
flat flatMap forEach keys map reduce reduceRight some
117
- unshifted toLocaleString toString values
116
+ toLocaleString toString values
118
117
` . concat ( Symbol . iterator , Symbol . toStringTag ) ;
119
118
120
119
test . each ( names ) ( ".%s" , name => {
@@ -162,18 +161,6 @@ test("Tuple.prototype.toString", () => {
162
161
expect ( ( ) => Tuple . prototype . toString . call ( [ ] ) ) . toThrow ( TypeError ) ;
163
162
} ) ;
164
163
165
- test ( "Tuple.prototype.popped" , ( ) => {
166
- expect ( Tuple ( ) . popped ( ) ) . toBe ( Tuple ( ) ) ;
167
- expect ( Tuple ( 1 ) . popped ( ) ) . toBe ( Tuple ( ) ) ;
168
- expect ( Tuple ( 1 , 2 , 3 ) . popped ( ) ) . toBe ( Tuple ( 1 , 2 ) ) ;
169
- expect ( ( ) => Tuple . prototype . popped . call ( [ 1 , 2 , 3 ] ) ) . toThrow ( TypeError ) ;
170
- } ) ;
171
- test ( "Tuple.prototype.pushed" , ( ) => {
172
- expect ( Tuple ( ) . pushed ( ) ) . toBe ( Tuple ( ) ) ;
173
- expect ( Tuple ( ) . pushed ( undefined ) ) . toBe ( Tuple ( undefined ) ) ;
174
- expect ( Tuple ( ) . pushed ( 1 , 2 , 3 ) ) . toBe ( Tuple ( 1 , 2 , 3 ) ) ;
175
- expect ( Tuple ( 1 , 2 , 3 ) . pushed ( 4 , 5 , 6 ) ) . toBe ( Tuple ( 1 , 2 , 3 , 4 , 5 , 6 ) ) ;
176
- } ) ;
177
164
test ( "Tuple.prototype.map" , ( ) => {
178
165
expect ( Tuple ( 1 , 2 , 3 ) . map ( x => 2 * x ) ) . toBe ( Tuple ( 2 , 4 , 6 ) ) ;
179
166
expect ( ( ) => Tuple . prototype . map . call ( [ 1 , 2 , 3 ] , x => 2 * x ) ) . toThrow (
@@ -207,6 +194,15 @@ test("Tuple.prototype.concat", () => {
207
194
Tuple ( 1 , 2 , 3 , 4 , 5 , 6 , 7 ) ,
208
195
) ;
209
196
} ) ;
197
+ test ( "Tuple.prototype.toSorted" , ( ) => {
198
+ expect ( Tuple ( 1 , 3 , 2 ) . toSorted ( ) ) . toBe ( Tuple ( 1 , 2 , 3 ) ) ;
199
+ } ) ;
200
+ test ( "Tuple.prototype.toReversed" , ( ) => {
201
+ expect ( Tuple ( 3 , 2 , 1 ) . toReversed ( ) ) . toBe ( Tuple ( 1 , 2 , 3 ) ) ;
202
+ } ) ;
203
+ test ( "Tuple.prototype.toSpliced" , ( ) => {
204
+ expect ( Tuple ( 1 , 1 , 1 , 4 ) . toSpliced ( 1 , 2 , 2 , 3 ) ) . toBe ( Tuple ( 1 , 2 , 3 , 4 ) ) ;
205
+ } ) ;
210
206
// TODO: Tuple prototype methods
211
207
212
208
describe ( "correct descriptors" , ( ) => {
0 commit comments