@@ -727,6 +727,43 @@ describe('Util', function () {
727727 }
728728 } ) ;
729729
730+ describe ( "Util.constructHostname" , ( ) => {
731+ it ( "works with undefined region" , ( ) => {
732+ assert . strictEqual (
733+ Util . constructHostname ( undefined , "abc123" ) ,
734+ "abc123.snowflakecomputing.com"
735+ ) ;
736+ } ) ;
737+
738+ it ( "adds region to the account" , ( ) => {
739+ assert . strictEqual (
740+ Util . constructHostname ( "us-west-1" , "abc123" ) ,
741+ "abc123.us-west-1.snowflakecomputing.com"
742+ ) ;
743+ } ) ;
744+
745+ it ( "Skips region when it is us-west-2" , ( ) => {
746+ assert . strictEqual (
747+ Util . constructHostname ( "us-west-2" , "abc123" ) ,
748+ "abc123.snowflakecomputing.com"
749+ ) ;
750+ } ) ;
751+
752+ it ( "Ignores the account region when a different region is specified" , ( ) => {
753+ assert . strictEqual (
754+ Util . constructHostname ( "us-east-2" , "abc123.us-east-1" ) ,
755+ "abc123.us-east-2.snowflakecomputing.com"
756+ ) ;
757+ } ) ;
758+
759+ it ( "Uses account region when there is no other region specified" , ( ) => {
760+ assert . strictEqual (
761+ Util . constructHostname ( undefined , "abc123.us-east-1" ) ,
762+ "abc123.us-east-1.snowflakecomputing.com"
763+ ) ;
764+ } ) ;
765+ } ) ;
766+
730767 describe ( 'Okta Authentication Retry Condition' , ( ) => {
731768 const testCases =
732769 [
0 commit comments