forked from remoteinterview/zero
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Asad Memon
committed
Jan 28, 2019
1 parent
49fd96b
commit fe59e08
Showing
14 changed files
with
72 additions
and
41 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,17 @@ | ||
const {get} = require("../request") | ||
const cheerio = require('cheerio') | ||
|
||
// JS Lambda | ||
test('JS Lambda in root folder', () => { | ||
// expect.assertions(1); | ||
return get("/").then(data => { | ||
expect(data).toBe('Hello'); | ||
}); | ||
}); | ||
|
||
test('Login and redirect', () => { | ||
// expect.assertions(1); | ||
return get("/api/login", {jar: true, json: true}).then(data => { | ||
expect(data.id).toBe('asad'); | ||
}); | ||
}); |
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,20 @@ | ||
const {get} = require("../request") | ||
const cheerio = require('cheerio') | ||
|
||
// React Lambda | ||
test('React Stateless', () => { | ||
//expect.assertions(1); | ||
return get("/react/stateless").then(data => { | ||
const $ = cheerio.load(data) | ||
expect($('body').text().trim()).toBe("react-stateless"); | ||
}); | ||
}); | ||
|
||
|
||
test('React With Imports', () => { | ||
//expect.assertions(1); | ||
return get("/react/withimports").then(data => { | ||
const $ = cheerio.load(data) | ||
expect($('body').text().trim()).toBe("246"); | ||
}); | ||
}); |
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,18 @@ | ||
const {get} = require("../request") | ||
const cheerio = require('cheerio') | ||
|
||
// Path matching | ||
test('Html file in root folder', () => { | ||
// expect.assertions(1); | ||
return get("/heading").then(data => { | ||
const $ = cheerio.load(data) | ||
expect($('h1').text().trim()).toBe("title"); | ||
}); | ||
}); | ||
|
||
test('Txt file in root folder', () => { | ||
// expect.assertions(1); | ||
return get("/text.txt").then(data => { | ||
expect(data).toBe("text content"); | ||
}); | ||
}); |
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 was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,14 @@ | ||
const React = require('react') | ||
|
||
var _ = require('underscore'); | ||
|
||
|
||
const HelloWorld = props => { | ||
return ( | ||
<React.Fragment> | ||
{_.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 != 0)} | ||
</React.Fragment> | ||
) | ||
} | ||
|
||
module.exports =HelloWorld |
File renamed without changes.