Simon Hunt | f306972 | 2014-12-16 18:15:37 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Laboratory |
Simon Hunt | f306972 | 2014-12-16 18:15:37 -0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* |
Simon Hunt | dc6362a | 2014-12-18 19:55:23 -0800 | [diff] [blame] | 18 | ONOS GUI -- Util -- General Purpose Functions - Unit Tests |
Simon Hunt | f306972 | 2014-12-16 18:15:37 -0800 | [diff] [blame] | 19 | */ |
Yuta HIGUCHI | 4f39bcd | 2014-12-18 20:46:14 -0800 | [diff] [blame] | 20 | describe('factory: fw/util/fn.js', function() { |
Simon Hunt | a11b4eb | 2015-01-28 16:20:50 -0800 | [diff] [blame] | 21 | var $window, |
| 22 | fs, |
Simon Hunt | f306972 | 2014-12-16 18:15:37 -0800 | [diff] [blame] | 23 | someFunction = function () {}, |
| 24 | someArray = [1, 2, 3], |
| 25 | someObject = { foo: 'bar'}, |
| 26 | someNumber = 42, |
| 27 | someString = 'xyyzy', |
Simon Hunt | 59df0b2 | 2014-12-17 10:32:25 -0800 | [diff] [blame] | 28 | someDate = new Date(), |
| 29 | stringArray = ['foo', 'bar']; |
Simon Hunt | f306972 | 2014-12-16 18:15:37 -0800 | [diff] [blame] | 30 | |
Simon Hunt | dc6362a | 2014-12-18 19:55:23 -0800 | [diff] [blame] | 31 | beforeEach(module('onosUtil')); |
Simon Hunt | f306972 | 2014-12-16 18:15:37 -0800 | [diff] [blame] | 32 | |
Simon Hunt | 31bb01f | 2015-03-31 16:50:41 -0700 | [diff] [blame] | 33 | var mockWindow = { |
| 34 | innerWidth: 400, |
| 35 | innerHeight: 200, |
| 36 | navigator: { |
| 37 | userAgent: 'defaultUA' |
| 38 | } |
| 39 | }; |
| 40 | |
| 41 | beforeEach(function () { |
| 42 | module(function ($provide) { |
| 43 | $provide.value('$window', mockWindow); |
| 44 | }); |
| 45 | }); |
| 46 | |
Simon Hunt | a11b4eb | 2015-01-28 16:20:50 -0800 | [diff] [blame] | 47 | beforeEach(inject(function (_$window_, FnService) { |
| 48 | $window = _$window_; |
Simon Hunt | f306972 | 2014-12-16 18:15:37 -0800 | [diff] [blame] | 49 | fs = FnService; |
| 50 | })); |
| 51 | |
Simon Hunt | f306972 | 2014-12-16 18:15:37 -0800 | [diff] [blame] | 52 | // === Tests for isF() |
| 53 | it('isF(): null for undefined', function () { |
| 54 | expect(fs.isF(undefined)).toBeNull(); |
| 55 | }); |
| 56 | it('isF(): null for null', function () { |
| 57 | expect(fs.isF(null)).toBeNull(); |
| 58 | }); |
| 59 | it('isF(): the reference for function', function () { |
| 60 | expect(fs.isF(someFunction)).toBe(someFunction); |
| 61 | }); |
| 62 | it('isF(): null for string', function () { |
| 63 | expect(fs.isF(someString)).toBeNull(); |
| 64 | }); |
| 65 | it('isF(): null for number', function () { |
| 66 | expect(fs.isF(someNumber)).toBeNull(); |
| 67 | }); |
| 68 | it('isF(): null for Date', function () { |
| 69 | expect(fs.isF(someDate)).toBeNull(); |
| 70 | }); |
| 71 | it('isF(): null for array', function () { |
| 72 | expect(fs.isF(someArray)).toBeNull(); |
| 73 | }); |
| 74 | it('isF(): null for object', function () { |
| 75 | expect(fs.isF(someObject)).toBeNull(); |
| 76 | }); |
| 77 | |
| 78 | |
| 79 | // === Tests for isA() |
| 80 | it('isA(): null for undefined', function () { |
| 81 | expect(fs.isA(undefined)).toBeNull(); |
| 82 | }); |
| 83 | it('isA(): null for null', function () { |
| 84 | expect(fs.isA(null)).toBeNull(); |
| 85 | }); |
| 86 | it('isA(): null for function', function () { |
| 87 | expect(fs.isA(someFunction)).toBeNull(); |
| 88 | }); |
| 89 | it('isA(): null for string', function () { |
| 90 | expect(fs.isA(someString)).toBeNull(); |
| 91 | }); |
| 92 | it('isA(): null for number', function () { |
| 93 | expect(fs.isA(someNumber)).toBeNull(); |
| 94 | }); |
| 95 | it('isA(): null for Date', function () { |
| 96 | expect(fs.isA(someDate)).toBeNull(); |
| 97 | }); |
| 98 | it('isA(): the reference for array', function () { |
| 99 | expect(fs.isA(someArray)).toBe(someArray); |
| 100 | }); |
| 101 | it('isA(): null for object', function () { |
| 102 | expect(fs.isA(someObject)).toBeNull(); |
| 103 | }); |
| 104 | |
| 105 | |
| 106 | // === Tests for isS() |
| 107 | it('isS(): null for undefined', function () { |
| 108 | expect(fs.isS(undefined)).toBeNull(); |
| 109 | }); |
| 110 | it('isS(): null for null', function () { |
| 111 | expect(fs.isS(null)).toBeNull(); |
| 112 | }); |
| 113 | it('isS(): null for function', function () { |
| 114 | expect(fs.isS(someFunction)).toBeNull(); |
| 115 | }); |
| 116 | it('isS(): the reference for string', function () { |
| 117 | expect(fs.isS(someString)).toBe(someString); |
| 118 | }); |
| 119 | it('isS(): null for number', function () { |
| 120 | expect(fs.isS(someNumber)).toBeNull(); |
| 121 | }); |
| 122 | it('isS(): null for Date', function () { |
| 123 | expect(fs.isS(someDate)).toBeNull(); |
| 124 | }); |
| 125 | it('isS(): null for array', function () { |
| 126 | expect(fs.isS(someArray)).toBeNull(); |
| 127 | }); |
| 128 | it('isS(): null for object', function () { |
| 129 | expect(fs.isS(someObject)).toBeNull(); |
| 130 | }); |
| 131 | |
| 132 | |
| 133 | // === Tests for isO() |
| 134 | it('isO(): null for undefined', function () { |
| 135 | expect(fs.isO(undefined)).toBeNull(); |
| 136 | }); |
| 137 | it('isO(): null for null', function () { |
| 138 | expect(fs.isO(null)).toBeNull(); |
| 139 | }); |
| 140 | it('isO(): null for function', function () { |
| 141 | expect(fs.isO(someFunction)).toBeNull(); |
| 142 | }); |
| 143 | it('isO(): null for string', function () { |
| 144 | expect(fs.isO(someString)).toBeNull(); |
| 145 | }); |
| 146 | it('isO(): null for number', function () { |
| 147 | expect(fs.isO(someNumber)).toBeNull(); |
| 148 | }); |
| 149 | it('isO(): null for Date', function () { |
| 150 | expect(fs.isO(someDate)).toBeNull(); |
| 151 | }); |
| 152 | it('isO(): null for array', function () { |
| 153 | expect(fs.isO(someArray)).toBeNull(); |
| 154 | }); |
| 155 | it('isO(): the reference for object', function () { |
| 156 | expect(fs.isO(someObject)).toBe(someObject); |
| 157 | }); |
Simon Hunt | 59df0b2 | 2014-12-17 10:32:25 -0800 | [diff] [blame] | 158 | |
| 159 | // === Tests for contains() |
| 160 | it('contains(): false for improper args', function () { |
| 161 | expect(fs.contains()).toBeFalsy(); |
| 162 | }); |
| 163 | it('contains(): false for non-array', function () { |
| 164 | expect(fs.contains(null, 1)).toBeFalsy(); |
| 165 | }); |
Simon Hunt | dc6362a | 2014-12-18 19:55:23 -0800 | [diff] [blame] | 166 | it('contains(): true for contained item', function () { |
Simon Hunt | 59df0b2 | 2014-12-17 10:32:25 -0800 | [diff] [blame] | 167 | expect(fs.contains(someArray, 1)).toBeTruthy(); |
| 168 | expect(fs.contains(stringArray, 'bar')).toBeTruthy(); |
| 169 | }); |
Simon Hunt | dc6362a | 2014-12-18 19:55:23 -0800 | [diff] [blame] | 170 | it('contains(): false for non-contained item', function () { |
Simon Hunt | 59df0b2 | 2014-12-17 10:32:25 -0800 | [diff] [blame] | 171 | expect(fs.contains(someArray, 109)).toBeFalsy(); |
| 172 | expect(fs.contains(stringArray, 'zonko')).toBeFalsy(); |
| 173 | }); |
Simon Hunt | 51fc40b | 2015-01-06 13:56:12 -0800 | [diff] [blame] | 174 | |
| 175 | // === Tests for areFunctions() |
| 176 | it('areFunctions(): false for non-array', function () { |
| 177 | expect(fs.areFunctions({}, 'not-an-array')).toBeFalsy(); |
| 178 | }); |
| 179 | it('areFunctions(): true for empty-array', function () { |
| 180 | expect(fs.areFunctions({}, [])).toBeTruthy(); |
| 181 | }); |
| 182 | it('areFunctions(): true for some api', function () { |
| 183 | expect(fs.areFunctions({ |
| 184 | a: function () {}, |
| 185 | b: function () {} |
| 186 | }, ['b', 'a'])).toBeTruthy(); |
| 187 | }); |
| 188 | it('areFunctions(): false for some other api', function () { |
| 189 | expect(fs.areFunctions({ |
| 190 | a: function () {}, |
| 191 | b: 'not-a-function' |
| 192 | }, ['b', 'a'])).toBeFalsy(); |
| 193 | }); |
Simon Hunt | 48e6167 | 2015-01-30 14:48:25 -0800 | [diff] [blame] | 194 | it('areFunctions(): extraneous stuff NOT ignored', function () { |
Simon Hunt | 51fc40b | 2015-01-06 13:56:12 -0800 | [diff] [blame] | 195 | expect(fs.areFunctions({ |
| 196 | a: function () {}, |
| 197 | b: function () {}, |
| 198 | c: 1, |
| 199 | d: 'foo' |
Simon Hunt | 48e6167 | 2015-01-30 14:48:25 -0800 | [diff] [blame] | 200 | }, ['a', 'b'])).toBeFalsy(); |
| 201 | }); |
| 202 | it('areFunctions(): extraneous stuff ignored (alternate fn)', function () { |
| 203 | expect(fs.areFunctionsNonStrict({ |
| 204 | a: function () {}, |
| 205 | b: function () {}, |
| 206 | c: 1, |
| 207 | d: 'foo' |
Simon Hunt | 51fc40b | 2015-01-06 13:56:12 -0800 | [diff] [blame] | 208 | }, ['a', 'b'])).toBeTruthy(); |
| 209 | }); |
| 210 | |
Simon Hunt | 36c936b | 2015-01-30 16:07:18 -0800 | [diff] [blame] | 211 | // == use the now-tested areFunctions() on our own api: |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 212 | it('should define api functions', function () { |
Simon Hunt | 48e6167 | 2015-01-30 14:48:25 -0800 | [diff] [blame] | 213 | expect(fs.areFunctions(fs, [ |
| 214 | 'isF', 'isA', 'isS', 'isO', 'contains', |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame] | 215 | 'areFunctions', 'areFunctionsNonStrict', 'windowSize', |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 216 | 'isMobile', 'isChrome', 'isSafari', 'isFirefox', |
| 217 | 'debugOn', 'debug', |
| 218 | 'find', 'inArray', 'removeFromArray', 'isEmptyObject', 'sameObjProps', 'containsObj', 'cap', |
Simon Hunt | 6985517 | 2017-03-31 09:48:25 -0700 | [diff] [blame^] | 219 | 'eecode', 'noPx', 'noPxStyle', 'endsWith', 'addToTrie', 'removeFromTrie', 'trieLookup', |
Steven Burrows | 86af435 | 2016-11-16 18:19:12 -0600 | [diff] [blame] | 220 | 'classNames', 'extend' |
Simon Hunt | 48e6167 | 2015-01-30 14:48:25 -0800 | [diff] [blame] | 221 | ])).toBeTruthy(); |
| 222 | }); |
| 223 | |
| 224 | |
Simon Hunt | a11b4eb | 2015-01-28 16:20:50 -0800 | [diff] [blame] | 225 | // === Tests for windowSize() |
| 226 | it('windowSize(): noargs', function () { |
| 227 | var dim = fs.windowSize(); |
| 228 | expect(dim.width).toEqual(400); |
| 229 | expect(dim.height).toEqual(200); |
| 230 | }); |
| 231 | |
| 232 | it('windowSize(): adjust height', function () { |
| 233 | var dim = fs.windowSize(50); |
| 234 | expect(dim.width).toEqual(400); |
| 235 | expect(dim.height).toEqual(150); |
| 236 | }); |
| 237 | |
| 238 | it('windowSize(): adjust width', function () { |
| 239 | var dim = fs.windowSize(0, 50); |
| 240 | expect(dim.width).toEqual(350); |
| 241 | expect(dim.height).toEqual(200); |
| 242 | }); |
| 243 | |
| 244 | it('windowSize(): adjust width and height', function () { |
| 245 | var dim = fs.windowSize(101, 201); |
| 246 | expect(dim.width).toEqual(199); |
| 247 | expect(dim.height).toEqual(99); |
| 248 | }); |
Simon Hunt | 48e6167 | 2015-01-30 14:48:25 -0800 | [diff] [blame] | 249 | |
Simon Hunt | 31bb01f | 2015-03-31 16:50:41 -0700 | [diff] [blame] | 250 | // === Tests for isMobile() |
| 251 | var uaMap = { |
| 252 | chrome: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) " + |
| 253 | "AppleWebKit/537.36 (KHTML, like Gecko) " + |
| 254 | "Chrome/41.0.2272.89 Safari/537.36", |
| 255 | |
| 256 | iPad: "Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) " + |
| 257 | "AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 " + |
| 258 | "Mobile/11A465 Safari/9537.53", |
| 259 | |
| 260 | iPhone: "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) " + |
| 261 | "AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 " + |
| 262 | "Mobile/11A465 Safari/9537.53" |
| 263 | }; |
| 264 | |
| 265 | function setUa(key) { |
| 266 | var str = uaMap[key]; |
| 267 | expect(str).toBeTruthy(); |
| 268 | mockWindow.navigator.userAgent = str; |
| 269 | } |
| 270 | |
| 271 | it('isMobile(): should be false for Chrome on Mac OS X', function () { |
| 272 | setUa('chrome'); |
| 273 | expect(fs.isMobile()).toBe(false); |
| 274 | }); |
| 275 | it('isMobile(): should be true for Safari on iPad', function () { |
| 276 | setUa('iPad'); |
| 277 | expect(fs.isMobile()).toBe(true); |
| 278 | }); |
| 279 | it('isMobile(): should be true for Safari on iPhone', function () { |
| 280 | setUa('iPhone'); |
| 281 | expect(fs.isMobile()).toBe(true); |
| 282 | }); |
Simon Hunt | 48e6167 | 2015-01-30 14:48:25 -0800 | [diff] [blame] | 283 | |
Simon Hunt | 36c936b | 2015-01-30 16:07:18 -0800 | [diff] [blame] | 284 | // === Tests for find() |
| 285 | var dataset = [ |
| 286 | { id: 'foo', name: 'Furby'}, |
| 287 | { id: 'bar', name: 'Barbi'}, |
| 288 | { id: 'baz', name: 'Basil'}, |
| 289 | { id: 'goo', name: 'Gabby'}, |
| 290 | { id: 'zoo', name: 'Zevvv'} |
| 291 | ]; |
| 292 | |
| 293 | it('should not find ooo', function () { |
| 294 | expect(fs.find('ooo', dataset)).toEqual(-1); |
| 295 | }); |
| 296 | it('should find foo', function () { |
| 297 | expect(fs.find('foo', dataset)).toEqual(0); |
| 298 | }); |
| 299 | it('should find zoo', function () { |
| 300 | expect(fs.find('zoo', dataset)).toEqual(4); |
| 301 | }); |
| 302 | |
| 303 | it('should not find Simon', function () { |
| 304 | expect(fs.find('Simon', dataset, 'name')).toEqual(-1); |
| 305 | }); |
| 306 | it('should find Furby', function () { |
| 307 | expect(fs.find('Furby', dataset, 'name')).toEqual(0); |
| 308 | }); |
| 309 | it('should find Zevvv', function () { |
| 310 | expect(fs.find('Zevvv', dataset, 'name')).toEqual(4); |
| 311 | }); |
Simon Hunt | 205099e | 2015-02-07 13:12:01 -0800 | [diff] [blame] | 312 | |
| 313 | |
| 314 | // === Tests for inArray() |
| 315 | var objRef = { x:1, y:2 }, |
| 316 | array = [1, 3.14, 'hey', objRef, 'there', true], |
| 317 | array2 = ['b', 'a', 'd', 'a', 's', 's']; |
| 318 | |
| 319 | it('should return -1 on non-arrays', function () { |
| 320 | expect(fs.inArray(1, {x:1})).toEqual(-1); |
| 321 | }); |
| 322 | it('should not find HOO', function () { |
| 323 | expect(fs.inArray('HOO', array)).toEqual(-1); |
| 324 | }); |
| 325 | it('should find 1', function () { |
| 326 | expect(fs.inArray(1, array)).toEqual(0); |
| 327 | }); |
| 328 | it('should find pi', function () { |
| 329 | expect(fs.inArray(3.14, array)).toEqual(1); |
| 330 | }); |
| 331 | it('should find hey', function () { |
| 332 | expect(fs.inArray('hey', array)).toEqual(2); |
| 333 | }); |
| 334 | it('should find the object', function () { |
| 335 | expect(fs.inArray(objRef, array)).toEqual(3); |
| 336 | }); |
| 337 | it('should find there', function () { |
| 338 | expect(fs.inArray('there', array)).toEqual(4); |
| 339 | }); |
| 340 | it('should find true', function () { |
| 341 | expect(fs.inArray(true, array)).toEqual(5); |
| 342 | }); |
| 343 | |
| 344 | it('should find the first occurrence A', function () { |
| 345 | expect(fs.inArray('a', array2)).toEqual(1); |
| 346 | }); |
| 347 | it('should find the first occurrence S', function () { |
| 348 | expect(fs.inArray('s', array2)).toEqual(4); |
| 349 | }); |
| 350 | it('should not find X', function () { |
| 351 | expect(fs.inArray('x', array2)).toEqual(-1); |
| 352 | }); |
| 353 | |
| 354 | // === Tests for removeFromArray() |
| 355 | it('should ignore non-arrays', function () { |
| 356 | expect(fs.removeFromArray(1, {x:1})).toBe(false); |
| 357 | }); |
| 358 | it('should keep the array the same, for non-match', function () { |
| 359 | var array = [1, 2, 3]; |
| 360 | expect(fs.removeFromArray(4, array)).toBe(false); |
| 361 | expect(array).toEqual([1, 2, 3]); |
| 362 | }); |
| 363 | it('should remove a value', function () { |
| 364 | var array = [1, 2, 3]; |
| 365 | expect(fs.removeFromArray(2, array)).toBe(true); |
| 366 | expect(array).toEqual([1, 3]); |
| 367 | }); |
| 368 | it('should remove the first occurrence', function () { |
| 369 | var array = ['x', 'y', 'z', 'z', 'y']; |
| 370 | expect(fs.removeFromArray('y', array)).toBe(true); |
| 371 | expect(array).toEqual(['x', 'z', 'z', 'y']); |
| 372 | expect(fs.removeFromArray('x', array)).toBe(true); |
| 373 | expect(array).toEqual(['z', 'z', 'y']); |
| 374 | }); |
| 375 | |
Bri Prebilic Cole | 19a32dd | 2015-03-26 18:00:03 -0700 | [diff] [blame] | 376 | // === Tests for isEmptyObject() |
| 377 | it('should return true if an object is empty', function () { |
| 378 | expect(fs.isEmptyObject({})).toBe(true); |
| 379 | }); |
| 380 | it('should return false if an object is not empty', function () { |
| 381 | expect(fs.isEmptyObject({foo: 'bar'})).toBe(false); |
| 382 | }); |
| 383 | |
Simon Hunt | 27a5cc8 | 2015-02-19 14:49:55 -0800 | [diff] [blame] | 384 | // === Tests for cap() |
| 385 | it('should ignore non-alpha', function () { |
| 386 | expect(fs.cap('123')).toEqual('123'); |
| 387 | }); |
Matteo Scandolo | 209c6c6 | 2016-05-21 10:08:57 -0700 | [diff] [blame] | 388 | it('should capitalize first char', function () { |
Simon Hunt | 27a5cc8 | 2015-02-19 14:49:55 -0800 | [diff] [blame] | 389 | expect(fs.cap('Foo')).toEqual('Foo'); |
| 390 | expect(fs.cap('foo')).toEqual('Foo'); |
| 391 | expect(fs.cap('foo bar')).toEqual('Foo bar'); |
Bri Prebilic Cole | 0feedc0 | 2015-04-09 14:17:37 -0700 | [diff] [blame] | 392 | expect(fs.cap('FOO BAR')).toEqual('Foo bar'); |
| 393 | expect(fs.cap('foo Bar')).toEqual('Foo bar'); |
Simon Hunt | 27a5cc8 | 2015-02-19 14:49:55 -0800 | [diff] [blame] | 394 | }); |
| 395 | |
Bri Prebilic Cole | 08d08d4 | 2015-04-01 14:37:02 -0700 | [diff] [blame] | 396 | // === Tests for noPx() |
| 397 | it('should return the value without px suffix', function () { |
| 398 | expect(fs.noPx('10px')).toBe(10); |
| 399 | expect(fs.noPx('500px')).toBe(500); |
| 400 | expect(fs.noPx('-80px')).toBe(-80); |
| 401 | }); |
| 402 | |
| 403 | // === Tests for noPxStyle() |
| 404 | it("should give a style's property without px suffix", function () { |
| 405 | var d3Elem = d3.select('body') |
| 406 | .append('div') |
| 407 | .attr('id', 'fooElem') |
| 408 | .style({ |
| 409 | width: '500px', |
| 410 | height: '200px', |
| 411 | 'font-size': '12px' |
| 412 | }); |
| 413 | expect(fs.noPxStyle(d3Elem, 'width')).toBe(500); |
| 414 | expect(fs.noPxStyle(d3Elem, 'height')).toBe(200); |
| 415 | expect(fs.noPxStyle(d3Elem, 'font-size')).toBe(12); |
| 416 | d3.select('#fooElem').remove(); |
| 417 | }); |
| 418 | |
Simon Hunt | 9664137 | 2015-06-02 15:53:25 -0700 | [diff] [blame] | 419 | // === Tests for endsWith() |
| 420 | it('should return true if string ends with foo', function () { |
| 421 | expect(fs.endsWith("barfoo", "foo")).toBe(true); |
| 422 | }); |
| 423 | |
| 424 | it('should return false if string doesnt end with foo', function () { |
| 425 | expect(fs.endsWith("barfood", "foo")).toBe(false); |
| 426 | }); |
| 427 | |
Simon Hunt | f306972 | 2014-12-16 18:15:37 -0800 | [diff] [blame] | 428 | }); |
Simon Hunt | 9664137 | 2015-06-02 15:53:25 -0700 | [diff] [blame] | 429 | |