@@ -9,7 +9,7 @@ import { connectToWebsocket, enableDebugging, pauseDebugging } from "./src/debug
99import * as officeAddinTestServer from "office-addin-test-server" ;
1010import * as path from "path" ;
1111
12- /* global process, describe, before, it, after */
12+ /* global process, describe, before, it, after, console */
1313const host : string = "excel" ;
1414const manifestPath = path . resolve ( `${ process . cwd ( ) } /test/end-to-end/test-manifest.xml` ) ;
1515const port : number = 4201 ;
@@ -43,41 +43,42 @@ describe("Test Excel Custom Functions", function () {
4343 describe ( "Get test results for custom functions and validate results" , function ( ) {
4444 it ( "should get results from the taskpane application" , async function ( ) {
4545 this . timeout ( 0 ) ;
46- // Expecting six result values
46+ // Expecting six result values + user agent
4747 testValues = await testServer . getTestResults ( ) ;
48- assert . strictEqual ( testValues . length , 6 ) ;
48+ console . log ( `User Agent: ${ testValues [ 0 ] . Value } ` ) ;
49+ assert . strictEqual ( testValues . length , 7 ) ;
4950 } ) ;
5051 it ( "ADD function should return expected value" , async function ( ) {
51- assert . strictEqual ( testJsonData . functions . ADD . result , testValues [ 0 ] . Value ) ;
52+ assert . strictEqual ( testJsonData . functions . ADD . result , testValues [ 1 ] . Value ) ;
5253 } ) ;
5354 it ( "CLOCK function should return expected value" , async function ( ) {
5455 // Check that captured values are different to ensure the function is streaming
55- assert . notStrictEqual ( testValues [ 1 ] . Value , testValues [ 2 ] . Value ) ;
56+ assert . notStrictEqual ( testValues [ 2 ] . Value , testValues [ 3 ] . Value ) ;
5657 // Check if the returned string contains 'AM', 'PM', or 'GMT', indicating it's a time-stamp
57- assert . strictEqual (
58- testValues [ 1 ] . Value . includes ( testJsonData . functions . CLOCK . result . amString ) ||
59- testValues [ 1 ] . Value . includes ( testJsonData . functions . CLOCK . result . pmString ) ||
60- testValues [ 1 ] . Value . includes ( testJsonData . functions . CLOCK . result . timeZoneString ) ,
61- true ,
62- "Found timestamp indicator string in first value '" + testValues [ 1 ] . Value + "'"
63- ) ;
6458 assert . strictEqual (
6559 testValues [ 2 ] . Value . includes ( testJsonData . functions . CLOCK . result . amString ) ||
6660 testValues [ 2 ] . Value . includes ( testJsonData . functions . CLOCK . result . pmString ) ||
6761 testValues [ 2 ] . Value . includes ( testJsonData . functions . CLOCK . result . timeZoneString ) ,
6862 true ,
69- "Found timestamp indicator string in second value '" + testValues [ 2 ] . Value + "'"
63+ "Found timestamp indicator string in first value '" + testValues [ 2 ] . Value + "'"
64+ ) ;
65+ assert . strictEqual (
66+ testValues [ 3 ] . Value . includes ( testJsonData . functions . CLOCK . result . amString ) ||
67+ testValues [ 3 ] . Value . includes ( testJsonData . functions . CLOCK . result . pmString ) ||
68+ testValues [ 3 ] . Value . includes ( testJsonData . functions . CLOCK . result . timeZoneString ) ,
69+ true ,
70+ "Found timestamp indicator string in second value '" + testValues [ 3 ] . Value + "'"
7071 ) ;
7172 } ) ;
7273 it ( "INCREMENT function should return expected value" , async function ( ) {
7374 // Check that captured values are different to ensure the function is streaming
7475 assert . notStrictEqual ( testValues [ 3 ] . Value , testValues [ 4 ] . Value ) ;
7576 // Check to see that both captured streaming values are divisible by 4
76- assert . strictEqual ( 0 , testValues [ 3 ] . Value % testJsonData . functions . INCREMENT . result ) ;
7777 assert . strictEqual ( 0 , testValues [ 4 ] . Value % testJsonData . functions . INCREMENT . result ) ;
78+ assert . strictEqual ( 0 , testValues [ 5 ] . Value % testJsonData . functions . INCREMENT . result ) ;
7879 } ) ;
7980 it ( "LOG function should return expected value" , async function ( ) {
80- assert . strictEqual ( testJsonData . functions . LOG . result , testValues [ 5 ] . Value ) ;
81+ assert . strictEqual ( testJsonData . functions . LOG . result , testValues [ 6 ] . Value ) ;
8182 } ) ;
8283 } ) ;
8384 after ( "Teardown test environment" , async function ( ) {
0 commit comments