Skip to content

Instantly share code, notes, and snippets.

View zacck-zz's full-sized avatar
Lemur Heavy

Zacck Osiemo zacck-zz

Lemur Heavy
View GitHub Profile
//get request
$.ajax({
type: 'GET',
url:'Review/getDefaultReview',
data:{},
dataType:'json',
success: function(pulledSection){
//console.log(newOrder);
//addOrder(newOrder);
//$salutations.append('<li>'+ newOrder.Salutations +'</li>');
/*This is the html for the list and the Template*/
<ul class="list-group padded" id="edit_rate_cost_list">
</ul>
<template id="supplier_edit_rate_cost_template">
<div class="row">
<li class="rate_list" id={{rate_id}}>
<div class="item">
<p class="result-title">{{rate_start_date}} - {{rate_end_date}}</p>
<p>STO: {{sto_rate_cost}} Rack: {{rack_rate_cost}}</p>
</div>
var http = require('http');
http.createServer(function(re, res) {
res.writeHead(200, {'Content-Type':'text/plain'});
res.end('Hello World\n');
}).listen(8080)
console.log('Server running on port 8080');
var webpackConfig = require('./webpack.config.js');
module.exports = function (config) {
config.set({
browsers: ['Chrome'], //browers to use for testng
singleRun: true,
frameworks: ['mocha'], //frameworks used in testing
files: [
'node_modules/script!jquery/dist/jquery.min.js',
'node_modules/script!foundation-sites/dist/foundation.min.js',
'app/tests/**/*.test.jsx'
//load module
var express = require('express');
//create our app
var app = express();
const PORT = process.env.PORT || 3000;
//HTTPS TO HTTP
app.use(function (req, res, next){
/*if over http
export var startToggleTodo = (id, completed) => {
return (dispatch, getState) => {
/*access item we need to change*/
var todoRef = firebaseRef.child(`todos/${id}`);
/*generate Updates*/
var updates = {
completed,
completedAt: completed ? moment.unix() : null
};
/*Add dependencies for testing actions*/
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import expect from 'expect';
import firebase, {firebaseRef} from 'app/firebase';
import moment from 'moment';
import * as actions from 'app/actions/actions'//TODO read up on import and require difference
/*Lets Make a mock store for testing CRUD Actions*/
var createMockStore = configureMockStore([thunk]); //TODO read up
@zacck-zz
zacck-zz / logs
Created September 29, 2016 14:11
Actions
Async supplier action tests
✖ should add a new supplier to firebase and dispatch ADD_SUPPLIER
Chrome 53.0.2785 (Mac OS X 10.11.6)
Error: The "actual" argument in expect(actual).toInclude() must be an array or a string
at Object.assert [as default] (eval at <anonymous> (/Users/zacck/Documents/www/jtx/app/tests/actions/actions.test.jsx:1230:2), <anonymous>:20:9)
at Expectation.toInclude (eval at <anonymous> (/Users/zacck/Documents/www/jtx/app/tests/actions/actions.test.jsx:1128:2), <anonymous>:180:24)
at eval (eval at <anonymous> (/Users/zacck/Documents/www/jtx/app/tests/actions/actions.test.jsx:47:2), <anonymous>:76:43)
Async Tests
FAILED TESTS:
Actions
Supplier Actions
Async Actions
✖ should upload supplier and dispatch ADD_SUPPLIER
Chrome 53.0.2785 (Mac OS X 10.12.0)
Error: The "actual" argument in expect(actual).toInclude() must be an array or a string
at Object.assert [as default] (eval at <anonymous> (/Users/zacck/Documents/www/jtx/app/tests/actions/actions.test.jsx:1230:2), <anonymous>:20:9)
at Expectation.toInclude (eval at <anonymous> (/Users/zacck/Documents/www/jtx/app/tests/actions/actions.test.jsx:1128:2), <anonymous>:180:24)
at eval (eval at <anonymous> (/Users/zacck/Documents/www/jtx/app/tests/actions/actions.test.jsx:47:2), <anonymous>:129:45)
{
"name": "vibe-hive",
"version": "0.0.1",
"description": "Find your Vibe around you!",
"main": "index.js",
"scripts": {
"test": "NODE_ENV=test karma start",
"build": "webpack",
"start": " npm run build && node server.js"
},