-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from dtex/servoTests
Servo tests
- Loading branch information
Showing
9 changed files
with
245 additions
and
110 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import assert from "assert"; | ||
import sinon from "sinon"; | ||
import { Digital, PWM } from "@dtex/mock-io"; | ||
import ClassName from "j5e/classname"; | ||
|
||
describe("ClassName", function() { | ||
|
||
describe("Instantiation", function() { | ||
|
||
// All tests related to default instantiation | ||
|
||
describe("Options", function() { | ||
|
||
describe("someOptionProperty", async function() { | ||
|
||
it("should be configured appropriately for the option", async function() { | ||
// ... | ||
}); | ||
|
||
// [ All other tests related to this option ] | ||
|
||
}); | ||
}); | ||
|
||
// [ All other options, each with it's own describe ] | ||
|
||
}); | ||
|
||
describe("Properties", function() { | ||
|
||
describe("someProperty", function() { | ||
|
||
it("should respond with the property value", async function() { | ||
// ... | ||
}); | ||
|
||
// [ all other tests related to someProperty ] | ||
|
||
}); | ||
|
||
// [ All other properties, each with it's own describe ] | ||
|
||
}); | ||
|
||
describe("Methods", function() { | ||
|
||
describe("someMethod", function() { | ||
|
||
it("should do the right thing", async function() { | ||
// ... | ||
}); | ||
|
||
// [ all other tests related to someMethod ] | ||
|
||
}); | ||
|
||
// [ All other methods, each with it's own describe ] | ||
|
||
}); | ||
|
||
describe("Events", function() { | ||
|
||
describe("someEvent", function() { | ||
|
||
it("should emit the event at the appropriate time", async function() { | ||
// ... | ||
}); | ||
|
||
// [ all other tests related to someEvent ] | ||
|
||
}); | ||
|
||
// [ All other events, each with it's own describe ] | ||
|
||
}); | ||
|
||
}); |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Servo from "j5e/servo"; | ||
|
||
const servo = await new Servo(12); | ||
servo.sweep(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"include": [ | ||
"$(MODDABLE)/modules/io/manifest.json", | ||
"$(j5e)/lib/servo/manifest.json" | ||
], | ||
"modules": { | ||
"*": "./main" | ||
} | ||
} |
Oops, something went wrong.