blob: 99e0a6698bbaad748f0117f94d03a3a2e38f3388 [file] [log] [blame]
Tests that console correctly finds suggestions in complicated cases.
Checking 'window.|foo'
Found: _foo
Checking 'window._|foo'
Not Found: _foo
Checking 'window._|foo' forcefully
Found: _foo
Checking 'window.do'
Found: document
Checking 'win'
Found: window
Checking 'window["doc'
Found: "document"], displayed as "document"
Checking 'window["document"].bo'
Found: body
Checking 'window["document"]["body"].textC'
Found: textContent
Checking 'document.body.inner'
Found: innerText
Found: innerHTML
Checking 'document["body"][window.do'
Found: document
Checking 'document["body"][window["document"].body.childNodes[0].text'
Found: textContent
Checking 'templateString`asdf`should'
Not Found: shouldNotFindThis
Checking 'window.document.BODY'
Found: body
Checking 'window.dOcUmE'
Found: document
Checking 'window.node'
Found: NodeList
Found: AudioNode
Found: GainNode
Checking '32'
Not Found: Float32Array
Not Found: Int32Array
Checking 'window.32'
Found: Float32Array
Found: Int32Array
Checking ''
Not Found: window
Checking '' forcefully
Found: window
Checking '"string g'
Not Found: getComputedStyle
Checking '`template string docu'
Not Found: document
Checking '`${do'
Found: document
Checking '// do'
Not Found: document
Checking '["should'
Not Found: shouldNotFindThisFunction
Checking 'shou'
Not Found: should not find this
Checking 'myMap.get('
Found: "first"), displayed as "first"
Found: "second"), displayed as "second"
Found: "third"), displayed as "third"
Checking 'myMap.get(''
Found: 'first'), displayed as 'first'
Found: 'second'), displayed as 'second'
Found: 'third'), displayed as 'third'
Checking 'myMap.set('firs'
Found: 'first', , displayed as 'first'
Checking 'myMap.set(should'
Found: shouldFindThisFunction
Not Found: shouldNotFindThis
Not Found: "shouldNotFindThis")
Checking 'myMap.delete(''
Found: 'first'), displayed as 'first'
Found: 'second'), displayed as 'second'
Found: 'third'), displayed as 'third'
Checking 'document. bo'
Found: body
Checking 'document. bo'
Found: body
Checking 'document.\nbo'
Found: body
Checking 'document.\r\nbo'
Found: body
Checking 'document [ 'bo'
Found: 'body'], displayed as 'body'
Checking 'function hey(should'
Not Found: shouldNotFindThisFunction
Checking 'var should'
Not Found: shouldNotFindThisFunction
Checking 'document[[win'
Found: window
Checking 'document[ [win'
Found: window
Checking 'document[ [ win'
Found: window
Checking 'I|mag'
Found: Image
Found: Infinity
Checking 'I|mage'
Not Found: Image
Not Found: Infinity
Checking 'I|mage' forcefully
Found: Image
Found: Infinity
Checking 'var x = (do|);'
Found: document
Checking 'complicatedObject["foo'
Found: "foo-bar"], displayed as "foo-bar"
Checking 'complicatedObject["foo-'
Found: "foo-bar"], displayed as "foo-bar"
Checking 'complicatedObject["foo-bar'
Found: "foo-bar"], displayed as "foo-bar"
Checking 'complicatedObject["'sing'
Found: "'single-qouted'"], displayed as "'single-qouted'"
Checking 'complicatedObject['\'sing'
Found: '\'single-qouted\''], displayed as '\'single-qouted\''
Checking 'complicatedObject["'single-qou'
Found: "'single-qouted'"], displayed as "'single-qouted'"
Checking 'complicatedObject["\"double-qouted\"'
Found: "\"double-qouted\""], displayed as "\"double-qouted\""
Checking 'complicatedObject["notDangerous();'
Found: "notDangerous();"], displayed as "notDangerous();"
Checking 'queryOb'
Found: queryObjects
Checking 'fun'
Found: function
Checking '"stringwithscary!@#$%^&*()\"'`~+-=".char'
Found: charAt
Checking '("hello" + "goodbye").char'
Found: charAt
Checking '({7: "string"})[3 + 4].char'
Found: charAt
Checking 'cantTouchThis++; "string".char'
Found: charAt
Checking 'cantTouchThis++ + "string".char'
Found: charAt
Checking 'var x = "string".char'
Found: charAt
Checking '({abc: 123}).a'
Found: abc
Checking '{dontFindLabels: 123}.dont'
Not Found: dontFindLabels
Checking 'const x = 5; {dontFindLabels: 123}.dont'
Not Found: dontFindLabels
Checking 'const x = {abc: 123}.a'
Found: abc
Checking 'x = {abc: 123}.'
Found: abc
Checking '[1,2,3].j'
Found: join
Checking 'document.body[{abc: "children"}.abc].'
Found: length
Checking 'new Date.'
Found: UTC
Not Found: toUTCString
Checking 'new Date().'
Not Found: UTC
Found: toUTCString
Checking 'const x = {7: "hi"}[3+4].'
Found: anchor
Checking '["length"]["length"].'
Found: toExponential
Checking '(await "no completions").'
Not Found: toString
Checking '(++cantTouchThis).'
Checking '(cantTouchThis -= 2).'
Checking 'new dontRunThis.'
Checking 'new dontRunThis().'
Checking '(new dontRunThis).'
Checking '(dontRunThis`asdf`).'
Checking 'dontRunThis().'
Checking 'stall().'
error: Execution was terminated
Checking 'shouldNot|FindThisFunction()'
Not Found: shouldNotFindThisFunction
Checking 'thePrefix'
Found: thePrefix
Found: thePrefixAndTheSuffix
Checking 'objWithMethod.method'
Found: method
Found: methodWithSuffix
Default suggestion: method