Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history


* 'master' of /~https://github.com/CompuIves/codesandbox-client:
  Fix tests causing sandbox to infinite reload
  Fix NPE
  Update Select.js (codesandbox#461)
  Native Integration for Running Unit Tests in CodeSandbox - Fix (codesandbox#458)
  update `README.md` to include link for phoneix framework (codesandbox#459)
  • Loading branch information
gautamarora committed Jan 17, 2018
2 parents c96843c + 6f68466 commit e5edbb7
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,16 @@
"code",
"ideas"
]
},
{
"login": "haroenv",
"name": "Haroen Viaene",
"avatar_url": "https://avatars3.githubusercontent.com/u/6270048?v=4",
"profile": "https://twitter.com/haroenv",
"contributions": [
"code",
"design"
]
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CodeSandbox consists of several separate servers, some of which are open
sourced.

* Client: the web application
* Server: the Phoenix API server
* Server: the [Phoenix](/~https://github.com/phoenixframework/phoenix) API server
* Nginx: Nginx config files
* [Git Extractor](/~https://github.com/CompuIves/codesandbox-git-extractor):
responsible for extracting the source from a GitHub repository
Expand Down
6 changes: 4 additions & 2 deletions packages/app/src/app/components/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ import styled from 'styled-components';

export default styled.select`
transition: 0.3s ease border-color;
background-color: rgba(0, 0, 0, 0.3);
background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgNC45NSAxMCI+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0xLjQxIDQuNjdsMS4wNy0xLjQ5IDEuMDYgMS40OUgxLjQxek0zLjU0IDUuMzNMMi40OCA2LjgyIDEuNDEgNS4zM2gyLjEzeiI+PC9wYXRoPjwvc3ZnPg==) no-repeat 90% 40%; background-color: rgba(0, 0, 0, 0.3);
color: white;
border: none;
outline: none;
border-radius: 4px;
color: white;
padding: .2em 1em .2em .2em;
width: inherit;
box-sizing: border-box;
font-weight: 300;
height: 1.75em;
appearance: none;
border: 1px solid
${props =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ class Console extends React.Component<Props, State> {
const { result, error } = data;

const aggregatedResults = result ? CircularJSON.parse(result) : result;
const { summaryMessage, failedMessages } = aggregatedResults;

if (!error) {
if (aggregatedResults) {
const { summaryMessage, failedMessages } = aggregatedResults;
this.addMessage('log', [summaryMessage]);
failedMessages.forEach(t => {
this.addMessage('warn', [t]);
Expand Down
30 changes: 17 additions & 13 deletions packages/app/src/sandbox/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,24 @@ async function compile({
initializeResizeListener();
}

// Testing
const ttt = Date.now();
const testRunner = manager.testRunner;
testRunner.initialize();
testRunner.findTests(modules);
await testRunner.runTests();
const aggregatedResults = testRunner.reportResults();
debug(`Test Evaluation time: ${Date.now() - ttt}ms`);
try {
// Testing
const ttt = Date.now();
const testRunner = manager.testRunner;
testRunner.initialize();
testRunner.findTests(modules);
await testRunner.runTests();
const aggregatedResults = testRunner.reportResults();
debug(`Test Evaluation time: ${Date.now() - ttt}ms`);

dispatch({
type: 'test-result',
result: transformJSON(aggregatedResults),
});
// End - Testing
dispatch({
type: 'test-result',
result: transformJSON(aggregatedResults),
});
// End - Testing
} catch (e) {
// Fail silently
}

debug(`Total time: ${Date.now() - startTime}ms`);

Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/sandbox/eval/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ export default class Manager {
* Will transpile this module and all eventual children (requires) that go with it
* @param {*} entry
*/
async transpileModules(entry: Module) {
async transpileModules(entry: Module, isEntry: boolean = true) {
this.hmrStatus = 'check';
this.setEnvironmentVariables();
const transpiledModule = this.getTranspiledModule(entry);

transpiledModule.setIsEntry(true);
transpiledModule.setIsEntry(isEntry);

const result = await transpiledModule.transpile(this);
this.getTranspiledModules().forEach(t => t.postTranspile(this));
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/sandbox/eval/tests/jest-lite.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default class TestRunner {

async transpileTests() {
for (let t of this.tests) {
await this.manager.transpileModules(t);
await this.manager.transpileModules(t, false);
}
}

Expand Down

0 comments on commit e5edbb7

Please sign in to comment.