Created
March 17, 2022 08:12
-
-
Save adamcameron/8532491d75d07d26f6ff3d39be99d532 to your computer and use it in GitHub Desktop.
Code for request.testBox fail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component { | |
request.testBox.debug("in pseudo constructor") | |
static { | |
request.testBox.debug("in static constructor") | |
} | |
function init() { | |
request.testBox.debug("in constructor") | |
} | |
function testMe() { | |
request.testBox.debug("in method") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import test.BaseSpec | |
component extends=BaseSpec { | |
function run() { | |
describe("Testing request.testbox.debug", () => { | |
it("should write to debug buffer", () => { | |
request.testbox.debug("hi?") | |
expect(this.$debugBuffer).toHaveLength(1) | |
expect(this.$debugBuffer[1].data).toBe("hi?") | |
}) | |
fit("should write to debug buffer when called from a SUT", () => { | |
sut = new Adam() | |
sut.testMe() | |
messagesOnly = this.$debugBuffer.map((debugEntry) => debugEntry.data) | |
expect(messagesOnly).toHaveLength(4) | |
expect(messagesOnly).toBe([ | |
"in static constructor", | |
"in pseudo constructor", | |
"in constructor", | |
"in method" | |
]) | |
}) | |
}) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Component [test.unit.Adam] has no accessible Member with name [$DEBUGBUFFER] | |
Stacktrace The Error Occurred in | |
/app/testbox/system/BaseSpec.cfc: line 1451 | |
1449: // add to debug output | |
1450: arrayAppend( | |
1451: this.$debugBuffer, | |
1452: { | |
1453: data : newVar, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment