Help needed with Advanced Node and Express - Handle a Disconnect

I dont know why I’m failing one of the test Server handles the event disconnect from a socket

'use strict';

const express     = require('express');
const session     = require('express-session');
const bodyParser  = require('body-parser');
const fccTesting  = require('./freeCodeCamp/fcctesting.js');
const auth        = require('./app/auth.js');
const routes      = require('./app/routes.js');
const mongo       = require('mongodb').MongoClient;
const passport    = require('passport');
const cookieParser= require('cookie-parser')
const app         = express();
const http        = require('http').Server(app);
const sessionStore= new session.MemoryStore();
const io          = require('')(http);
const cors = require('cors');


fccTesting(app); //For FCC testing purposes

app.use('/public', express.static(process.cwd() + '/public'));
app.use(bodyParser.urlencoded({ extended: true }));
app.set('view engine', 'pug')

  secret: process.env.SESSION_SECRET,
  resave: true,
  saveUninitialized: true,
  key: 'express.sid',
  store: sessionStore,

var currentUsers = 0;

mongo.connect(process.env.DATABASE, (err, db) => {
    if(err) console.log('Database error: ' + err);
    auth(app, db);
    routes(app, db);
    http.listen(process.env.PORT || 3000);

    //start code  
  io.on('connection', socket => {
    console.log('A user has connected');
    io.emit('user count', currentUsers);

  io.on('disconnect', socket => {
    console.log('A user has disconnect');
    io.emit('user count', currentUsers);
    //end code

my server.js file

$( document ).ready(function() {
   /*global io*/
  var socket = io();
  socket.on('user count', function(data){
    console.log('A user connect');
  socket.on('user count', function(data){
    console.log('A user disconnect');
  // Form submittion with new message in field with id 'm'
    var messageToSend = $('#m').val();
    //send message to server here?
    return false; // prevent form submit from refreshing page


pls help, tnx.