deno.land / x / mongoose@6.7.5 / test / helpers / getFunctionName.test.js

getFunctionName.test.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'use strict';
const assert = require('assert');const getFunctionName = require('../../lib/helpers/getFunctionName');
describe('getFunctionName', () => { it('return fn.name', () => { assert.equal(getFunctionName({ name: 'fnName' }), 'fnName'); });
it('return function name', () => { assert.equal(getFunctionName(function fnName() {}), 'fnName'); });
it('return function functionName', () => { assert.equal(getFunctionName(function functionName() {}), 'functionName'); });
it('return undefined for arrow function', () => { // I can't say it's expected behavior, but is how it's behave. assert.equal(getFunctionName(() => []), undefined); });});
mongoose

Version Info

Tagged at
a year ago