Skip to content

Commit 1920c9f

Browse files
committed
import change
1 parent f5869c1 commit 1920c9f

File tree

6 files changed

+26
-15
lines changed

6 files changed

+26
-15
lines changed

test/test-st2-invalid-auth.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ chai.use(chaiAsPromised);
3434
global.process.exit = sinon.spy();
3535

3636
describe("invalid st2 credential configuration", async function() {
37-
//var Robot = await import("hubot/src/Robot.mjs");
38-
const robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
39-
//var robot = new Robot("mock-adapter", false, "Hubot");
37+
var hubot_import = await import("hubot/index.mjs");
38+
//var robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
39+
var robot = new hubot_import.Robot("mock-adapter", false, "Hubot");
4040
robot.logger = new Logger(true);
4141
var restore_env = null,
4242
info_spy = sinon.spy(robot.logger, 'info'),

test/test-st2-unauthorized.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ describe("auth with invalid st2 API key", async function() {
3232
//const Robot = await import("hubot/src/Robot.mjs");
3333
//var Robot = await import("hubot/src/Robot.mjs");
3434
var stop;
35+
var hubot_import = await import("hubot/index.mjs");
3536
//var robot = new (await import("hubot/src/Robot.mjs")).default("mock-adapter", true, "Hubot");
36-
const robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
37+
//const robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
3738

38-
//var robot = new Robot("mock-adapter", true, "Hubot");
39+
var robot = new hubot_import.Robot("mock-adapter", true, "Hubot");
3940
robot.logger = new Logger(true);
4041
var recordedError = null,
4142
error_spy = sinon.spy(robot.logger, 'error'),

test/test-st2bot-envvars.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ describe("environment variable configuration", async function () {
3232
//const Robot = await import("hubot/src/Robot.mjs");
3333
//var Robot = await import("hubot/src/Robot.mjs");
3434
//var robot = new (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
35-
//var robot = new Robot("mock-adapter", false, "Hubot");
36-
const robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
35+
var hubot_import = await import("hubot/index.mjs");
36+
var robot = new hubot_import.Robot("mock-adapter", false, "Hubot");
37+
38+
//const robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
3739

3840
robot.logger = new Logger(true);
3941
var restore_env = null,

test/test-st2bot-setup.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ describe("stanley the StackStorm bot", async function() {
3838
//const Robot = await import("hubot/src/Robot.mjs");
3939
//var Robot = await import("hubot/src/Robot.mjs");
4040

41-
const TextMessage = await import("hubot/src/Message.mjs").TextMessage;
41+
//const TextMessage = await import("hubot/src/Message.mjs").TextMessage;
42+
var hubot_import = await import("hubot/index.mjs");
43+
4244
var user, adapter, st2bot, stop;
4345

4446
before( async function(done) {
45-
const robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
46-
robot = new Robot("mock-adapter", true, "Hubot");
47+
//var robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
48+
var robot = new hubot_import.Robot("mock-adapter", true, "Hubot");
49+
var TextMessage = new hubot_import.TextMessage;
4750
//robot = new (await import("hubot/src/Robot.mjs")).default("mock-adapter", true, "Hubot");
4851

4952
// Hack. Need a better solution than stubbing out methods.

test/test-st2bot-sigusr2.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ describe("SIGUSR2", async function () {
3232
//const Robot = await import("hubot/src/Robot.mjs");
3333
//var Robot = await import("hubot/src/Robot.mjs");
3434
//var robot = new (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
35-
const robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
35+
var hubot_import = await import("hubot/index.mjs");
3636

37-
//var robot = new Robot("mock-adapter", false, "Hubot");
37+
//const robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
38+
39+
var robot = new hubot_import.Robot("mock-adapter", false, "Hubot");
3840
robot.logger = new Logger(true);
3941
var debug_spy = sinon.spy(robot.logger, 'debug'),
4042
info_spy = sinon.spy(robot.logger, 'info');

test/test-twofactor.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ var enableTwofactor = function() {
3939
};
4040

4141
describe("two-factor auth module", async function() {
42-
const TextMessage = await import("hubot/src/Message.mjs").TextMessage;
42+
var hubot_import = await import("hubot/index.mjs");
43+
44+
//const TextMessage = await import("hubot/src/Message.mjs").TextMessage;
45+
var TextMessage = new hubot_import.TextMessage;
4346
//var Robot = await import("hubot/src/Robot.mjs");
4447

4548
var user, adapter, st2bot, stop, command_factory;
4649

4750
before( async function(done) {
48-
//robot = new Robot("mock-adapter", true, "Hubot");
49-
const robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
51+
robot = new hubot_import.Robot("mock-adapter", true, "Hubot");
52+
//const robot = (await import("hubot/src/Robot.mjs")).default("mock-adapter", false, "Hubot");
5053

5154
//robot = new (await import("hubot/src/Robot.mjs")).default("mock-adapter", true, "Hubot");
5255

0 commit comments

Comments
 (0)