These are chat archives for canjs/canjs

May 2017
Jeroen Cornelissen
May 22 2017 13:04
If you set type 'date' on a DefineMap property, the result is null.
I’ve submitted an issue: canjs/can-define#203
Frank Lemanschik
May 22 2017 13:06
maybe you should set new Date().toString()
Jeroen Cornelissen
May 22 2017 13:07
@frank-dspeed all other browsers work, only in Safari this is an issue.
Matthew Phillips
May 22 2017 15:04
trying to find someone to look into this bug
Gira Minus
May 22 2017 17:07
Yeah i keep dates as strings
Pedro Mendes
May 22 2017 17:34
Hi all,
I'm struggling to setup a fixture that enables the testing of a model where the method getData is being overwritten to allow custom URL.
In the example bellow the fixture is matched (and the test passes) only if the query parameter "id" is not present in the url passed to Todo.get() nor in the fixture key.
Am I missing something?
var DefineMap = require("can-define/map/map");
var DefineList = require("can-define/list/list");
var connect = require("can-connect");
var set = require("can-set");
var QUnit = require("steal-qunit");
var fixture = require("can-fixture");

const Todo = DefineMap.extend({
  id: "string"

Todo.List = DefineList.extend({
  "#": Todo

Todo.algebra = new set.Algebra("id"));

Todo.connection = connect([
], {
  Map: Todo,
  List: Todo.List,
  url: {
    getData: "{url}"

QUnit.module("Todo module");

QUnit.test("full custom url", function(assert) {

  fixture("GET /todos?id=A", {id: "A"});

  Todo.get({url: "/todos?id=A"}).then(todo => {
    assert.equal(, "A");

Thomas Sieverding
May 22 2017 18:32
@pmgmendes you should use something like:
  url: {
    resource: config.hosts.api + ‘/todo'
  'GET /todos': store.findAll,
  'GET /todos/{_id}': store.findOne,
  'POST /todos': store.create,
  'PUT /todos/{_id}': store.update,
  'DELETE /todos/{_id}': store.destroy
I don’t think your url configration is parseable
If you need super fine-grain control, you should provide your own method
Pedro Mendes
May 22 2017 22:51

@Bajix Thanks for the reply.
Because the request is being done as expected at I think the getData string is parsed correctly.
The main issue is related to the fixture not being returned because both exact and loose matches fail - can-fixture/core.js#get(xhrSettings).
When the fixture is initialized with no query params works just fine

 fixture("/todos", {id: "A"});

I'v also tried the usage as you exemplified and documented in can-fixture/

var todoStore =[{id: "A"}], Todo.algebra);

fixture("GET /todos?id=A", todoStore.getData);

Still no luck though..

I would like to avoid writing my own common interface implementations just to provide a specific URL for the getData interface. I think I would end up repeating a big part of the boilerplate code in data/url (like makeAjax, etc).