tests: Delete erroneous `describe()` calls
`describe()` is meant to be used by independent tests, but the tests in this file are not independent. Add a higher-level `describe()` call and delete all of the `describe()` calls that wrap a single test.pull/4685/head
parent
32a0df4883
commit
dd815892f2
|
@ -227,6 +227,7 @@ const testImports = {
|
|||
|
||||
describe(__filename, function () {
|
||||
Object.keys(testImports).forEach((testName) => {
|
||||
describe(testName, function () {
|
||||
const testPadId = makeid();
|
||||
const test = testImports[testName];
|
||||
if (test.disabled) {
|
||||
|
@ -234,8 +235,7 @@ describe(__filename, function () {
|
|||
done();
|
||||
});
|
||||
}
|
||||
describe(`createPad ${testName}`, function () {
|
||||
it('creates a new Pad', function (done) {
|
||||
it('createPad', function (done) {
|
||||
api.get(`${endPoint('createPad')}&padID=${testPadId}`)
|
||||
.expect((res) => {
|
||||
if (res.body.code !== 0) throw new Error('Unable to create new Pad');
|
||||
|
@ -243,10 +243,8 @@ describe(__filename, function () {
|
|||
.expect('Content-Type', /json/)
|
||||
.expect(200, done);
|
||||
});
|
||||
});
|
||||
|
||||
describe(`setHTML ${testName}`, function () {
|
||||
it('Sets the HTML', function (done) {
|
||||
it('setHTML', function (done) {
|
||||
api.get(`${endPoint('setHTML')}&padID=${testPadId}&html=${encodeURIComponent(test.input)}`)
|
||||
.expect((res) => {
|
||||
if (res.body.code !== 0) throw new Error(`Error:${testName}`);
|
||||
|
@ -254,10 +252,8 @@ describe(__filename, function () {
|
|||
.expect('Content-Type', /json/)
|
||||
.expect(200, done);
|
||||
});
|
||||
});
|
||||
|
||||
describe(`getHTML ${testName}`, function () {
|
||||
it('Gets back the HTML of a Pad', function (done) {
|
||||
it('getHTML', function (done) {
|
||||
api.get(`${endPoint('getHTML')}&padID=${testPadId}`)
|
||||
.expect((res) => {
|
||||
const receivedHtml = res.body.data.html;
|
||||
|
@ -279,10 +275,8 @@ describe(__filename, function () {
|
|||
.expect('Content-Type', /json/)
|
||||
.expect(200, done);
|
||||
});
|
||||
});
|
||||
|
||||
describe(`getText ${testName}`, function () {
|
||||
it('Gets back the Text of a Pad', function (done) {
|
||||
it('getText', function (done) {
|
||||
api.get(`${endPoint('getText')}&padID=${testPadId}`)
|
||||
.expect((res) => {
|
||||
const receivedText = res.body.data.text;
|
||||
|
|
Loading…
Reference in New Issue