Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decaffeinate docs spec #71

Merged
merged 4 commits into from
May 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added some breathing room
confused-Techie authored May 21, 2023
commit f949636409922e32b8f626c529ae9e62ab2b493b
10 changes: 10 additions & 0 deletions spec/docs-spec.js
Original file line number Diff line number Diff line change
@@ -11,18 +11,23 @@ describe('apm docs', () => {
silenceOutput();
spyOnToken();
const app = express();

app.get('/wrap-guide', (_request, response) => {
response.sendFile(path.join(__dirname, 'fixtures', 'wrap-guide.json'));
});

app.get('/install', (_request, response) => {
response.sendFile(path.join(__dirname, 'fixtures', 'install.json'));
});

server = http.createServer(app);
let live = false;

server.listen(3000, '127.0.0.1', () => {
process.env.ATOM_PACKAGES_URL = 'http://localhost:3000';
live = true;
});

waitsFor(() => live);
});

@@ -38,6 +43,7 @@ describe('apm docs', () => {
const callback = jasmine.createSpy('callback');
apm.run(['docs', 'install'], callback);
waitsFor('waiting for command to complete', () => callback.callCount > 0);

runs(() => {
expect(console.error).toHaveBeenCalled();
expect(console.error.argsForCall[0][0].length).toBeGreaterThan(0);
@@ -48,6 +54,7 @@ describe('apm docs', () => {
const callback = jasmine.createSpy('callback');
apm.run(['docs'], callback);
waitsFor('waiting for command to complete', () => callback.callCount > 0);

runs(() => {
expect(console.error).toHaveBeenCalled();
expect(console.error.argsForCall[0][0].length).toBeGreaterThan(0);
@@ -59,6 +66,7 @@ describe('apm docs', () => {
const callback = jasmine.createSpy('callback');
apm.run(['docs', '--print', 'wrap-guide'], callback);
waitsFor('waiting for command to complete', () => callback.callCount > 0);

runs(() => {
expect(Docs.prototype.openRepositoryUrl).not.toHaveBeenCalled();
expect(console.log).toHaveBeenCalled();
@@ -72,6 +80,7 @@ describe('apm docs', () => {
const callback = jasmine.createSpy('callback');
apm.run(['docs', '-p', 'wrap-guide'], callback);
waitsFor('waiting for command to complete', () => callback.callCount > 0);

runs(() => {
expect(Docs.prototype.openRepositoryUrl).not.toHaveBeenCalled();
expect(console.log).toHaveBeenCalled();
@@ -84,6 +93,7 @@ describe('apm docs', () => {
const callback = jasmine.createSpy('callback');
apm.run(['docs', 'wrap-guide'], callback);
waitsFor('waiting for command to complete', () => callback.callCount > 0);

runs(() => {
expect(Docs.prototype.openRepositoryUrl).toHaveBeenCalled();
});