Skip to content

Commit bb4612d

Browse files
committed
Update tests and remove comments
1 parent bed4c06 commit bb4612d

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

packages/provider/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ module.exports = {
5252
.getBlockNumber()
5353
.then(() => {
5454
console.log("> The test was successful!");
55-
// Cancel the setTimeout check above
5655
clearTimeout(noResponseFromNetworkCall);
5756
resolve(true);
5857
})
@@ -61,7 +60,6 @@ module.exports = {
6160
"> Something went wrong while attempting to connect " +
6261
"to the network."
6362
);
64-
// Cancel the setTimeout check above
6563
clearTimeout(noResponseFromNetworkCall);
6664
reject(error);
6765
});

packages/truffle/test/scenarios/commands/deploy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("truffle deploy (alias for migrate)", () => {
2323

2424
describe("when run on the most basic truffle project", () => {
2525
it("doesn't throw", done => {
26-
CommandRunner.run("deploy", config, error => {
26+
CommandRunner.run("deploy --network development", config, error => {
2727
assert(error === undefined, "error should be undefined here");
2828
done();
2929
});

packages/truffle/test/scenarios/commands/migrate.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ describe("truffle migrate", () => {
1515
config = conf;
1616
config.network = "development";
1717
config.logger = { log: () => {} };
18+
config.workingDirectory = conf.working_directory;
1819
})
1920
.then(() => Server.start(done));
2021
});
@@ -23,7 +24,7 @@ describe("truffle migrate", () => {
2324

2425
describe("when run on the most basic truffle project", () => {
2526
it("doesn't throw", done => {
26-
CommandRunner.run("migrate", config, error => {
27+
CommandRunner.run("migrate --network development", config, error => {
2728
assert(error === undefined, "error should be undefined here");
2829
done();
2930
});
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
const tmp = require("tmp");
2-
const fs = require("fs-extra");
3-
const config = require("@truffle/config");
2+
const fse = require("fs-extra");
3+
const Config = require("@truffle/config");
44
const path = require("path");
55

66
module.exports = {
77
copyDirectory(source, dest) {
88
return new Promise((accept, reject) => {
9-
fs.copy(source, dest, err => {
9+
fse.copy(source, dest, err => {
1010
err ? reject(err) : accept();
1111
});
1212
});
@@ -16,19 +16,19 @@ module.exports = {
1616
const self = this;
1717

1818
return new Promise((resolve, reject) => {
19-
if (!fs.existsSync(source))
19+
if (!fse.existsSync(source))
2020
return reject(`Sandbox failed: source: ${source} does not exist`);
2121

2222
try {
2323
const tempDir = tmp.dirSync({ unsafeCleanup: true });
2424
self
2525
.copyDirectory(source, tempDir.name)
2626
.then(() => {
27-
const conf = config.load(
27+
const config = Config.load(
2828
path.join(tempDir.name, subPath, "truffle-config.js"),
2929
{}
3030
);
31-
resolve(conf);
31+
resolve(config);
3232
})
3333
.catch(reject);
3434
} catch (error) {
@@ -39,11 +39,11 @@ module.exports = {
3939

4040
load(source) {
4141
return new Promise((resolve, reject) => {
42-
if (!fs.existsSync(source))
42+
if (!fse.existsSync(source))
4343
return reject(`Sandbox failed: source: ${source} does not exist`);
4444

45-
const conf = config.load(path.join(source, "truffle-config.js"), {});
46-
resolve(conf);
45+
const config = Config.load(path.join(source, "truffle-config.js"), {});
46+
resolve(config);
4747
});
4848
}
4949
};

0 commit comments

Comments
 (0)